Re: [discuss-webrtc] Asterisk - Chrome Canary interworking.

888 views
Skip to first unread message

Xiexin

unread,
Aug 20, 2012, 9:52:46 PM8/20/12
to discuss...@googlegroups.com
How did you send the SIP message to Asterisk from Chrome ?

On Mon, Aug 20, 2012 at 2:23 PM, BP Gangadharan <bp.gang...@gmail.com> wrote:
Hi,

I have been trying to connect asterisk with Chrome Canary(23.0.1237.0). I have done changes to SDP so that asterisk (trunk) accept the SDP and vice versa.
And I can hear the announcement from asterisk in the browser. I have also done changes to asterisk so that STUN binding requests are handled. However, there are two problems I still see.

1. Chrome does not send any RTP to asterisk (in wireshark).
2. onaddstream callback does not get invoked.

Here is the answer SDP from asterisk that get sets on the chrome. Any help/pointers are appreciated.

"sdp":"v=0\r\no=root 1242014480 1242014480 IN IP4 10.148.105.58\r\ns=\r\nt=0 0\r\na=ice-lite\r\nm=audio 13736 RTP/SAVPF 0 8 101\r\nc=IN IP4 10.148.105.58\r\na=rtcp:13737 IN IP4 10.148.105.58\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:101 telephone-event/8000\r\na=fmtp:101 0-16\r\na=silenceSupp:off - - - -\r\na=ptime:20\r\na=ice-ufrag:3afb3d6b389d710f271b089730e6565a\r\na=ice-pwd:14f3a2af727ee97944e8f9e665429cda\r\na=candidate:ha94693a 1 udp 2130706431 10.148.105.58 13736 typ host generation 0\r\na=candidate:ha94693a 2 udp 2130706430 10.148.105.58 13737 typ host generation 0\r\na=sendrecv\r\na=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:4jLrwNTctj4vvb3d/W+QxffO/dI/alp+FKFmQfd/\r\n"

thanks,
Binod.

--
 
 
 

BP Gangadharan

unread,
Aug 20, 2012, 11:50:49 PM8/20/12
to discuss...@googlegroups.com
My webserver converts the JSEP to SIP. 

I notice that Asterisk does not add "a=ssrc" lines and hence the answer SDP does not contain those lines.

Can someone please tell me, if that is necessary for Chrome to start sending the RTP? 

--
 
 
 

Lorenzo Miniero

unread,
Aug 21, 2012, 6:57:17 AM8/21/12
to discuss...@googlegroups.com
Hi,

you can try and refer to the steps I described here:


for some guidance on how to achieve this Asterisk-WebRTC interworking.

Lorenzo

BP Gangadharan

unread,
Aug 21, 2012, 8:13:32 AM8/21/12
to discuss...@googlegroups.com
Thanks Lorenzo,

I had seen your thread and that has been immensely helpful.

Do you know, if a=ssrc lines are needed in the SDP from other side for chrome to work?

Do you have a=ssrc lines in the SDP from asterisk?

thanks,

Lorenzo Miniero

unread,
Aug 22, 2012, 5:43:47 PM8/22/12
to discuss...@googlegroups.com
I don't know if they HAVE to be there, but I add them in the reply so they may help.

BP Gangadharan

unread,
Aug 23, 2012, 2:35:04 AM8/23/12
to discuss...@googlegroups.com
Thanks.

--
 
 
 

Nick Foster

unread,
Dec 5, 2012, 12:36:09 PM12/5/12
to discuss...@googlegroups.com
I came across this thread as I am trying to get a=ssrc lines into the SDP of an answer from asterisk to chrome. There is a bug that Google has acknowledged and hoping to fix but may not make the next version of chrome. The bug prevents media from flowing if the answer doesn't include the SSRC lines on Chrome 24 and higher. They are implementing RFC 5576 but I can't seem to find support for this in asterisk. Your thread seems to make me think one or both of you have been able to add the ssrc lines to the answer and I was hoping to get a few pointers on how to do this. I am new to asterisk and having trouble getting any changes I am making to the code to provide access to the SSRC if from the RTP engine to compile or when they do compile they wont load due to undefined symbols. Hopefully you can help me out and get me beyond this little hump.

Thanks,

- Nick

Mamadou

unread,
Dec 6, 2012, 6:00:53 PM12/6/12
to discuss-webrtc
Very strange.
I have two way video using "25.0.1337 dev" on OS X Lion without adding
SSRCs in the SDP response.
However, there is an issue with Chrome: If the media stream is created
with video and RTCPeerconnection initialized without then
setRemoteDescription fails with there is no video line.
> >>>https://groups.google.com/forum/?fromgroups=#!topic/discuss-webrtc/Yh...
> >>>>>> -\r\na=ptime:20\r\na=ice-ufrag:3afb3d6b389d710f271b089730e6565a\r\na=ice-pw d:14f3a2af727ee97944e8f9e665429cda\r\na=candidate:ha94693a

Nick Foster

unread,
Dec 7, 2012, 10:24:53 AM12/7/12
to discuss...@googlegroups.com
Video is a passthru right? What is your second endpoint and other chrome browser? Could that chrome browser be adding the SSRC lines for video and asterisk is just passing them through. Do you have audio working through asterisk?

I have done some experiments taking asterisk out of the loop, just two chrome browsers running 24 and 25 and having one of them strip the ssrc lines from its SDP. I was able to totally replicate the problem. Google has acknowledged the issue ( http://code.google.com/p/webrtc/issues/detail?id=932 ), but I am not sure a fix will make it into chrome 24, but it appears to be a blocker for 25.


--




Mamadou

unread,
Dec 7, 2012, 6:59:53 PM12/7/12
to discuss-webrtc
- Video is disabled
- I'm not calling another chrome but a SIP client / voicemail
- I'm using Chrome "25.0.1337 dev" on OS X Lion

Here are the steps I followed:
* checkout Asterisk SVN r376131 and apply patch from
http://sipml5.googlecode.com/svn/trunk/asterisk/asterisk_376131.patch
the patch fix two issues:
- ICE: chrome stops sending STUN bindings if first checks succeeded
- SRTP: Asterik do not preserve the crypto tag when there are more
than two attributes (tag=1 is always used)
* Navigate to http://sipml5.org/asterisk/call.htm and use the expert
view (http://sipml5.org/asterisk/expert.htm) to set the WebSocket Url
to your Asterisk server (e.g. ws://192.168.0.10:8088/ws)
please note *asterisk* in the url: it's a patched version of SIPML5
to fix issue reported at https://groups.google.com/group/discuss-webrtc/browse_thread/thread/64de068f36447685

On Dec 7, 4:24 pm, Nick Foster <n...@firespotter.com> wrote:
> Video is a passthru right? What is your second endpoint and other chrome
> browser? Could that chrome browser be adding the SSRC lines for video and
> asterisk is just passing them through. Do you have audio working through
> asterisk?
>
> I have done some experiments taking asterisk out of the loop, just two
> chrome browsers running 24 and 25 and having one of them strip the ssrc
> lines from its SDP. I was able to totally replicate the problem. Google
> has acknowledged the issue (http://code.google.com/p/webrtc/issues/detail?id=932), but I am not sure a

Mamadou

unread,
Dec 7, 2012, 7:06:35 PM12/7/12
to discuss-webrtc
additional info:
the patch contains code to add ssrc attributes [1] in the sdp (audio-
only) but it's commented as it was useless in chrome dev. You can
uncomment the code if you want and don't forget to change the
rtp_engine to use the same ssrc values.
[1] http://code.google.com/p/sipml5/source/browse/trunk/asterisk/asterisk_376131.patch?spec=svn141&r=141#31

On Dec 8, 12:59 am, Mamadou <boss...@yahoo.fr> wrote:
> - Video is disabled
> - I'm not calling another chrome but a SIP client / voicemail
> - I'm using Chrome "25.0.1337 dev" on OS X Lion
>
> Here are the steps I followed:
> * checkout Asterisk SVN r376131 and apply patch fromhttp://sipml5.googlecode.com/svn/trunk/asterisk/asterisk_376131.patch
>   the patch fix two issues:
>    - ICE: chrome stops sending STUN bindings if first checks succeeded
>    - SRTP: Asterik do not preserve the crypto tag when there are more
> than two attributes (tag=1 is always used)
> * Navigate tohttp://sipml5.org/asterisk/call.htmand use the expert
> view (http://sipml5.org/asterisk/expert.htm) to set the WebSocket Url
> to your Asterisk server (e.g. ws://192.168.0.10:8088/ws)
>   please note *asterisk* in the url: it's a patched version of SIPML5
> to fix issue reported athttps://groups.google.com/group/discuss-webrtc/browse_thread/thread/6...

Nick Foster

unread,
Dec 8, 2012, 11:07:35 AM12/8/12
to discuss...@googlegroups.com
Mamadou,

I have created a new server from scratch as you describe above and used your patched version of call.html however I am still unable to get audio on chrome 24 and 25. You mention not to forget to change the ssrc value in the rtp_engine, where exactly?
In my debugging I was trying to add those lines with the ssrc id that I obtained from the rtp_stats object.

struct ast_rtp_instance_stats stats;
ast_rtp_instance_get_stats(p->rtp, &stats, AST_RTP_INSTANCE_STAT_LOCAL_SSRC);
ast_str_append(&a_ssrc, 0, "a=ssrc:%d cname:stream_1_cname\r\n", stats.local_ssrc);
ast_str_append(&a_ssrc, 0, "a=ssrc:%d msid:default b0\r\n", stats.local_ssrc);
ast_str_append(&a_ssrc, 0, "a=ssrc:%d mslabel:default\r\n", stats.local_ssrc);
ast_str_append(&a_ssrc, 0, "a=ssrc:%d label:defaultb0\r\n", stats.local_ssrc);

Looking at the rtcp debug on the asterisk console it appears that the ssrc id obtained form this call is the one being sent in the rtcp packet (however I can't confirm in wireshark due to the srtcp packet being encrypted).

As I mentioned earlier I was able to repro this issue with asterisk out of the loop and just having chrome to chrome where the answering chrome strips off these lines. I get no audio. I even tried faking the values of msid cname, mslabel, and label and I got no audio when msid was faked.

- Nick


--




Iwan Budi Kusnanto

unread,
Jan 11, 2013, 11:31:24 PM1/11/13
to discuss...@googlegroups.com, ni...@firespotter.com
Hi Nick,
Have you fix this problem?
> --
>
>
>



--
Iwan Budi Kusnanto

Nick Foster

unread,
Jan 12, 2013, 1:23:22 PM1/12/13
to Iwan Budi Kusnanto, discuss...@googlegroups.com
Yes I was. The main problem was not totally the ssrc lines but with Chrome24 an incoming media stream needs to be added to a html5 video or audio tag. So by adding the media to the src of a html5 audio tag I was able to get audio to stream both ways.

- Nick

Iwan Budi Kusnanto

unread,
Jan 12, 2013, 6:13:13 PM1/12/13
to Nick Foster, discuss...@googlegroups.com
On Sun, Jan 13, 2013 at 1:23 AM, Nick Foster <ni...@firespotter.com> wrote:
> Yes I was. The main problem was not totally the ssrc lines but with Chrome24
> an incoming media stream needs to be added to a html5 video or audio tag. So
> by adding the media to the src of a html5 audio tag I was able to get audio
> to stream both ways.
>

Something like this?
elem.src = webkitURL.createObjectURL(stream);

Just tried it in still failed.

Do you still use sipml5 patched asterisk?
--
Iwan Budi Kusnanto

Iwan Budi Kusnanto

unread,
Jan 12, 2013, 6:51:02 PM1/12/13
to Nick Foster, discuss...@googlegroups.com
On Sun, Jan 13, 2013 at 6:13 AM, Iwan Budi Kusnanto <i...@labhijau.net> wrote:
> On Sun, Jan 13, 2013 at 1:23 AM, Nick Foster <ni...@firespotter.com> wrote:
>> Yes I was. The main problem was not totally the ssrc lines but with Chrome24
>> an incoming media stream needs to be added to a html5 video or audio tag. So
>> by adding the media to the src of a html5 audio tag I was able to get audio
>> to stream both ways.
>>
>
> Something like this?
> elem.src = webkitURL.createObjectURL(stream);
>
> Just tried it in still failed.
>
> Do you still use sipml5 patched asterisk?

Got this in asterisk console

res_srtp.c:395 ast_srtp_unprotect: SRTP unprotect failed with:
authentication failure 10
--
Iwan Budi Kusnanto
Reply all
Reply to author
Forward
0 new messages