summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorOlle Johansson <oej@edvina.net>2007-11-15 11:31:27 +0000
committerOlle Johansson <oej@edvina.net>2007-11-15 11:31:27 +0000
commita4ce44bda4a38746c9e2281e1de0f67cbe33e4ce (patch)
treeb7840328afa05183a2a3ffe256b5d26d82244271 /channels/chan_sip.c
parentc698e39245ef5813ffdb5bd4d7a2574e9d3ae4ac (diff)
Merged revisions 89281 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89281 | oej | 2007-11-15 12:26:22 +0100 (Tor, 15 Nov 2007) | 6 lines Don't send re-invites during pending INVITE transactions. Patch by one47 - thanks! Closes issue #9305 ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89283 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index e161322c3..7bcc5486a 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -13192,15 +13192,27 @@ static void check_pendings(struct sip_pvt *p)
transmit_request(p, SIP_CANCEL, p->ocseq, XMIT_RELIABLE, FALSE);
/* Actually don't destroy us yet, wait for the 487 on our original
INVITE, but do set an autodestruct just in case we never get it. */
- else
+ else {
+ /* We have a pending outbound invite, don't send someting
+ new in-transaction */
+ if (p->pendinginvite)
+ return;
+
+ /* Perhaps there is an SD change INVITE outstanding */
transmit_request_with_auth(p, SIP_BYE, 0, XMIT_RELIABLE, TRUE);
+ }
ast_clear_flag(&p->flags[0], SIP_PENDINGBYE);
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
} else if (ast_test_flag(&p->flags[0], SIP_NEEDREINVITE)) {
- ast_debug(2, "Sending pending reinvite on '%s'\n", p->callid);
- /* Didn't get to reinvite yet, so do it now */
- transmit_reinvite_with_sdp(p, FALSE);
- ast_clear_flag(&p->flags[0], SIP_NEEDREINVITE);
+ /* if we can't REINVITE, hold it for later */
+ if (p->pendinginvite || p->invitestate == INV_CALLING || p->invitestate == INV_PROCEEDING || p->invitestate == INV_EARLY_MEDIA) {
+ ast_debug(2, "NOT Sending pending reinvite (yet) on '%s'\n", p->callid);
+ } else {
+ ast_debug(2, "Sending pending reinvite on '%s'\n", p->callid);
+ /* Didn't get to reinvite yet, so do it now */
+ transmit_reinvite_with_sdp(p, FALSE);
+ ast_clear_flag(&p->flags[0], SIP_NEEDREINVITE);
+ }
}
}