2

私は SIP-WebRTC の初心者であり、アスタリスクのフリースイッチで websocket を構成する方法を知る必要があります /etc/asterisk/http.conf で構成されていますが、フリースイッチでの構成がわかりません。

( 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/を使用しています

どうもありがとうございました!!!

4

1 に答える 1

2

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

于 2015-05-05T05:01:52.537 に答える