<commit_before>/* global $, $iq, Strophe */

import { getLogger } from "jitsi-meet-logger";
const logger = getLogger(__filename);
import ConnectionPlugin from "./ConnectionPlugin";

const RAYO_XMLNS = 'urn:xmpp:rayo:1';

class RayoConnectionPlugin extends ConnectionPlugin {
    init (connection) {
        super.init(connection);
        const disco = this.connection.disco;
        if (disco) {
            disco.addFeature('urn:xmpp:rayo:client:1');
        }

        this.connection.addHandler(
            this.onRayo.bind(this), RAYO_XMLNS, 'iq', 'set', null, null);
    }

    onRayo (iq) {
        logger.info("Rayo IQ", iq);
    }

    dial (to, from, roomName, roomPass, focusMucJid) {
        return new Promise((resolve, reject) => {
            if(!focusMucJid) {
                reject(new Error("Internal error!"));
                return;
            }
            const req = $iq({
                type: 'set',
                to: focusMucJid
            });
            req.c('dial', {
                xmlns: RAYO_XMLNS,
                to: to,
                from: from
            });
            req.c('header', {
                name: 'JvbRoomName',
                value: roomName
            }).up();

            if (roomPass !== null && roomPass.length) {
                req.c('header', {
                    name: 'JvbRoomPassword',
                    value: roomPass
                }).up();
            }

            this.connection.sendIQ(req, (result) => {<commit_msg>Fixes sip calling.<commit_after>/* global $, $iq, Strophe */

import { getLogger } from "jitsi-meet-logger";
const logger = getLogger(__filename);
import ConnectionPlugin from "./ConnectionPlugin";

const RAYO_XMLNS = 'urn:xmpp:rayo:1';

class RayoConnectionPlugin extends ConnectionPlugin {
    init (connection) {
        super.init(connection);
        const disco = this.connection.disco;
        if (disco) {
            disco.addFeature('urn:xmpp:rayo:client:1');
        }

        this.connection.addHandler(
            this.onRayo.bind(this), RAYO_XMLNS, 'iq', 'set', null, null);
    }

    onRayo (iq) {
        logger.info("Rayo IQ", iq);
    }

    dial (to, from, roomName, roomPass, focusMucJid) {
        return new Promise((resolve, reject) => {
            if(!focusMucJid) {
                reject(new Error("Internal error!"));
                return;
            }
            const req = $iq({
                type: 'set',
                to: focusMucJid
            });
            req.c('dial', {
                xmlns: RAYO_XMLNS,
                to: to,
                from: from
            });
            req.c('header', {
                name: 'JvbRoomName',
                value: roomName
            }).up();

            if (roomPass && roomPass.length) {
                req.c('header', {
                    name: 'JvbRoomPassword',
                    value: roomPass
                }).up();
            }

            this.connection.sendIQ(req, (result) => {
{'fraction_non_alphanumeric': 0.13049267643142476, 'fraction_numerical': 0.0013315579227696406, 'mean_word_length': 1.5041666666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2985484', 'n_tokens_mistral': 902, 'n_tokens_neox': 859, 'n_words': 181}