Skip to content
Snippets Groups Projects
Commit 2b424229 authored by Olle Johansson's avatar Olle Johansson
Browse files

Handle multiple 487's correctly

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent c7efdf67
No related branches found
No related tags found
No related merge requests found
...@@ -11943,7 +11943,16 @@ static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, stru ...@@ -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); ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT); sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
break; 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 */ case 491: /* Pending */
/* we really should have to wait a while, then retransmit */ /* we really should have to wait a while, then retransmit */
/* We should support the retry-after at some point */ /* 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 ...@@ -11955,6 +11964,7 @@ static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, stru
break; break;
   
case 501: /* Not implemented */ case 501: /* Not implemented */
transmit_request(p, SIP_ACK, seqno, 0, 0);
if (p->owner) if (p->owner)
ast_queue_control(p->owner, AST_CONTROL_CONGESTION); ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
break; break;
...@@ -12377,6 +12387,10 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_ ...@@ -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 */ /* Guessing that this is not an important request */
} }
break; break;
case 487:
if (sipmethod == SIP_INVITE)
handle_response_invite(p, resp, rest, req, seqno);
break;
case 491: /* Pending */ case 491: /* Pending */
if (sipmethod == SIP_INVITE) if (sipmethod == SIP_INVITE)
handle_response_invite(p, resp, rest, req, seqno); 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_ ...@@ -12422,12 +12436,6 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
if (p->owner) if (p->owner)
ast_queue_control(p->owner, AST_CONTROL_BUSY); ast_queue_control(p->owner, AST_CONTROL_BUSY);
break; 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: /* case 482: /*
\note SIP is incapable of performing a hairpin call, which \note SIP is incapable of performing a hairpin call, which
is yet another failure of not having a layer 2 (again, YAY is yet another failure of not having a layer 2 (again, YAY
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment