首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在使用SipML5 api和代码连接到Freeswitch时获取传输错误

在使用SipML5 api和代码连接到Freeswitch时获取传输错误
EN

Stack Overflow用户
提问于 2014-05-09 12:39:35
回答 2查看 2.2K关注 0票数 2

我试图调用用户1001注册在Twinkle使用网页从铬。但是我得到了Terminated_X_transportError错误。JavaScript代码是

代码语言:javascript
复制
 <html>
<head>
<script type="text/javascript" src="SIPml-api.js"></script>
<script type="text/javascript">
alert("hello");
SIPml.init(
         function(e){

             var stack =  new SIPml.Stack({realm: '192.168.49.170', 
                                           impi: '1002', 
                                           impu: 'sip:1002@192.168.49.170', 
                                           password: '1234',

                 events_listener: { events: 'started', listener: function(e){
                             var callSession = stack.newSession('call-audio', {
                                     audio_remote: document.getElementById('audio-remote')
                                 });
                             callSession.call('1001');
                         } 
                     }
             });
             stack.start();
         }
 );

 alert("hello 1");

 </script>

 </head>
 <body>
 <input type="text" id="phonenumber"/><br/>
 <button type=submit id="button1" >Call</button>
  <audio id="audio_remote" autoplay="autoplay"/> 

 </body>
 </html>

这是JavaScript日志

我是,而不是,在代码中使用websocket和出站代理地址。但正如问题中所建议的那样,我使用了它,现在它既没有抛出任何错误,也没有响应。

在后面的代码中,我在“密码”行之后添加了这些行

代码语言:javascript
复制
websocket_proxy_url : 'ws://192.168.49.170:5080',
outbound_proxy_url : 'udp://192.168.49.170:5060',
enable_rtcweb_breaker:'yes'

这是我在运行修改代码后得到的JavaScript日志。

代码语言:javascript
复制
SIPML5 API version = 1.4.217 SIPml-api.js:1
User-Agent=Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36 SIPml-api.js:1
WebSocket supported = yes SIPml-api.js:1
Navigator friendly name = chrome SIPml-api.js:1
OS friendly name = linux SIPml-api.js:1
Have WebRTC = yes SIPml-api.js:1
Have GUM = yes SIPml-api.js:1
Engine initialized SIPml-api.js:1
s_websocket_server_url=ws://192.168.49.170:5080 SIPml-api.js:1
s_sip_outboundproxy_url=udp://192.168.49.170:5060 SIPml-api.js:1
b_rtcweb_breaker_enabled=yes SIPml-api.js:1
b_click2call_enabled=no SIPml-api.js:1
b_early_ims=yes SIPml-api.js:1
b_enable_media_stream_cache=no SIPml-api.js:1
o_bandwidth={} SIPml-api.js:1
o_video_size={} SIPml-api.js:1
SIP stack start: proxy='ns313841.ovh.net:12062', realm='<sip:192.168.49.170>', impi='1002', impu='<sip:1002@192.168.49.170>' SIPml-api.js:1
Connecting to 'ws://192.168.49.170:5080' 

命令sudo netstat -nlpa _ grep freeswitch的输出如下-

代码语言:javascript
复制
tcp        0      0 192.168.49.170:5060     0.0.0.0:*               LISTEN      8796/freeswitch 
tcp        0      0 127.0.0.1:8021          0.0.0.0:*               LISTEN      8796/freeswitch 
tcp        0      0 192.168.49.170:5080     0.0.0.0:*               LISTEN      8796/freeswitch 
tcp6       0      0 ::1:5060                :::*                    LISTEN      8796/freeswitch 
udp        0      0 192.168.49.170:5060     0.0.0.0:*                           8796/freeswitch 
udp        0      0 192.168.49.170:5080     0.0.0.0:*                           8796/freeswitch 
udp        0      0 192.168.49.170:55718    192.168.48.11:5351      ESTABLISHED 8796/freeswitch 
udp6       0      0 ::1:5060                :::*                                8796/freeswitch 
unix  3      [ ]         STREAM     CONNECTED     99781    8796/freeswitch     
unix  3      [ ]         STREAM     CONNECTED     99031    8796/freeswitch     
unix  3      [ ]         STREAM     CONNECTED     99784    8796/freeswitch     
unix  3      [ ]         STREAM     CONNECTED     99030    8796/freeswitch     
unix  3      [ ]         STREAM     CONNECTED     99029    8796/freeswitch     
unix  3      [ ]         STREAM     CONNECTED     98261    8796/freeswitch     
unix  3      [ ]         STREAM     CONNECTED     98262    8796/freeswitch     
unix  3      [ ]         STREAM     CONNECTED     98263    8796/freeswitch     
unix  3      [ ]         STREAM     CONNECTED     99783    8796/freeswitch     
unix  3      [ ]         STREAM     CONNECTED     98260    8796/freeswitch     
unix  3      [ ]         STREAM     CONNECTED     99782    8796/freeswitch     
unix  3      [ ]         STREAM     CONNECTED     99032    8796/freeswitch 

有人能告诉我我的密码出了什么问题吗?OS- Ubuntu 12.04

代码取自SipML5站点。

EN

回答 2

Stack Overflow用户

发布于 2014-05-11 11:55:59

在互联网上进行了彻底的搜索之后,我发现要从web客户端打电话,我们还需要安装webrtc2sip服务器。并在代码中的"192.168.62.6:5080“位置提供此服务器的websocket地址。所以我从这里。安装了它,现在一切都很好。至少这个错误已经被消除了。

票数 1
EN

Stack Overflow用户

发布于 2014-08-20 00:12:43

这取决于您正在使用的交换机。我们已经成功地在星号11上实现了webRTC,使用sipml5作为客户端,而没有将任何webrtc2sip放在中间。您将从下面的链接中找到如何配置webRTC星号的详细信息。

http://forums.asterisk.org/viewtopic.php?f=1&t=91007

较新版本的Freeswitch也支持webRTC。请查看以下链接,

https://wiki.freeswitch.org/wiki/Webrtc

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23564903

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档