Early media

908 views
Skip to first unread message

dmit...@gmail.com

unread,
Nov 10, 2014, 5:54:29 AM11/10/14
to sip...@googlegroups.com
Hi,

Are there any chances to hear early media from the other side?

For example, if I use sipml5 library I can hear Not available voice message from the operator. With SIP js I can't do this.

Thanks.

Joseph Frazier

unread,
Nov 10, 2014, 10:12:49 AM11/10/14
to sip...@googlegroups.com, dmit...@gmail.com
Hi Dmitry,

If you put rel100: SIP.C.supported.SUPPORTED in your UA configuration parameters, SIP.js will play early media. Here's a demo that will recite Louie Louie to you, without actually picking up the call (note that the 200 OK in the console is in response to the PRACK, not to the INVITE): http://jsfiddle.net/g3ennyxg/

Cheers,
Joseph

lukasz.s...@gmail.com

unread,
Jan 21, 2015, 12:04:27 PM1/21/15
to sip...@googlegroups.com, dmit...@gmail.com
I figured out you should add constraints in invite method on machines without camera (otherwise chrome blocks video/audio by default)

var session = ua.invite('sip:ea...@junctionnetworks.com', {
media: {
constraints: {
audio: true,
video: false
},
render: {
remote: {
audio: new Audio()
}
}
}
});

i updated your example:
http://jsfiddle.net/g3ennyxg/1/

btw.
does it work on firefox for you ? mine disconnects almost immediately (FF 35.0)

Dmitry Kutuzov

unread,
Jan 22, 2015, 6:02:31 AM1/22/15
to lukasz.s...@gmail.com, sip...@googlegroups.com
I have already done it. But I don't hear early media. And I have to use sipml5 library. It works fine on FF.

Wed Jan 21 2015 at 20:04:27, <lukasz.s...@gmail.com>:
I figured out you should add constraints in invite method on machines without camera (otherwise chrome blocks video/audio by default)

var session = ua.invite('sip:early@junctionnetworks.com', {

Łukasz Starowicz

unread,
Jan 22, 2015, 6:24:39 AM1/22/15
to Dmitry Kutuzov, sip...@googlegroups.com
Works for me - exactly as shown in this example: http://jsfiddle.net/g3ennyxg/1/ (it plays Louie Louie while ringing)

You might have problem with your Freeswitch config - rel100 should be enabled, but also it should send '180 ringing' message - check your logs

To enable this 180 required some changes in Freeswitch config, someone else did it, but if you won't find it - I will ask that guy.

--
Łukasz Starowicz

lukasz.s...@gmail.com
+48 502 35 22 97

Dmitry Kutuzov

unread,
Jan 22, 2015, 6:28:12 AM1/22/15
to Łukasz Starowicz, sip...@googlegroups.com
We use Asterisk.

Thu Jan 22 2015 at 14:24:39, Łukasz Starowicz <lukasz.s...@gmail.com>:

Joseph Frazier

unread,
Jan 22, 2015, 9:42:47 AM1/22/15
to sip...@googlegroups.com, lukasz.s...@gmail.com, dmit...@gmail.com
Dmitry, can you post a gist of the JS console log when SIP.js fails to play early media? Please ensure that you've set traceSip:true in the UA config.

Łukasz,

> I figured out you should add constraints in invite method on machines without camera (otherwise chrome blocks video/audio by default) 

Good point, I had forgotten about that.

> does it work on firefox for you ? mine disconnects almost immediately (FF 35.0) 

For me, FF 35.0 connected (according to the SIP messages in the console) but did not play any audio. Updating SIP.js to 0.6.4 fixes it for me. Can you try that?

Thanks,
Joseph

Łukasz Starowicz

unread,
Jan 22, 2015, 10:47:21 AM1/22/15
to Joseph Frazier, sip...@googlegroups.com, Дмитрий Кутузов

2015-01-22 15:42 GMT+01:00 Joseph Frazier <jos...@onsip.com>:
For me, FF 35.0 connected (according to the SIP messages in the console) but did not play any audio. Updating SIP.js to 0.6.4 fixes it for me. Can you try that?

I tried it also before, it's something else - I receive 603 Declined at some point, full log in attachment


earlymedia603.txt

Joseph Frazier

unread,
Jan 22, 2015, 11:18:19 AM1/22/15
to sip...@googlegroups.com, jos...@onsip.com, dmit...@gmail.com, lukasz.s...@gmail.com
Oh, I see, it's a separate problem. There appears to be enough network latency to trigger a retransmission of the 183 Session Progress that contains the SDP answer for the early media, which is then mishandled by SIP.js. I've created an issue on Github to track this problem.

Joseph

James Criscuolo

unread,
Apr 22, 2015, 3:13:34 PM4/22/15
to sip...@googlegroups.com, dmit...@gmail.com, jos...@onsip.com, lukasz.s...@gmail.com
Hi Łukasz,
  I just pushed a fix for your problem on master. I tested using the case seen in the issue, so let me know if there are still any problems

Thanks,
James

On Thursday, January 22, 2015 at 10:47:21 AM UTC-5, Łukasz Starowicz wrote:
Reply all
Reply to author
Forward
0 new messages