[asterisk-dev] [Code Review] Help mitigate reinvite glares in the SIP channel driver

Mark Michelson reviewboard at asterisk.org
Fri May 25 14:12:15 CDT 2012

This is an automatically generated e-mail. To reply, visit:

(Updated May 25, 2012, 2:12 p.m.)

Review request for Asterisk Developers.


I have made the changes suggested by Kevin.


There are times where multiple Asterisk servers are peered together over SIP. In such situations, it is possible for both Asterisk servers to attempt to send direct media reinvites to each other simultaneously. This results in a glare situation in which each of the Asterisk servers sends a 491 to the other. After a waiting period, the reinvites are re-attempted. This waiting period can potentially be distracting since it can cause the media to take multiple seconds to finalize, especially if more than 2 Asterisk servers are involved.

This patch introduces a new SIP peer option called "directmedia_outgoing". If enabled, then when communicating with the peer, Asterisk will only attempt to send reinvites if the call direction is outgoing. The assumption is that the peer Asterisk server will also have this setting enabled. This way, when the two Asterisk servers communicate, they will never attempt to send direct media reinvites to each other. Instead, it will always be the peer that placed the call that will send the direct media reinvite.

Diffs (updated)

  /trunk/channels/chan_sip.c 367639 
  /trunk/channels/sip/include/sip.h 367639 
  /trunk/configs/sip.conf.sample 367639 

Diff: https://reviewboard.asterisk.org/r/1946/diff


I have tested this by running two Asterisk servers and ensuring that the option was honored and that the media streams were still set up properly.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120525/22a21400/attachment.htm>

More information about the asterisk-dev mailing list