[asterisk-commits] mmichelson: trunk r197740 - /trunk/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 28 15:17:28 CDT 2009


Author: mmichelson
Date: Thu May 28 15:17:24 2009
New Revision: 197740

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=197740
Log:
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.


Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=197740&r1=197739&r2=197740
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Thu May 28 15:17:24 2009
@@ -17808,6 +17808,7 @@
 		}
 		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 @@
 			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 @@
 				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))) {




More information about the asterisk-commits mailing list