[asterisk-dev] 'prematuremedia = yes' causes odd behavior on SNOM360 with early media.

Jonathan Rose jrose at digium.com
Fri Jul 1 15:55:38 CDT 2011



I was tracking an issue reported by Steve Pitts against an issue which
involves chan_sip's premature media filter which was added in a commit
by oej some time ago, and I was looking for an opinion...  here's the
scenario.

User calls in to Asterisk from basically any SIP phone.

Phone to Asterisk: INVITE
Asterisk to Phone: 401 Unauthorized
Phone to Asterisk: ACK
Phone to Asterisk: INVITE (with credentials)
Asterisk to Phone: 100 Trying
Phone to Asterisk: ACK


At this point, the call is connected and depending on the codec used, it
will hear audio from what I can only assume is earlymedia.  The phone
for the sake of this walk through is a SNOM360.  I've also tested this
with Blink softphone.  The behavior at the phone end is different, but
the SIP messages are essentially the same.

Once the call is connected, a 183 session progress is scheduled to be
sent to the phone once per minute due to another patch oej was involved
with.


This next bit might be a little unrelated, but around 42 seconds into
the call, 

At around 42 seconds, the following small conversation:

Asterisk to Phone: OPTIONS
Phone to Asterisk: 200 OK

The only significance I can think of that is that the SNOM phone is
sending a 200 OK... but again, I don't really believe this part was
important.

Finally, at 60 seconds the prescheduled 183 Session Progress is sent,
and this causes different behavior depending on the receiving device.
In the case of the SNOM360, the phone will start generating a ring and
will continue to do so until the call is answered.  In the case of
Blink, nothing immediately special will happen, but a minute or two
later (I haven't timed it), Blink will give up on the call and say it
failed to connect.

If I set sip.conf to have 'prematuremedia=no', then instead of Asterisk
sending a 100 trying and then getting an ACK, Asterisk sends a 100
trying and a 183 Session Progress which according to what I've read,
indicates immediately that we are in early media mode and everything
works as expected.

So anyway, I have read over some commit logs, and I'm aware that there
are good reasons for having prematuremedia mode act the way it does and
for it to be set by default.  I talked with David Vossel, and he seems
to agree with my current leanings... that it isn't appropriate to send
183 60 seconds later if we didn't send it at the start of the call.  At
the same time, I think we still need to warn the connected device that
there is a need to keep the connection alive, and so I wanted to ask
asterisk-dev if there was anyone who knew what, if anything should be
sent in this situation.

~Jonathan Rose, still fairly newish Asterisk developer.




More information about the asterisk-dev mailing list