diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2006-08-02 19:32:38 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2006-08-02 19:32:38 +0000 |
commit | 1b784cd1f72f1a40d6a514423ab91548d0bbd464 (patch) | |
tree | ffb472cdbfa6c8b3c3367f0c90d7976e6ba7c3d6 /channels | |
parent | a8d7d9123af24e773fc4cd66627610b35d1aade9 (diff) |
Merged revisions 38731 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r38731 | kpfleming | 2006-08-02 14:29:56 -0500 (Wed, 02 Aug 2006) | 3 lines
fix brain-damage I introduced when trying to fix the CANCEL/BYE sending mechanism for pending INVITES
accept unknown 1xx responses as 183 responses (as RFC3261 mandates we should do)
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38732 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index a293c243b..708b1675e 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -11162,14 +11162,20 @@ static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, stru p->initid = -1; } + /* RFC3261 says we must treat every 1xx response (but not 100) + that we don't recognize as if it was 183. + */ + if ((resp > 100) && + (resp < 200) && + (resp != 180) && + (resp != 183)) + resp = 183; + switch (resp) { case 100: /* Trying */ if (!ast_test_flag(req, SIP_PKT_IGNORE)) sip_cancel_destroy(p); - /* must call check_pendings before setting CAN_BYE, so that - if PENDINGBYE is set it will know to send CANCEL instead */ check_pendings(p); - ast_set_flag(&p->flags[0], SIP_CAN_BYE); break; case 180: /* 180 Ringing */ if (!ast_test_flag(req, SIP_PKT_IGNORE)) @@ -11187,10 +11193,8 @@ static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, stru ast_queue_control(p->owner, AST_CONTROL_PROGRESS); } } - /* must call check_pendings before setting CAN_BYE, so that - if PENDINGBYE is set it will know to send CANCEL instead */ - check_pendings(p); ast_set_flag(&p->flags[0], SIP_CAN_BYE); + check_pendings(p); break; case 183: /* Session progress */ if (!ast_test_flag(req, SIP_PKT_IGNORE)) @@ -11203,10 +11207,8 @@ static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, stru ast_queue_control(p->owner, AST_CONTROL_PROGRESS); } } - /* must call check_pendings before setting CAN_BYE, so that - if PENDINGBYE is set it will know to send CANCEL instead */ - check_pendings(p); ast_set_flag(&p->flags[0], SIP_CAN_BYE); + check_pendings(p); break; case 200: /* 200 OK on invite - someone's answering our call */ if (!ast_test_flag(req, SIP_PKT_IGNORE)) @@ -11300,6 +11302,7 @@ static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, stru } /* If I understand this right, the branch is different for a non-200 ACK only */ transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, TRUE); + ast_set_flag(&p->flags[0], SIP_CAN_BYE); check_pendings(p); break; case 407: /* Proxy authentication */ |