aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-28 20:17:24 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-28 20:17:24 +0000
commitf5e466a35f6f13c99d6644a2d322d4a1a9c54ce9 (patch)
tree6d5c91e95888780f6782fb0601d9c059e9daf1ec /channels
parentaec81d8f107b56424249365073b405e73dfca5df (diff)
Treat 405 responses the same way we would a 501.
This makes sure that we mark a method as being unallowed if we receive a 405 response so that we don't continue to try to send that same type of message. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@197740 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index cf7dd08fd..d803429c8 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -17808,6 +17808,7 @@ static void handle_response_invite(struct sip_pvt *p, int resp, const char *rest
}
break;
+ case 405: /* Not allowed */
case 501: /* Not implemented */
xmitres = transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE);
if (p->owner)
@@ -17972,6 +17973,18 @@ static void handle_response_refer(struct sip_pvt *p, int resp, const char *rest,
pvt_set_needdestroy(p, "failed to authenticate REFER");
}
break;
+
+ case 405: /* Method not allowed */
+ /* Return to the current call onhold */
+ /* Status flag needed to be reset */
+ ast_log(LOG_NOTICE, "SIP transfer to %s failed, REFER not allowed. \n", p->refer->refer_to);
+ pvt_set_needdestroy(p, "received 405 response");
+ p->refer->status = REFER_FAILED;
+ if (p->owner) {
+ ast_queue_control_data(p->owner, AST_CONTROL_TRANSFER, &message, sizeof(message));
+ }
+ break;
+
case 481: /* Call leg does not exist */
/* A transfer with Replaces did not work */
@@ -18444,6 +18457,7 @@ static void handle_response(struct sip_pvt *p, int resp, const char *rest, struc
pvt_set_needdestroy(p, "received 491 response");
}
break;
+ case 405:
case 501: /* Not Implemented */
mark_method_unallowed(&p->allowed_methods, sipmethod);
if ((peer = find_peer(p->peername, 0, 1, FINDPEERS, FALSE))) {