【问题标题】:freeswitch and sip.js how to configure websocketfreeswitch 和 sip.js 如何配置 websocket
【发布时间】:2015-05-04 22:01:21
【问题描述】:

我是 SIP-WebRTC 的初学者,需要知道如何在 freeswitch 中配置 websocket,星号在 /etc/asterisk/http.conf 中配置,但我不知道在 freeswitch 中配置,下面是我的 sip.js

( function()
  {
     var session;
     var endButton = document.getElementById('endCall');
     endButton.addEventListener("click", function (){
           session.bye();
           alert ("Call Terminated");
           }
           , false
                               );


     //Registration via websocket 
     var config = {
                        // my extension and ip of freeswitch
                        uri: '4009@10.20.11.10',

                        //in asterisk i used some how this. here is my problem :( how to do it in freeswitch?
                         wsServers: 'ws://192.168.0.3:8088/ws',

                        //here is my 4009
                        authorizationUser: '4009',

                        // my password
                        password: 'testsip',

                        
                        traceSip: true,


                        stunServers: 'null',
                 };


   
     var userAgent = new SIP.UA (config);

     var options = {

                     media: {
                              constraints: {
                                             audio: true,
                                             video: false,
                                           },
                              render: {
                                        remote: {
                                                   audio: document.getElementById('remoteAudio')
                                                },

                                        local:  {
                                                   audio: document.getElementById('localAudio')
                                                }
                                      }
                           }
    };



    function onAccepted ()
    {
        alert("Call Connected");
    }

    function onDisconnected ()
    {
        alert("Call Terminated");
    }


    //makes the call
    session = userAgent.invite('1000', options);
    session.on('accepted', onAccepted);
    //session.on('disconnected', onDisconnected);

  }

)();

我的项目使用http://sipjs.com/

非常感谢大家!!!

【问题讨论】:

    标签: javascript freeswitch opensips


    【解决方案1】:

    我假设您已经安装并运行了一个 FreeSwitch 实例。在定义用于侦听的套接字的 conf 文件中,您需要取消注释用于侦听的 ws 和 wss 端口。这应该让实例监听来自 sip.js 的 WebSocket 消息。

    <param name="ws-binding"  value=":80"/>
    <param name="wss-binding"  value=":443"/>
    

    更多信息 - https://wiki.freeswitch.org/wiki/Webrtc

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多