aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-12-06 15:42:41 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-12-06 15:42:41 +0000
commiteacfb3340fe838ce5a3aa004275208e22cf1fb19 (patch)
tree93769f74c36ed39d9b92c34531d9a72923b47e17
parent0c237fc2b2e6925994acffbfffd4ef74a20c3258 (diff)
Issue #8528 - make sure we don't delete the dialog too quickly after receiving
a 487. Move 487 handling into handle_response_invite where it really belongs and don't add an ALREADYGONE flag to the dialog. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@48320 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 51c90ea35..764ca032d 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -9827,12 +9827,23 @@ static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, stru
ast_log(LOG_WARNING, "Re-invite to non-existing call leg on other UA. SIP dialog '%s'. Giving up.\n", p->callid);
transmit_request(p, SIP_ACK, seqno, 0, 0);
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 && !ignore)
+ ast_queue_hangup(p->owner);
+ else if (!ignore)
+ update_call_counter(p, DEC_CALL_LIMIT);
+ break;
case 491: /* Pending */
/* we have to wait a while, then retransmit */
/* Transmission is rescheduled, so everything should be taken care of.
We should support the retry-after at some point */
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;
@@ -10140,6 +10151,10 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
ast_set_flag(p, SIP_NEEDDESTROY);
break;
+ case 487:
+ if (sipmethod == SIP_INVITE)
+ handle_response_invite(p, resp, rest, req, ignore, seqno);
+ break;
case 491: /* Pending */
if (sipmethod == SIP_INVITE) {
handle_response_invite(p, resp, rest, req, ignore, seqno);
@@ -10176,12 +10191,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:
- /* channel now destroyed - dec the inUse counter */
- if (owner)
- ast_queue_hangup(p->owner);
- update_call_counter(p, DEC_CALL_LIMIT);
- break;
case 482: /* SIP is incapable of performing a hairpin call, which
is yet another failure of not having a layer 2 (again, YAY
IETF for thinking ahead). So we treat this as a call