【问题标题】:How to send media to Jitsi videobridge using prosody?如何使用韵律将媒体发送到 Jitsi videobridge?
【发布时间】:2017-09-17 22:23:42
【问题描述】:

我对 xmpp 和 webrtc 比较陌生。现在,我尝试使用 Jitsi Videobridge 和 prosody 创建简单的视频会议网络应用程序,我不想使用 jitsi-meet,因为我需要知道如何让 jitsi-videobridge 工作。到目前为止,我可以让韵律接受 jitsi-videobridge 组件。所以当我运行./jvb.sh --domain=localhost --port=5347 --secret=componentsecret 时,它会显示这些日志:

JVB 2017-04-21 10:52:53.798 INFO: [38] 
org.jitsi.videobridge.xmpp.ComponentImpl.log() RECV: <iq id="f68D9-340" 
type="result" to="jitsi-videobridge.localhost" from="localhost"/>
JVB 2017-04-21 10:53:03.801 INFO: [40] 
org.jitsi.videobridge.xmpp.ComponentImpl.log() RECV: <iq id="f68D9-341" 
type="result" to="jitsi-videobridge.localhost" from="localhost"/>
JVB 2017-04-21 10:53:13.801 INFO: [42] 
org.jitsi.videobridge.xmpp.ComponentImpl.log() RECV: <iq id="f68D9-342" 
type="result" to="jitsi-videobridge.localhost" from="localhost"/>
JVB 2017-04-21 10:53:23.801 INFO: [44] 
org.jitsi.videobridge.xmpp.ComponentImpl.log() RECV: <iq id="f68D9-343" 
type="result" to="jitsi-videobridge.localhost" from="localhost"/>
JVB 2017-04-21 10:53:33.801 INFO: [46] 
org.jitsi.videobridge.xmpp.ComponentImpl.log() RECV: <iq id="f68D9-344" 
type="result" to="jitsi-videobridge.localhost" from="localhost"/>

我认为这是因为我的 jitsi-videobridge 工作正常(不是吗?)。但现在我不知道下一步该做什么。

那么,如何将我的客户端(我的 Web 客户端使用 strophe.js)连接到 jitsi-videobridge?以及我的客户如何能够将媒体(视频和音频)发送到 jitsi-videobridge。 我已经搜索了一段时间,但找不到任何文档或任何关于如何做到这一点的示例。 p>

这是我的韵律 prosody.cfg.lua:

admins = { 
    "agent@localhost", 
    "subkhan@localhost", 
    "subkhan@192.168.8.108", 
    "focus@auth.jitsi.localhost"
}

modules_enabled = {
        "message_logging";  -- Enable chat archive
        "tls"; -- Enable mod_tls

        "roster"; -- Allow users to have a roster. Recommended ;)
        "saslauth"; -- Authentication for clients and servers. Recommended if you want to log in.
        "tls"; -- Add support for secure TLS on c2s/s2s connections
        "dialback"; -- s2s dialback support
        "disco"; -- Service discovery

        "private"; -- Private XML storage (for room bookmarks, etc.)
        "vcard"; -- Allow users to set vCards

        "version"; -- Replies to server version requests
        "uptime"; -- Report how long server has been running
        "time"; -- Let others know the time here on this server
        "ping"; -- Replies to XMPP pings with pongs
        "pep"; -- Enables users to publish their mood, activity, playing music and more
        "register"; -- Allow users to register on this server using a client and change passwords

        "admin_adhoc"; -- Allows administration via an XMPP client that supports ad-hoc commands
        "admin_telnet"; -- Opens telnet console interface on localhost port 5582

        "bosh"; -- Enable BOSH clients, aka "Jabber over HTTP"
        "http_files"; -- Serve static files from a directory over HTTP

        "posix"; -- POSIX functionality, sends server to background, enables syslog, etc.
};

bosh_ports = {
        {
            port = 5280;
        path = "http-bind";
        },
        {
        port = 5281;
            path = "http-bind";
            ssl = {
                key = "/var/lib/prosody/localhost.key";
                certificate = "/var/lib/prosody/localhost.crt";
            }
        }
    }

bosh_max_inactivity = 60
consider_bosh_secure = true
cross_domain_bosh = true

modules_disabled = {
    -- "offline"; -- Store offline messages
    -- "c2s"; -- Handle client connections
    -- "s2s"; -- Handle server-to-server connections
};

allow_registration = true;

daemonize = true;

pidfile = "/var/run/prosody/prosody.pid";

ssl = {
    key = "/etc/prosody/certs/localhost.key";
    certificate = "/etc/prosody/certs/localhost.crt";
}

c2s_require_encryption = true

s2s_secure_auth = true

authentication = "internal_plain"

log = {
    -- Log files (change 'info' to 'debug' for debug logs):
    info = "/var/log/prosody/prosody.log";
    error = "/var/log/prosody/prosody.err";
    -- Syslog:
    { levels = { "error" }; to = "syslog";  };
}

VirtualHost "localhost"
    enabled = true -- Remove this line to enable this host

    ssl = {
        key = "/etc/prosody/certs/localhost.key";
        certificate = "/etc/prosody/certs/localhost.crt";
    }

Component "conference.localhost" "muc"
    restrict_room_creation = true
    max_history_messages = 10
        modules_enabled = {
        "muc_log";
        "muc_log_http";
    }
    muc_log_http = { -- These are the defaults
        show_join = true;
        show_presences = true;
        show_status = true;
        theme = "prosody";
        url_base = "muc_log";
    }

VirtualHost "jitsi.localhost"
    enable = true
    authentication = "internal_plain"

VirtualHost "auth.jitsi.localhost"
    authentication = "internal_plain"

Component "jitsi-videobridge.localhost"
    component_secret = "asdqwe123"

Include "conf.d/*.cfg.lua"

这是我的 sip-communicator.properties:

org.jitsi.impl.neomedia.transform.srtp.SRTPCryptoContext.checkReplay=false
org.jitsi.videobridge.NAT_HARVESTER_LOCAL_ADDRESS=127.0.0.1
org.jitsi.videobridge.NAT_HARVESTER_PUBLIC_ADDRESS=192.168.43.110

有什么帮助或想法吗? 谢谢。

【问题讨论】:

    标签: lua xmpp webrtc jitsi prosody-im


    【解决方案1】:

    这种情况不会马上奏效。我们使用 Jicofo 作为焦点,它是实体“对话”到 JVB,然后是用户。这是它的工作原理(我假设你在网络环境中,因为你提到了 strophe.js):

    • 用户通过 XMPP 连接
    • 用户加入 MUC
    • Jicofo 是管理员并加入每个 MUC
    • 另一个用户加入了 MUC
    • Jicofo 使用 COLIBRI 协议从 JVB 请求音频/视频通道
    • Jicofo 编写一个 Jingle 节并通过 MUC 直接消息将其发送给每个参与者
    • 用户获取 Jingle 节并将其转换为 SDP
    • 用户可以使用该远程 SDP 设置 WebRTC PeerConnection
    • 利润? :-)

    希望对您有所帮助。免责声明:我在 Jitsi 工作。

    【讨论】:

    • 谢谢你的回答,它解释了很多。
    • 你能看看我的另一个问题吗? stackoverflow.com/questions/43629236/… 我尝试运行 jicofo 但它无法连接。谢谢。
    • 根据您的回答我有一个问题:Jicofo is an admin and joing every MUC - 如果有新客户加入新的 MUC,Jicofo 会自动加入新的 MUC 吗?或者客户必须将特定的节发送到特定的 MUC 以便 Jicofo 知道有新的 MUC 加入?
    • 不需要任何特殊的节,Jicofo 将永远加入新的 MUC。
    • 在 SDP 和 Jingle 节之间转换听起来很容易,但是如果您在非 JS WebRTC 客户端中工作,则没有可用的库。看起来唯一的方法是从 strophe.jingle 项目中移植代码并尝试跟上更新。为什么这个提议xmpp.org/extensions/inbox/jingle-sdp.html没有被接受?这似乎更合理。
    猜你喜欢
    • 2020-07-10
    • 2022-01-10
    • 2019-04-04
    • 2017-06-10
    • 1970-01-01
    • 2021-03-08
    • 2020-11-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多