aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-12-02 21:45:58 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-12-02 21:45:58 +0000
commit1046a9720647c3b242d8225c7d7d3d9768fb1132 (patch)
tree1a47fe565df903bcf1f4023a56c0ad4e2faf7852
parent26ab0f0fd495ae94a975ae475f618bb4459bff80 (diff)
- Removing one of two pieces of code to handle 481 response on INVITE
- Move handling of REFER response to handle_response_refer() git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@48219 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 80b009157..eb381a7e2 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -11697,9 +11697,12 @@ static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, stru
break;
case 481: /* Call leg does not exist */
- /* Could be REFER or INVITE */
+ /* Could be REFER caused INVITE with replaces */
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, XMIT_UNRELIABLE, FALSE);
+ if (p->owner)
+ ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
+ sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
break;
case 491: /* Pending */
@@ -11759,7 +11762,16 @@ static void handle_response_refer(struct sip_pvt *p, int resp, char *rest, struc
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
}
break;
+ case 481: /* Call leg does not exist */
+ /* A transfer with Replaces did not work */
+ /* OEJ: We should Set flag, cancel the REFER, go back
+ to original call - but right now we can't */
+ ast_log(LOG_WARNING, "Remote host can't match REFER request to call '%s'. Giving up.\n", p->callid);
+ if (p->owner)
+ ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
+ ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
+ break;
case 500: /* Server error */
case 501: /* Method not implemented */
@@ -12094,21 +12106,9 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
break;
case 481: /* Call leg does not exist */
if (sipmethod == SIP_INVITE) {
- /* First we ACK */
- transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE);
- if (option_debug)
- ast_log(LOG_DEBUG, "Got 481 on Invite. Assuming INVITE with REPLACEs failed to '%s'\n", get_header(&p->initreq, "From"));
- if (owner)
- ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
- sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
+ handle_response_invite(p, resp, rest, req, seqno);
} else if (sipmethod == SIP_REFER) {
- /* A transfer with Replaces did not work */
- /* OEJ: We should Set flag, cancel the REFER, go back
- to original call - but right now we can't */
- ast_log(LOG_WARNING, "Remote host can't match request %s to call '%s'. Giving up.\n", sip_methods[sipmethod].text, p->callid);
- if (owner)
- ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
- ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
+ handle_response_refer(p, resp, rest, req, seqno);
} else if (sipmethod == SIP_BYE) {
/* The other side has no transaction to bye,
just assume it's all right then */