aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-12-06 16:54:27 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-12-06 16:54:27 +0000
commit283491e8f7f6d4e5d4a67b3fa3fc8e4ef45de5cb (patch)
treede37632f6095f39964bb4b632276c050c9c28b49 /channels/chan_sip.c
parentbf062899807c2ec6ce28932147ed6be3f3bb0f7e (diff)
Handle multiple 487's correctly
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48327 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 2e71e7a66..7182603da 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -11943,7 +11943,16 @@ static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, stru
ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
break;
-
+ case 487: /* Cancelled transaction */
+ /* We have sent CANCEL on an outbound INVITE
+ This transaction is already scheduled to be killed by sip_hangup().
+ */
+ transmit_request(p, SIP_ACK, seqno, 0, 0);
+ if (p->owner && !ast_test_flag(req, SIP_PKT_IGNORE))
+ ast_queue_hangup(p->owner);
+ else if (!ast_test_flag(req, SIP_PKT_IGNORE))
+ update_call_counter(p, DEC_CALL_LIMIT);
+ break;
case 491: /* Pending */
/* we really should have to wait a while, then retransmit */
/* We should support the retry-after at some point */
@@ -11955,6 +11964,7 @@ static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, stru
break;
case 501: /* Not implemented */
+ transmit_request(p, SIP_ACK, seqno, 0, 0);
if (p->owner)
ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
break;
@@ -12377,6 +12387,10 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
/* Guessing that this is not an important request */
}
break;
+ case 487:
+ if (sipmethod == SIP_INVITE)
+ handle_response_invite(p, resp, rest, req, seqno);
+ break;
case 491: /* Pending */
if (sipmethod == SIP_INVITE)
handle_response_invite(p, resp, rest, req, seqno);
@@ -12422,12 +12436,6 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
if (p->owner)
ast_queue_control(p->owner, AST_CONTROL_BUSY);
break;
- case 487: /* Response on INVITE that has been CANCELled */
- /* channel now destroyed - dec the inUse counter */
- if (owner)
- ast_queue_hangup(p->owner);
- update_call_counter(p, DEC_CALL_LIMIT);
- break;
case 482: /*
\note SIP is incapable of performing a hairpin call, which
is yet another failure of not having a layer 2 (again, YAY