2

I am trying to call the user 1001 registered on Twinkle using the webpage from chrome. But I am getting Terminated_X_transportError error. JavaScript code is this

 <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>

And here is the JavaScript log

I was not using websocket and outbound proxy address in the code. But as suggested in this question I used it and now neither it is throwing any error nor it is responding.

I added these lines after 'password' line in later code

websocket_proxy_url : 'ws://192.168.49.170:5080',
outbound_proxy_url : 'udp://192.168.49.170:5060',
enable_rtcweb_breaker:'yes'

And this the JavaScript log I got after running modified code.

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' 

The output of the the command sudo netstat -nlpa | grep freeswitch is this -

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 

Can anyone please suggest what is wrong with my code? OS- Ubuntu 12.04

Code is taken from SipML5 site. ,

Community
  • 1
  • 1
Anurag Rana
  • 1,429
  • 2
  • 24
  • 48

2 Answers2

1

After a thorough search on the Internet I found that to make a call from web client we need to install webrtc2sip server as well. And provide the websocket address of this server at the place of "192.168.62.6:5080" in my code. So I installed it from here. and now things are working fine. Atleast this error has been eliminated.

Anurag Rana
  • 1,429
  • 2
  • 24
  • 48
0

It depends on what switch you are using. We have successfully implemented webRTC on asterisk 11 using sipml5 as client without putting any webrtc2sip in the middle. you will find details of how to configure asterisk for webRTC from the below link

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

Newer version of Freeswitch has also webRTC support. Please check the below link,

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

Kamrul Khan
  • 3,260
  • 4
  • 32
  • 59