[Asterisk-Dev] Fundamental locking (race/deadlock) problem in ast_hangup()

Olle E. Johansson oej at edvina.net
Thu Aug 25 05:06:00 MST 2005


In SIP we have a problem with hangups. In most cases it doesn't affect
communication, so it's theory at this point until I find a trace with a
problem :-)

We get sip_hangup from ast_hangup and send a BYE or a CANCEL. At this
point, we *should* wait for a timeout or a 200 OK on the message. At
this point, we loose the channel and get an OK a while later that we
can't do much with. If for some reason the other end denies this because
of other pending transactions, we're dead again since we have no channel
to keep up...

So I have to return from sip_hangup with unfinished business, or maybe
loop around stalling until I get a proper acknowledgement...

More seriously, we do the same with app_transfer - we send a REFER to
transfer a call, but do not care a bit about the reply. If it fails, it
fails and the caller have a dead channel. At that point, we're already
on another priority in the dial plan...

/O



More information about the asterisk-dev mailing list