[asterisk-users] Problem with reINVITE on BYE

David Lam softwareguy at gmail.com
Fri Mar 7 04:10:48 CST 2014

Hello all.
I am currently using Asterisk 11.7.0 (also tried Asterisk 12, but same
behavior) and is having an issue when it comes to reINVITE on BYEs.
Apparently one of the SIP providers that I am using does not always process
reINVITEs correctly, and would return a 500 Internal Server Error message
on some (but not all) of these transactions.
To get around this issue, I have been using directrtpsetup = yes in my
sip.conf, and it worked quite well. However, even with this option set,
Asterisk would reINVITE itself back into the audio path as soon as the
caller hangs up. The behavior I am seeing is that if the SIP provider sends
back a 500 Internal Server Error on the reINVITE, Asterisk will not hang up
the call until the called party hangs up. The transaction goes something
like this:

1. Caller calls a number using a target SIP server.
2. -- Early Media --
3. Answer, -- Answering Machine --
4. Caller hangs up
5. Asterisk sends reINVITE to target SIP server back to itself
--- If SIP server returns 500 Internal Server Error, step 6 is never
reached and the call stalls.
6. Asterisk sends a BYE to the target SIP server

This is what happens when the reINVITE proceeds normally, but if 500
Internal Server Error is returned on step 5, then Asterisk will only
acknowledge the 500 Internal Server Error and never send back a BYE. As a
result, the other parties are getting minutes of empty voicemail (due to
timeout) and I am getting charged for these minutes on my provider.

With this in mind, is there something I can do so that a BYE is sent
immediately to the SIP provider when the client initiates a hang up? I
don't believe this can be done via some kind of setting, but maybe changing
the source may help. I don't plan to have any dialplan rules execute after
hangup so making this a global option would be okay in my case.

Anyone has any pointers?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20140307/6bf49a23/attachment.html>

More information about the asterisk-users mailing list