diff options
author | Mark Michelson <mmichelson@digium.com> | 2010-06-23 17:08:34 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2010-06-23 17:08:34 +0000 |
commit | 2c798f321a4f5b9b7a4a9d5a527b97c975c21488 (patch) | |
tree | 7bd9827b41c0ed9bc1bdb31aadbdd11143b1ce59 /channels | |
parent | 746d8e6013ed4bba639ff20e20f847a845f7d45b (diff) |
Add extra protection for reinvite glare scenario.
Testing proved that if Asterisk sent a connected line reinvite, and
the endpoint to which the reinvite were being sent sent a reinvite, Asterisk
would not properly respond with a 491 response.
The reason is that on connected line reinvites, we set the dialog's invitestate
to INV_CALLING to prevent Asterisk from sending a rapid flurry of connected line
reinvites. For other reinvites we do not do this. Because of the current invitestate,
when Asterisk received the reinvite, we interpreted this as a spiraled INVITE, and thus
did not behave properly.
The fix for this is to not enter the loop detection or spiral logic in handle_request_invite
if the channel state is currently up. This way, no mid-call reinvites will be misinterpreted,
no matter what the nature of the reinvite may have been.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@272090 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index fa03d9c43..b3bf2cd01 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -20508,7 +20508,7 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int p->reqsipoptions = required_profile; /* Check if this is a loop */ - if (ast_test_flag(&p->flags[0], SIP_OUTGOING) && p->owner && (p->invitestate != INV_TERMINATED && p->invitestate != INV_CONFIRMED)) { + if (ast_test_flag(&p->flags[0], SIP_OUTGOING) && p->owner && (p->invitestate != INV_TERMINATED && p->invitestate != INV_CONFIRMED) && p->owner->_state != AST_STATE_UP) { /* This is a call to ourself. Send ourselves an error code and stop processing immediately, as SIP really has no good mechanism for being able to call yourself */ |