[Freeswitch-users] JAVA & WebRTC & JAIN SIP - no WebSockets

Oleg Blinnikov osblinnikov at gmail.com
Thu Mar 12 15:07:45 MSK 2015


Hi,

Unfortunately not everything runs smoothly. I run FreeSWITCH Version
1.5.15b+git~20150203T210457Z~4174fb9cbe~64bit (git 4174fb9 2015-02-03
21:04:57Z 64bit) with the default configuration + webrtc module + tweaked
bridge application for 1010 - 1019 extensions where I added
ignore_early_media=true because of chrome troubles with pranswer and
media_webrtc=true because one of my clients is actually JAIN SIP  without
WebSockets.

Now I call from Chrome to my Android app. In Android app I receive modified
SDP from FreeSwitch and all the media traffic goes though FreeSwitch. I
have the audio and video in both directions.

But when I createOffer in the Android application and send it to Chrome the
media is not flowing in any directions. In case I set "<action
application="set" data="bypass_media=true"/>" media starts flowing.

PS. May be it's irrelevant  but the only strange thing I noticed is that
Android App produces fingerprint in sha-1 then FreeSwitch changes it to
sha-256 and sends to Chrome. Chrome responds with sha-256 then FreeSwitch
modifies it back to sha-1.

I don't know, may be I forget about some other magic options?

PS: SDPs are in the attachment

On Fri, Mar 6, 2015 at 4:43 PM, Michael Jerris <mike at jerris.com> wrote:

> Always nice to hear that we are magic!
>
> On Mar 6, 2015, at 5:05 AM, Oleg Blinnikov <osblinnikov at gmail.com> wrote:
>
> thank you very much Michael, it magically works.
>
> On Thu, Mar 5, 2015 at 6:51 PM, Michael Jerris <mike at jerris.com> wrote:
>
>> you need to tell freeswitch to send a webrtc compatible SDP.
>>
>> https://wiki.freeswitch.org/wiki/Variable_media_webrtc
>>
>>
>> On Mar 5, 2015, at 3:51 AM, Oleg Blinnikov <osblinnikov at gmail.com> wrote:
>>
>> Hi,
>>
>> I've made a simple Android Java application utilizing JAIN SIP,
>> webrtc.org android library and connected to FreeSwitch via UDP.
>>
>> But when I send SDP from SIP/Chrome/Firefox phone to my JAIN SIP client
>> this SDP is not managed well by FreeSwitch for establishment WebRTC
>> PeerConnection.
>>
>> When I call `peerConnection.setRemoteDescription(new SDPObserver(),
>> sdp);` in my Android Application with the SDP from FreeSwitch I get:
>>
>> "onSetFailure Failed to set remote offer sdp: Called with SDP without
>> DTLS fingerprint."
>>
>> At the same time the calls between Chrome/Firefox(http://tryit.jssip.net/)
>> and SIP-phone (e.g. linphone) greatly managed by FreeSwitch and I have pure
>> audio flow.
>>
>> Here is initial SDP from Chrome (http://tryit.jssip.net/):
>>
>> v=0
>> o=- 6887715720880489867 2 IN IP4 127.0.0.1
>> s=-
>> t=0 0
>> a=group:BUNDLE audio video
>> a=msid-semantic: WMS itEKr0vXP6lg3KNs4kVau9aL3uAfyWOlItfU
>> m=audio 38359 RTP/SAVPF 111 103 104 0 8 106 105 13 126
>> c=IN IP4 192.168.122.1
>> a=rtcp:38359 IN IP4 192.168.122.1
>> a=candidate:4062413514 1 udp 2122260223 192.168.122.1 38359 typ host
>> generation 0
>> .......
>> a=candidate:3741779331 2 tcp 1518018303 172.17.42.1 0 typ host tcptype
>> active generation 0
>> a=ice-ufrag:bwrCv9yS8rCY12Az
>> a=ice-pwd:3k35jpG/i+TCbvBcJPWrw2eP
>> a=ice-options:google-ice
>> a=*fingerprint*:sha-256
>> 52:8C:0F:27:C6:D6:CF:AE:F4:87:AC:AE:DF:7B:9B:B2:75:90:60:6A:2A:82:09:98:AD:04:0B:35:45:6A:13:A2
>> a=setup:actpass
>> a=mid:audio
>> a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
>> a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
>> a=sendrecv
>> a=rtcp-mux
>> a=rtpmap:111 opus/48000/2
>> a=fmtp:111 minptime=10
>> a=rtpmap:103 ISAC/16000
>> a=rtpmap:104 ISAC/32000
>> a=rtpmap:0 PCMU/8000
>> a=rtpmap:8 PCMA/8000
>> a=rtpmap:106 CN/32000
>> a=rtpmap:105 CN/16000
>> a=rtpmap:13 CN/8000
>> a=rtpmap:126 telephone-event/8000
>> a=maxptime:60
>> a=ssrc:1291334905 cname:ALccmKLk9bGpSGWB
>> a=ssrc:1291334905 msid:itEKr0vXP6lg3KNs4kVau9aL3uAfyWOlItfU
>> 4e8f212e-746a-47bb-bc62-4a42d4e9e84e
>> a=ssrc:1291334905 mslabel:itEKr0vXP6lg3KNs4kVau9aL3uAfyWOlItfU
>> a=ssrc:1291334905 label:4e8f212e-746a-47bb-bc62-4a42d4e9e84e
>> m=video 38359 RTP/SAVPF 100 116 117 96
>> c=IN IP4 192.168.122.1
>> a=rtcp:38359 IN IP4 192.168.122.1
>> a=candidate:4062413514 1 udp 2122260223 192.168.122.1 38359 typ host
>> generation 0
>> ............
>> a=candidate:3741779331 2 tcp 1518018303 172.17.42.1 0 typ host tcptype
>> active generation 0
>> a=ice-ufrag:bwrCv9yS8rCY12Az
>> a=ice-pwd:3k35jpG/i+TCbvBcJPWrw2eP
>> a=ice-options:google-ice
>> a=*fingerprint*:sha-256
>> 52:8C:0F:27:C6:D6:CF:AE:F4:87:AC:AE:DF:7B:9B:B2:75:90:60:6A:2A:82:09:98:AD:04:0B:35:45:6A:13:A2
>> a=setup:actpass
>> a=mid:video
>> a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
>> a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
>> a=recvonly
>> a=rtcp-mux
>> a=rtpmap:100 VP8/90000
>> a=rtcp-fb:100 ccm fir
>> a=rtcp-fb:100 nack
>> a=rtcp-fb:100 nack pli
>> a=rtcp-fb:100 goog-remb
>> a=rtpmap:116 red/90000
>> a=rtpmap:117 ulpfec/90000
>> a=rtpmap:96 rtx/90000
>> a=fmtp:96 apt=100
>>
>>
>> Here is SDP received from FreeSwitch in JAIN SIP via UDP:
>>
>> v=0
>> o=FreeSWITCH 1425524563 1425524564 IN IP4 192.168.131.253
>> s=FreeSWITCH
>> c=IN IP4 192.168.131.253
>> t=0 0
>> m=audio 16390 RTP/AVP 111 0 8 101 13
>> a=rtpmap:111 opus/48000/2
>> a=fmtp:111 minptime=10
>> a=rtpmap:0 PCMU/8000
>> a=rtpmap:8 PCMA/8000
>> a=rtpmap:101 telephone-event/8000
>> a=fmtp:101 0-16
>> a=ptime:20
>> m=video 16388 RTP/AVP 100
>> a=rtpmap:100 VP8/90000
>>
>>
>> I suppose that FreeSwitch wants to see WebRTC connection only on the
>> WebSocket ports and it doesn't know that my UDP client is actually WebRTC
>> client.
>>
>> So I'm wondering if it possible to connect SIP client to the WebSocket
>> port via TCP using standard SIP client and never upgrade connection to
>> WebSocket?
>>
>>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>



-- 
Sincerely,
Oleg Blinnikov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20150312/a2e2562d/attachment-0001.html 
-------------- next part --------------
#Offer from Android (by webrtc.org library):
v=0
o=- 5728876668167601575 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio video
a=msid-semantic: WMS ARDAMS
m=audio 9 RTP/SAVPF 111 103 9 102 0 8 106 105 13 127 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:nEhT7P/F24BeBDoB
a=ice-pwd:jnVtYxo22sUqQ5QnSyyfZdsY
a=fingerprint:sha-1 0C:49:3B:CA:9E:CD:43:B7:40:20:AC:0A:4D:E1:E7:44:87:92:E5:E1
a=setup:actpass
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=sendrecv
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=fmtp:111 minptime=10; useinbandfec=1
a=rtpmap:103 ISAC/16000
a=rtpmap:9 G722/8000
a=rtpmap:102 ILBC/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:106 CN/32000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:127 red/8000
a=rtpmap:126 telephone-event/8000
a=maxptime:60
a=ssrc:3730323322 cname:I5IDYTbgReozOmpK
a=ssrc:3730323322 msid:ARDAMS ARDAMSa0
a=ssrc:3730323322 mslabel:ARDAMS
a=ssrc:3730323322 label:ARDAMSa0
a=candidate:1871046784 1 udp 2122129151 192.168.128.249 51069 typ host generation 0
a=candidate:1871046784 2 udp 2122129151 192.168.128.249 51069 typ host generation 0
a=candidate:554046576 1 tcp 1518149375 192.168.128.249 53912 typ host tcptype passive generation 0
a=candidate:554046576 2 tcp 1518149375 192.168.128.249 53912 typ host tcptype passive generation 0
m=video 9 RTP/SAVPF 100 116 117 96
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:nEhT7P/F24BeBDoB
a=ice-pwd:jnVtYxo22sUqQ5QnSyyfZdsY
a=fingerprint:sha-1 0C:49:3B:CA:9E:CD:43:B7:40:20:AC:0A:4D:E1:E7:44:87:92:E5:E1
a=setup:actpass
a=mid:video
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=sendrecv
a=rtcp-mux
a=rtpmap:100 VP8/90000
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp-fb:100 goog-remb
a=rtpmap:116 red/90000
a=rtpmap:117 ulpfec/90000
a=rtpmap:96 rtx/90000
a=fmtp:96 apt=100
a=ssrc-group:FID 4043084481 952591881
a=ssrc:4043084481 cname:I5IDYTbgReozOmpK
a=ssrc:4043084481 msid:ARDAMS ARDAMSv0
a=ssrc:4043084481 mslabel:ARDAMS
a=ssrc:4043084481 label:ARDAMSv0
a=ssrc:952591881 cname:I5IDYTbgReozOmpK
a=ssrc:952591881 msid:ARDAMS ARDAMSv0
a=ssrc:952591881 mslabel:ARDAMS
a=ssrc:952591881 label:ARDAMSv0
a=candidate:1871046784 1 udp 2122129151 192.168.128.249 51069 typ host generation 0
a=candidate:1871046784 2 udp 2122129151 192.168.128.249 51069 typ host generation 0
a=candidate:554046576 1 tcp 1518149375 192.168.128.249 53912 typ host tcptype passive generation 0
a=candidate:554046576 2 tcp 1518149375 192.168.128.249 53912 typ host tcptype passive generation 0




#Offer received in Chrome from FreeSwitch:
v=0
o=FreeSWITCH 1426145176 1426145177 IN IP4 192.168.131.253
s=FreeSWITCH
c=IN IP4 192.168.131.253
t=0 0
a=msid-semantic: WMS cmSQsnGZmAjyQE9LSdNN71eThgHwKa1N
m=audio 16386 RTP/SAVPF 111 9 0 8 101 13
a=rtpmap:111 opus/48000/2
a=fmtp:111 minptime=10; useinbandfec=1
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fingerprint:sha-256 34:46:35:C3:98:97:79:67:E8:B9:5F:FF:82:C4:EE:4E:2D:CA:DE:46:BD:B2:6D:D5:A6:07:C9:26:5B:3F:AE:10
a=rtcp-mux
a=rtcp:16386 IN IP4 192.168.131.253
a=ssrc:1024766842 cname:mKuFX0u9qEy78yIQ
a=ssrc:1024766842 msid:cmSQsnGZmAjyQE9LSdNN71eThgHwKa1N a0
a=ssrc:1024766842 mslabel:cmSQsnGZmAjyQE9LSdNN71eThgHwKa1N
a=ssrc:1024766842 label:cmSQsnGZmAjyQE9LSdNN71eThgHwKa1Na0
a=ice-ufrag:CluAdzjkFQHfRzT4
a=ice-pwd:9dzX3UXkolinKQ4c2pC6OMhk
a=candidate:8906128254 1 udp 659136 192.168.131.253 16386 typ host generation 0
a=candidate:8906128254 2 udp 659136 192.168.131.253 16386 typ host generation 0
a=ptime:20
m=video 16388 RTP/SAVPF 100
b=AS:256
a=rtpmap:100 VP8/90000
a=fingerprint:sha-256 34:46:35:C3:98:97:79:67:E8:B9:5F:FF:82:C4:EE:4E:2D:CA:DE:46:BD:B2:6D:D5:A6:07:C9:26:5B:3F:AE:10
a=rtcp-mux
a=rtcp:16388 IN IP4 192.168.131.253
a=rtcp-fb:100 ccm fir
a=ssrc:311706813 cname:mKuFX0u9qEy78yIQ
a=ssrc:311706813 msid:cmSQsnGZmAjyQE9LSdNN71eThgHwKa1N v0
a=ssrc:311706813 mslabel:cmSQsnGZmAjyQE9LSdNN71eThgHwKa1N
a=ssrc:311706813 label:cmSQsnGZmAjyQE9LSdNN71eThgHwKa1Nv0
a=ice-ufrag:r8kiofwWRbcruXG5
a=ice-pwd:cZIuIMxYd8z7nQ7EPhM3m9P4
a=candidate:8142942344 1 udp 659136 192.168.131.253 16388 typ host generation 0
a=candidate:8142942344 2 udp 659134 192.168.131.253 16388 typ host generation 0




#Answer generated in Chrome:
v=0
o=- 1379360262027728742 2 IN IP4 127.0.0.1
s=-
t=0 0
a=msid-semantic: WMS imsh1etBhqjVisP1YbY3IW5ML1FrCLyPVD5S
m=audio 41747 RTP/SAVPF 111 9 0 8 101 13
c=IN IP4 192.168.131.253
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:211962667 1 udp 2122260223 10.0.3.1 41747 typ host generation 0
a=candidate:896282172 1 udp 2122194687 192.168.131.253 58504 typ host generation 0
a=candidate:2441410931 1 udp 2122129151 172.17.42.1 45609 typ host generation 0
a=candidate:868527874 1 udp 1686052607 192.168.131.253 41747 typ srflx raddr 10.0.3.1 rport 41747 generation 0
a=candidate:953906854 1 udp 1685921535 192.168.131.253 45609 typ srflx raddr 172.17.42.1 rport 45609 generation 0
a=candidate:1109506011 1 tcp 1518280447 10.0.3.1 0 typ host tcptype active generation 0
a=candidate:2079314636 1 tcp 1518214911 192.168.131.253 0 typ host tcptype active generation 0
a=candidate:3741779331 1 tcp 1518149375 172.17.42.1 0 typ host tcptype active generation 0
a=ice-ufrag:4IDqem5vOr15nQSg
a=ice-pwd:5+LtaRvHaFdEv7+vUDnP8Ofl
a=fingerprint:sha-256 52:8C:0F:27:C6:D6:CF:AE:F4:87:AC:AE:DF:7B:9B:B2:75:90:60:6A:2A:82:09:98:AD:04:0B:35:45:6A:13:A2
a=setup:active
a=mid:audio
a=sendrecv
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=fmtp:111 minptime=10; useinbandfec=1
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=rtpmap:13 CN/8000
a=maxptime:60
a=ssrc:982941744 cname:MMvCy0RouNFfAfdZ
a=ssrc:982941744 msid:imsh1etBhqjVisP1YbY3IW5ML1FrCLyPVD5S e4bf2510-f73a-4df4-8cfe-5308a89ca8f7
a=ssrc:982941744 mslabel:imsh1etBhqjVisP1YbY3IW5ML1FrCLyPVD5S
a=ssrc:982941744 label:e4bf2510-f73a-4df4-8cfe-5308a89ca8f7
m=video 36031 RTP/SAVPF 100
c=IN IP4 192.168.131.253
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:211962667 1 udp 2122260223 10.0.3.1 36031 typ host generation 0
a=candidate:896282172 1 udp 2122194687 192.168.131.253 35064 typ host generation 0
a=candidate:2441410931 1 udp 2122129151 172.17.42.1 37784 typ host generation 0
a=candidate:868527874 1 udp 1686052607 192.168.131.253 36031 typ srflx raddr 10.0.3.1 rport 36031 generation 0
a=candidate:953906854 1 udp 1685921535 192.168.131.253 37784 typ srflx raddr 172.17.42.1 rport 37784 generation 0
a=candidate:1109506011 1 tcp 1518280447 10.0.3.1 0 typ host tcptype active generation 0
a=candidate:2079314636 1 tcp 1518214911 192.168.131.253 0 typ host tcptype active generation 0
a=candidate:3741779331 1 tcp 1518149375 172.17.42.1 0 typ host tcptype active generation 0
a=ice-ufrag:JopYjvWKl1fi3YnD
a=ice-pwd:FWkLjxPvcbF7QRDLW9ML5tc8
a=fingerprint:sha-256 52:8C:0F:27:C6:D6:CF:AE:F4:87:AC:AE:DF:7B:9B:B2:75:90:60:6A:2A:82:09:98:AD:04:0B:35:45:6A:13:A2
a=setup:active
a=mid:video
a=sendrecv
a=rtcp-mux
a=rtpmap:100 VP8/90000
a=rtcp-fb:100 ccm fir
a=ssrc:1880102335 cname:MMvCy0RouNFfAfdZ
a=ssrc:1880102335 msid:imsh1etBhqjVisP1YbY3IW5ML1FrCLyPVD5S 05869856-a385-424a-8817-d3d748823465
a=ssrc:1880102335 mslabel:imsh1etBhqjVisP1YbY3IW5ML1FrCLyPVD5S
a=ssrc:1880102335 label:05869856-a385-424a-8817-d3d748823465


#Answer received in Android from FreeSwitch:
v=0
o=FreeSWITCH 1426145178 1426145179 IN IP4 192.168.131.253
s=FreeSWITCH
c=IN IP4 192.168.131.253
t=0 0
a=msid-semantic: WMS BNo1VQAJroxehgCTF0uKs9k3EUdBEDL5
m=audio 16384 RTP/SAVPF 111 126 106
a=rtpmap:111 opus/48000/2
a=fmtp:111 useinbandfec=1; minptime=10
a=rtpmap:126 telephone-event/8000
a=rtpmap:106 CN/8000
a=ptime:20
a=fingerprint:sha-1 73:08:7C:79:1F:8F:5A:E7:4B:C1:D7:05:EA:4D:98:F3:36:46:39:72
a=rtcp-mux
a=rtcp:16384 IN IP4 192.168.131.253
a=ssrc:1024631706 cname:g0X2GoBYCY2J5usA
a=ssrc:1024631706 msid:BNo1VQAJroxehgCTF0uKs9k3EUdBEDL5 a0
a=ssrc:1024631706 mslabel:BNo1VQAJroxehgCTF0uKs9k3EUdBEDL5
a=ssrc:1024631706 label:BNo1VQAJroxehgCTF0uKs9k3EUdBEDL5a0
a=ice-ufrag:lMaDMkwg5zIz3kv9
a=ice-pwd:aj2HxtvZiozdJSEUvEn7PKdL
a=candidate:8379233368 1 udp 659136 192.168.131.253 16384 typ host generation 0
m=video 16390 RTP/SAVPF 100
b=AS:256
a=rtpmap:100 VP8/90000
a=fingerprint:sha-1 73:08:7C:79:1F:8F:5A:E7:4B:C1:D7:05:EA:4D:98:F3:36:46:39:72
a=rtcp-mux
a=rtcp:16390 IN IP4 192.168.131.253
a=rtcp-fb:* fir
a=rtcp-fb:100 ccm fir
a=ssrc:311571677 cname:g0X2GoBYCY2J5usA
a=ssrc:311571677 msid:BNo1VQAJroxehgCTF0uKs9k3EUdBEDL5 v0
a=ssrc:311571677 mslabel:BNo1VQAJroxehgCTF0uKs9k3EUdBEDL5
a=ssrc:311571677 label:BNo1VQAJroxehgCTF0uKs9k3EUdBEDL5v0
a=ice-ufrag:afvyUrPqxfjH9tPf
a=ice-pwd:snn0NUc6MAcrFkqGqM5a3Krr
a=candidate:6545229027 1 udp 659136 192.168.131.253 16390 typ host generation 0


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list