没有音频与chrome使用sip.js基于webrtc应用程序和星号11.11.0.在firefox和Opera上运行良



我正在使用sip.js和星号工作。我的webrtc应用程序在firefox 31和opera 22.0.1471.70下运行良好。但是当我使用我的web应用程序与chrome(版本37.0.2062.58 beta-m(64位))。一切似乎都很好,但没有声音。我还尝试了32版本的最新稳定chrome浏览器。问题还是一样的。

Setup Details:-
1. Asterisk 32 bit - 11.11.0
2. Sip-0.6.1.js 
3. Chrome (Version 37.0.2062.58 beta-m (64-bit)), Firefox 31.0 and opera 22.0.1471.70.
4. Cent O.S 6.5 (32 bit)

星号配置:

http.conf :-
[general]
enabled=yes
bindaddr=0.0.0.0
bindport=8088
sip.conf :-
[1061] ; This will be the legacy SIP client
type=friend
username=1061
host=dynamic
secret=password
context=default

[1090] ; This will be WebRTC client
type=friend
username=1090 ; The Auth user for SIP.js
host=dynamic ; Allows any host to register
secret=testsip ; The SIP Password for SIP.js
encryption=yes ; Tell Asterisk to use encryption for this peer
avpf=yes ; Tell Asterisk to use AVPF for this peer
icesupport=yes ; Tell Asterisk to use ICE for this peer
context=default ; Tell Asterisk which context to use when this peer is dialing
directmedia=no ; Asterisk will relay media for this peer
transport=udp,ws ; Asterisk will allow this peer to register on UDP or WebSockets
force_avp=yes ; Force Asterisk to use avp. Introduced in Asterisk 11.11
dtlsenable=yes ; Tell Asterisk to enable DTLS for this peer
dtlsverify=no ; Tell Asterisk to not verify your DTLS certs
dtlscertfile=/etc/asterisk/keys/asterisk.pem ; Tell Asterisk where your DTLS cert file is
dtlsprivatekey=/etc/asterisk/keys/asterisk.pem ; Tell Asterisk where your DTLS private key is
dtlssetup=actpass ; Tell Asterisk to use actpass SDP parameter when setting up DTLS
nat=no
disallow=all
allow=ulaw
extension.conf 
[default]
exten => 1060,1,Dial(SIP/1060) ; Dialing 1060 will call the SIP client registered to 1060
exten => 1061,1,Dial(SIP/1061) ; Dialing 1061 will call the SIP client registered to 1061

web应用程序代码:-

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

     //Registration and websocket connectivity details for the useragent
     var config = {
                        // Asterisk IP address
                        uri: '1090@192.168.56.129',
                        // Asterisk IP address,
                        // and replace the port with your Asterisk port from the http.conf file
                        wsServers: 'ws://192.168.56.129:8088/ws',
                        // Replace this with the username from your sip.conf file
                        authorizationUser: '1090',
                        // Replace this with the password from your sip.conf file
                        password: 'testsip',
                        // Enable sip traces on js console
                        traceSip: true,

                        stunServers: 'null',
                 };

     //Creates the anonymous user agent so that you can make calls
     var userAgent = new SIP.UA (config);
    //Here you determine whether the call has video and audio
     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);
  }
)();

SipCall.htm
<!DOCTYPE html>
<html>
  <head>
    <link rel="stylesheet" href="style.css">
  </head>
  <body>
    <audio  id="remoteAudio"></audio>
    <audio  id="localAudio" muted="muted"></audio>
    <button id="endCall">End Call</button>
    <script src="sip-0.6.1.js"></script>
    <script src="call.js"></script>
  </body>
</html>

请帮我调试chrome浏览器的无音频问题。

任何帮助都将是非常感激的。

问候,

Raghuvendra Kumar

您在星号服务器中启用了vp8编解码器,如果没有,则尝试从sip.conf中启用vp8编解码器。如果是,则从浏览器复制控制台日志到这里。

谢谢。! !

相关内容

  • 没有找到相关文章

最新更新