簡體   English   中英

使用基於sip.js的webrtc應用程序和星號11.11.0,Chrome沒有音頻。 與Firefox和Opera正常工作

[英]no audio with chrome using sip.js based webrtc app and asterisk 11.11.0. Working fine with firefox and Opera

我正在使用sip.js和星號開發webrtc。 我的webrtc應用程序在Firefox 31和Opera 22.0.1471.70上運行良好。 但是,當我將我的webrtc應用程序與chrome一起使用時(版本37.0.2062.58 beta-m(64位))。 一切似乎都很好,但是沒有音頻。 我還嘗試了最新穩定的Chrome瀏覽器的32版本。 問題保持不變。

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

webrtc應用程序代碼:-

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編解碼器。 如果是,則從瀏覽器將控制台日志復制到此處。

謝謝。!!!!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM