diff options
author | root <root@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-02 20:04:16 +0000 |
---|---|---|
committer | root <root@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-02 20:04:16 +0000 |
commit | 71936a878c09e11196ea21e044e49303c9d818e4 (patch) | |
tree | 0705e65dc5bacd9d52ffac51f0bda15d0c8cecce /channels | |
parent | 6afe8224a8597a7909548b001bed4f4774d4a8ac (diff) |
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@38754 f38db490-d61c-443f-a65b-d21fe96a405b
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 53ba0086a..30e1b725a 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -9683,14 +9683,20 @@ static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, stru return; } + /* 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 (!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, SIP_CAN_BYE); break; case 180: /* 180 Ringing */ if (!ignore) @@ -9707,10 +9713,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, SIP_CAN_BYE); + check_pendings(p); break; case 183: /* Session progress */ if (!ignore) @@ -9723,10 +9727,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, SIP_CAN_BYE); + check_pendings(p); break; case 200: /* 200 OK on invite - someone's answering our call */ if (!ignore) @@ -9775,6 +9777,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, 0, 1); + ast_set_flag(p, SIP_CAN_BYE); check_pendings(p); break; case 407: /* Proxy authentication */ |