Some help with setup... sipML5 client + webrtc2sip + FreeSWITCH -OR- sipML5 client + FreeSWITCH

1,001 views
Skip to first unread message

Jambu

unread,
Oct 16, 2016, 12:16:28 AM10/16/16
to discuss-doubango
I'm hoping someone here will be able to see what I'm doing wrong, or at least point me in the direction to the answer to my problem. I used Letsencrypt.org to get the SSL certs for testing.

====== First Scenario ======
Server 1) sipML5 client www + webrtc2sip  [ I also tried the sipML5 live demo, same results ]
Server 2) FreeSWITCH

Both have FQDN and have tested working SSL certs (tested working in Apache, at least... I think the certs might be why webRTC isn't working).

Here is the tested working apache config:

<IfModule mod_ssl.c>
<VirtualHost *:443>
  ServerAdmin ad...@my.domain.com
  DocumentRoot /var/www/sipml5/public
  # Set access permission
  <Directory />
    Allow from all
  </Directory>

  ServerName my.domain.com

  ErrorLog  /var/www/sipml5/log/error.log
  CustomLog /var/www/sipml5/log/access.log common
  SSLCertificateFile    /etc/letsencrypt/live/my.domain.com-0001/fullchain.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/my.domain.com-0001/privkey.pem
  Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>


Here is the webrtc2sip config:

<?xml version="1.0" encoding="utf-8" ?>
<!-- Please check the technical guide (http://webrtc2sip.org/technical-guide-1.0.pdf) for more information on how to adjust this file -->
<config>

  <debug-level>INFO</debug-level>

  <transport>udp;*;5060</transport>
  <transport>wss;*;10062</transport>

  <enable-rtp-symetric>yes</enable-rtp-symetric>
  <enable-100rel>no</enable-100rel>
  <enable-media-coder>yes</enable-media-coder>
  <enable-videojb>yes</enable-videojb>
  <video-size-pref>vga</video-size-pref>
  <rtp-buffsize>65535</rtp-buffsize>
  <avpf-tail-length>100;400</avpf-tail-length>
  <srtp-mode>optional</srtp-mode>
  <srtp-type>sdes;dtls</srtp-type>
  <dtmf-type>rfc2833</dtmf-type>

  <codecs>gsm;opus;pcma;pcmu;vp8;h264-bp;h264-mp;h263;h263+</codecs>
  <codec-opus-maxrates>48000;48000</codec-opus-maxrates>

  <stun-server>stun.l.google.com;19302</stun-server>
  <enable-icestun>yes</enable-icestun>

  <max-fds>-1</max-fds>

  <nameserver>8.8.8.8</nameserver>

  <ssl-certificates>
    /etc/letsencrypt/live/my.domain.com/privkey.pem;
    /etc/letsencrypt/live/my.domain.com/fullchain.pem;
    *;
    no
  </ssl-certificates>

  <database>sqlite;*</database>
</config>


Here is the output from webrtc2sip in debug level INFO:

*******************************************************************
Copyright (C) 2012-2015 Doubango Telecom <http://www.doubango.org>
PRODUCT: webrtc2sip
LICENCE: GPLv3 or proprietary
VERSION: 2.7.0
'quit' to quit the application.
*******************************************************************

SSL is enabled :)
DTLS supported: yes
DTLS-SRTP supported: yes
*[DOUBANGO INFO]: transport = udp://*:5060
*[DOUBANGO INFO]: transport = wss://*:10062
*[DOUBANGO INFO]: enable-rtp-symetric = yes
*[DOUBANGO INFO]: enable-100rel = no
*[DOUBANGO INFO]: enable-media-coder = yes
*[DOUBANGO INFO]: enable-videojb = yes
*[DOUBANGO INFO]: video-size-pref = vga
*[DOUBANGO INFO]: rtp-buffsize = 65535
*[DOUBANGO INFO]: avpf-tail-length = [100-400]
*[DOUBANGO INFO]: srtp-mode = optional
*[DOUBANGO INFO]: srtp-type = sdes;dtls
*[DOUBANGO INFO]: dtmf-type = rfc2833
*[DOUBANGO INFO]: codecs = gsm;opus;pcma;pcmu;vp8;h264-bp;h264-mp;h263;h263+
*[DOUBANGO INFO]: UnRegister codec: GSM, GSM Full Rate (libgsm)
*[DOUBANGO INFO]: UnRegister codec: PCMA, G.711a codec (native)
*[DOUBANGO INFO]: UnRegister codec: PCMU, G.711u codec (native)
*[DOUBANGO INFO]: UnRegister codec: VP8, VP8 codec (libvpx)
*[DOUBANGO INFO]: 'h264-bp' codec enabled but not supported
*[DOUBANGO INFO]: 'h264-mp' codec enabled but not supported
*[DOUBANGO INFO]: UnRegister codec: H263, H263-1996 codec (FFmpeg)
*[DOUBANGO INFO]: UnRegister codec: H263-1998, H263-1998 codec (FFmpeg)
*[DOUBANGO INFO]: codec-opus-maxrates = 48000;48000
*[DOUBANGO INFO]: stun-server = stun.l.google.com;19302;-;-
*[DOUBANGO INFO]: enable-icestun = yes
*[DOUBANGO INFO]: max-fds = -1
*[DOUBANGO INFO]: nameserver = 8.8.8.8
*[DOUBANGO INFO]: ssl-certificates = 
/etc/letsencrypt/live/my.domain.com/privkey.pem;
/etc/letsencrypt/live/my.domain.com/fullchain.pem;
*;
no
*[DOUBANGO INFO]: database = sqlite;*
*[DOUBANGO INFO]: sqlite3_threadsafe = 1
*[DOUBANGO INFO]: Database opened = TRUE
*[DOUBANGO INFO]: Stack running in SERVER mode
*[DOUBANGO INFO]: tsk_timer_manager_start
*[DOUBANGO INFO]: Timer manager run()::enter
*[DOUBANGO INFO]: TIMER MANAGER -- START
*[DOUBANGO INFO]: Best source at 0: my.ip.add.ress
*[DOUBANGO INFO]: Best source at 5: my.ip.add.ress
*[DOUBANGO INFO]: tnet_transport_prepare()
*[DOUBANGO INFO]: pipeR fd=8, pipeW=9
*[DOUBANGO INFO]: Socket added[SIP transport]: fd=8, tail.count=1
*[DOUBANGO INFO]: master fd=6
*[DOUBANGO INFO]: Socket added[SIP transport]: fd=6, tail.count=2
*[DOUBANGO INFO]: tnet_transport_prepare()
*[DOUBANGO INFO]: pipeR fd=10, pipeW=11
*[DOUBANGO INFO]: Socket added[SIP transport]: fd=10, tail.count=1
*[DOUBANGO INFO]: master fd=7
*[DOUBANGO INFO]: Socket added[SIP transport]: fd=7, tail.count=2
*[DOUBANGO INFO]: SIP STACK -- START
*[DOUBANGO INFO]: Transport::run(SIP transport) - enter
*[DOUBANGO INFO]: Transport::run(SIP transport) - enter
*[DOUBANGO INFO]: SIP STACK::run -- START
*[DOUBANGO INFO]: Starting [SIP transport] server with IP {my.ip.add.ress} on port {10062} using fd {7} with type {128}...
*[DOUBANGO INFO]: Starting [SIP transport] server with IP {my.ip.add.ress} on port {5060} using fd {6} with type {2}...


*[DOUBANGO INFO]: ioctlt(7), len=0 returned zero or failed
*[DOUBANGO INFO]: NETWORK EVENT FOR SERVER [SIP transport] -- FD_ACCEPT(fd=12)
*[DOUBANGO INFO]: Socket added[SIP transport]: fd=12, tail.count=3
*[DOUBANGO INFO]: WebSocket Peer accepted/connected with fd = 12
*[DOUBANGO INFO]: #1 peers in the 'SIP transport' transport
*[DOUBANGO INFO]: NETWORK EVENT FOR SERVER [SIP transport] -- TNET_POLLOUT
*[DOUBANGO INFO]: WebSocket Peer accepted/connected with fd = 12
*[DOUBANGO INFO]: Peer with local fd=12 already exist
*[DOUBANGO INFO]: #0 peers in the 'SIP transport' transport
*[DOUBANGO INFO]: #1 peers in the 'SIP transport' transport
*[DOUBANGO INFO]: ioctlt(12), len=0 returned zero or failed
*[DOUBANGO INFO]: Closing socket with fd = 12 because ioctlt() returned zero or failed
*[DOUBANGO INFO]: Removing socket 12
*[DOUBANGO INFO]: Socket to remove: fd=12, index=2, tail.count=3
*[DOUBANGO INFO]: CloseSocket(12)
*[DOUBANGO INFO]: WebSocket Peer closed with fd = 12
*[DOUBANGO INFO]: #0 peers in the 'SIP transport' transport
*[DOUBANGO INFO]: *** Stream Peer destroyed ***
*[DOUBANGO INFO]: WebSocket Peer closed with fd = 12
*[DOUBANGO INFO]: PipeR event = 1


quit
*[DOUBANGO INFO]: == Shutting down - Terminated ==
*[DOUBANGO INFO]: Transport::run(SIP transport) - exit
*[DOUBANGO INFO]: Stopping [SIP transport] server with IP {my.ip.add.ress} on port {5060} with type {2}...
*[DOUBANGO INFO]: Stopped [SIP transport] server with IP {my.ip.add.ress} on port {5060}
*[DOUBANGO INFO]: Socket to remove: fd=8, index=0, tail.count=2
*[DOUBANGO INFO]: CloseSocket(8)
*[DOUBANGO INFO]: Socket to remove: fd=6, index=0, tail.count=1
*[DOUBANGO INFO]: CloseSocket(6)
*[DOUBANGO INFO]: *** Transport (SIP transport) destroyed ***
*[DOUBANGO INFO]: Transport::run(SIP transport) - exit
*[DOUBANGO INFO]: Stopping [SIP transport] server with IP {my.ip.add.ress} on port {10062} with type {128}...
*[DOUBANGO INFO]: Stopped [SIP transport] server with IP {my.ip.add.ress} on port {10062}
*[DOUBANGO INFO]: Socket to remove: fd=10, index=0, tail.count=2
*[DOUBANGO INFO]: CloseSocket(10)
*[DOUBANGO INFO]: Socket to remove: fd=7, index=0, tail.count=1
*[DOUBANGO INFO]: CloseSocket(7)
*[DOUBANGO INFO]: *** Transport (SIP transport) destroyed ***
*[DOUBANGO INFO]: SIP STACK::run -- STOP
*[DOUBANGO INFO]: Timer manager run()::exit
*[DOUBANGO INFO]: TIMER MANAGER -- STOP
*[DOUBANGO INFO]: SIP STACK -- STOP
+++ quit() +++


Here is the Chrome Console Debug:

s_websocket_server_url=wss://my.domain.com:10062
s_sip_outboundproxy_url=udp://my.sipdomain.com:5060
b_rtcweb_breaker_enabled=yes
b_click2call_enabled=no
b_early_ims=yes
b_enable_media_stream_cache=yes
o_bandwidth={"audio":64,"video":512}
o_video_size={}
SIP stack start: proxy='ns313841.ovh.net:11062', realm='<sip:my.sipdomain.com>', impi='myuser', impu='"Jambu"<sip:myu...@my.sipdomain.com>'
Connecting to 'wss://my.domain.com:10062'
==stack event = starting
WebSocket connection to 'wss://my.domain.com:10062/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
__tsip_transport_ws_onerror
__tsip_transport_ws_onclose
==stack event = failed_to_start


The FreeSWITCH server never gets any SIP request at all, so the connection is being refused at the webrtc2sip level. I tested from sipML5 Live Demo with the same results.



====== Second Scenario ======
Server 1) sipML5 client www
Server 2) FreeSWITCH

Ideally, I'd like to just have sipML5 connect directly to FreeSWITCH, and can provide the full FS debug output and XML files if that's easier to fix/configure.

Using just the sipML5 client + FreeSWITCH, I can register and receive an inbound call... but I get no audio, seems like an issue with dtls or srtp or maybe stun. I'm sure it has to do with codecs or the SSL certs, so I was trying to set up the webrtc2sip web breaker server (I got that working before in another setup to connect to an Asterisk server).

Here is the (I believe) relevant debug output when using just sipML5 + FreeSWITCH. The sipML5 client is already registered, and this is after clicking "Answer" on the sipML5 client when called.

2016-10-15 23:12:54.011690 [ALERT] switch_core_session.c:1063 Send signal sofia/internal/15555...@sip.provider.com:5060 [BREAK]
2016-10-15 23:12:54.011690 [ALERT] switch_rtp.c:888 STUN PACKET TYPE: BINDING_REQUEST
2016-10-15 23:12:54.011690 [ALERT] switch_rtp.c:891 |---: STUN ATTR 6 6 USERNAME
2016-10-15 23:12:54.011690 [ALERT] switch_rtp.c:943 |------: Ib4vqni3yZ0tVM1M:R9vN
2016-10-15 23:12:54.011690 [ALERT] switch_rtp.c:891 |---: STUN ATTR 49239 c057 INVALID
2016-10-15 23:12:54.011690 [ALERT] switch_rtp.c:891 |---: STUN ATTR 32809 8029 CONTROLLED
2016-10-15 23:12:54.011690 [ALERT] switch_rtp.c:891 |---: STUN ATTR 36 24 PRIORITY
2016-10-15 23:12:54.011690 [ALERT] switch_rtp.c:952 |------: 1853685534
2016-10-15 23:12:54.011690 [NOTICE] switch_rtp.c:1174 Auto Changing audio stun/rtp/dtls port from my.ipv6.add.ress:59689 to my.ipv4.add.ress:45471
2016-10-15 23:12:54.031767 [ALERT] switch_rtp.c:6913 Skip sending audio packet 160 bytes (dtls not ready @ line 7453!)
2016-10-15 23:12:54.031767 [ALERT] switch_rtp.c:888 STUN PACKET TYPE: BINDING_REQUEST
2016-10-15 23:12:54.031767 [ALERT] switch_rtp.c:891 |---: STUN ATTR 6 6 USERNAME
2016-10-15 23:12:54.031767 [ALERT] switch_rtp.c:943 |------: Ib4vqni3yZ0tVM1M:R9vN
2016-10-15 23:12:54.031767 [ALERT] switch_rtp.c:891 |---: STUN ATTR 49239 c057 INVALID
2016-10-15 23:12:54.031767 [ALERT] switch_rtp.c:891 |---: STUN ATTR 32809 8029 CONTROLLED
2016-10-15 23:12:54.031767 [ALERT] switch_rtp.c:891 |---: STUN ATTR 36 24 PRIORITY
2016-10-15 23:12:54.031767 [ALERT] switch_rtp.c:952 |------: 1853816606
2016-10-15 23:12:54.071717 [ALERT] switch_rtp.c:6913 Skip sending audio packet 160 bytes (dtls not ready @ line 7453!)
2016-10-15 23:12:54.091716 [ALERT] switch_rtp.c:6913 Skip sending audio packet 160 bytes (dtls not ready @ line 7453!)
2016-10-15 23:12:54.091716 [ALERT] mod_callcenter.c:519 Reuse Unused Cached DB handle db="callcenter",type="core_db" [CORE_DB]
2016-10-15 23:12:54.111716 [ALERT] switch_rtp.c:6913 Skip sending audio packet 160 bytes (dtls not ready @ line 7453!)
2016-10-15 23:12:54.131716 [ALERT] switch_rtp.c:6913 Skip sending audio packet 160 bytes (dtls not ready @ line 7453!)
2016-10-15 23:12:54.151716 [ALERT] switch_rtp.c:6913 Skip sending audio packet 160 bytes (dtls not ready @ line 7453!)
2016-10-15 23:12:54.171717 [ALERT] switch_rtp.c:6913 Skip sending audio packet 160 bytes (dtls not ready @ line 7453!)
2016-10-15 23:12:54.191716 [ALERT] switch_rtp.c:6913 Skip sending audio packet 160 bytes (dtls not ready @ line 7453!)
2016-10-15 23:12:54.191716 [DEBUG] switch_ivr.c:1699 (sofia/internal/myu...@df7jal23ls0d.invalid) State Change CS_EXCHANGE_MEDIA -> CS_PARK

Thank you for any feedback / assistance. I've been trying to get this to work for 3 days now, no success...

navaismo

unread,
Oct 21, 2016, 10:49:11 AM10/21/16
to discuss-doubango
In the first scenario seems more likely a firewall issue: "failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED"
Check that your FW allow the webrtc2sip ports, also check that webrt2sip is listening with a netstat.

In the second scenario check the browser debug and compare the rtp ip addresses.

SIP stack start: proxy='ns313841.ovh.net:11062', realm='<sip:my.sipdomain.com>', impi='myuser', impu='"Jambu"<sip:m...@my.sipdomain.com>'
Connecting to 'wss://my.domain.com:10062'
==stack event = starting
WebSocket connection to 'wss://my.domain.com:10062/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
__tsip_transport_ws_onerror
__tsip_transport_ws_onclose
==stack event = failed_to_start

The FreeSWITCH server never gets any SIP request at all, so the connection is being refused at the webrtc2sip level. I tested from sipML5 Live Demo with the same results.



====== Second Scenario ======
Server 1) sipML5 client www
Server 2) FreeSWITCH

Ideally, I'd like to just have sipML5 connect directly to FreeSWITCH, and can provide the full FS debug output and XML files if that's easier to fix/configure.

Using just the sipML5 client + FreeSWITCH, I can register and receive an inbound call... but I get no audio, seems like an issue with dtls or srtp or maybe stun. I'm sure it has to do with codecs or the SSL certs, so I was trying to set up the webrtc2sip web breaker server (I got that working before in another setup to connect to an Asterisk server).

Here is the (I believe) relevant debug output when using just sipML5 + FreeSWITCH. The sipML5 client is already registered, and this is after clicking "Answer" on the sipML5 client when called.

2016-10-15 23:12:54.011690 [ALERT] switch_core_session.c:1063 Send signal sofia/internal/15555555555@sip.provider.com:5060 [BREAK]
2016-10-15 23:12:54.011690 [ALERT] switch_rtp.c:888 STUN PACKET TYPE: BINDING_REQUEST
2016-10-15 23:12:54.011690 [ALERT] switch_rtp.c:891 |---: STUN ATTR 6 6 USERNAME
2016-10-15 23:12:54.011690 [ALERT] switch_rtp.c:943 |------: Ib4vqni3yZ0tVM1M:R9vN
2016-10-15 23:12:54.011690 [ALERT] switch_rtp.c:891 |---: STUN ATTR 49239 c057 INVALID
2016-10-15 23:12:54.011690 [ALERT] switch_rtp.c:891 |---: STUN ATTR 32809 8029 CONTROLLED
2016-10-15 23:12:54.011690 [ALERT] switch_rtp.c:891 |---: STUN ATTR 36 24 PRIORITY
2016-10-15 23:12:54.011690 [ALERT] switch_rtp.c:952 |------: 1853685534
2016-10-15 23:12:54.011690 [NOTICE] switch_rtp.c:1174 Auto Changing audio stun/rtp/dtls port from my.ipv6.add.ress:59689 to my.ipv4.add.ress:45471
2016-10-15 23:12:54.031767 [ALERT] switch_rtp.c:6913 Skip sending audio packet 160 bytes (dtls not ready @ line 7453!)
2016-10-15 23:12:54.031767 [ALERT] switch_rtp.c:888 STUN PACKET TYPE: BINDING_REQUEST
2016-10-15 23:12:54.031767 [ALERT] switch_rtp.c:891 |---: STUN ATTR 6 6 USERNAME
2016-10-15 23:12:54.031767 [ALERT] switch_rtp.c:943 |------: Ib4vqni3yZ0tVM1M:R9vN
2016-10-15 23:12:54.031767 [ALERT] switch_rtp.c:891 |---: STUN ATTR 49239 c057 INVALID
2016-10-15 23:12:54.031767 [ALERT] switch_rtp.c:891 |---: STUN ATTR 32809 8029 CONTROLLED
2016-10-15 23:12:54.031767 [ALERT] switch_rtp.c:891 |---: STUN ATTR 36 24 PRIORITY
2016-10-15 23:12:54.031767 [ALERT] switch_rtp.c:952 |------: 1853816606
2016-10-15 23:12:54.071717 [ALERT] switch_rtp.c:6913 Skip sending audio packet 160 bytes (dtls not ready @ line 7453!)
2016-10-15 23:12:54.091716 [ALERT] switch_rtp.c:6913 Skip sending audio packet 160 bytes (dtls not ready @ line 7453!)
2016-10-15 23:12:54.091716 [ALERT] mod_callcenter.c:519 Reuse Unused Cached DB handle db="callcenter",type="core_db" [CORE_DB]
2016-10-15 23:12:54.111716 [ALERT] switch_rtp.c:6913 Skip sending audio packet 160 bytes (dtls not ready @ line 7453!)
2016-10-15 23:12:54.131716 [ALERT] switch_rtp.c:6913 Skip sending audio packet 160 bytes (dtls not ready @ line 7453!)
2016-10-15 23:12:54.151716 [ALERT] switch_rtp.c:6913 Skip sending audio packet 160 bytes (dtls not ready @ line 7453!)
2016-10-15 23:12:54.171717 [ALERT] switch_rtp.c:6913 Skip sending audio packet 160 bytes (dtls not ready @ line 7453!)
2016-10-15 23:12:54.191716 [ALERT] switch_rtp.c:6913 Skip sending audio packet 160 bytes (dtls not ready @ line 7453!)
2016-10-15 23:12:54.191716 [DEBUG] switch_ivr.c:1699 (sofia/internal/myuser@df7jal23ls0d.invalid) State Change CS_EXCHANGE_MEDIA -> CS_PARK

necival corp

unread,
Nov 13, 2016, 6:39:41 PM11/13/16
to doub...@googlegroups.com
I finally got it working, but I had to install on Debian 8.... I was trying to use Centos 7. Hopefully this helps someone else.


--
You received this message because you are subscribed to a topic in the Google Groups "discuss-doubango" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/doubango/OzolvFqq1EY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to doubango+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Enrique R. Delgado

unread,
Sep 6, 2017, 12:41:09 PM9/6/17
to discuss-doubango
Dear Jambu,
 I would have the steps that I perform to be able to configure correctly in debian 8 (sipML5 client webrtc2sip FreeSWITCH -OR- sipML5 client FreeSWITCH) Thanks in advance
To unsubscribe from this group and all its topics, send an email to doubango+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages