[svn-commits] oej: branch oej/teapot-1.8 r402883 - in /team/oej/teapot-1.8: channels/ patches/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Nov 18 09:39:21 CST 2013


Author: oej
Date: Mon Nov 18 09:39:17 2013
New Revision: 402883

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=402883
Log:
Trying to fix 480 handling properly. We need to use hangup_sip2cause for that too.

Added:
    team/oej/teapot-1.8/patches/cloudberry-480-unavailable-1.8.diff   (with props)
    team/oej/teapot-1.8/patches/ignore-mki-index.diff   (with props)
    team/oej/teapot-1.8/patches/totag-fix.txt   (with props)
Modified:
    team/oej/teapot-1.8/channels/chan_sip.c

Modified: team/oej/teapot-1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/channels/chan_sip.c?view=diff&rev=402883&r1=402882&r2=402883
==============================================================================
--- team/oej/teapot-1.8/channels/chan_sip.c (original)
+++ team/oej/teapot-1.8/channels/chan_sip.c Mon Nov 18 09:39:17 2013
@@ -21268,14 +21268,23 @@
 	case 408: /* Request timeout */
 	case 405: /* Not allowed */
 	case 501: /* Not implemented */
+	case 480: /* Temporarily Unavailable */
+	case 482: /* Loop Detected */
+	case 410: /* Gone */
+	case 400: /* Bad Request */
+	case 500: /* Server error */
+	case 502: /* Bad gateway */
+	case 503: /* Service Unavailable */
 		xmitres = transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE);
 		if (p->owner) {
 			ast_queue_hangup_with_cause(p->owner, hangup_sip2cause(resp));
 		}
 		break;
-	}
-	if (xmitres == XMIT_ERROR)
+
+	}
+	if (xmitres == XMIT_ERROR) {
 		ast_log(LOG_WARNING, "Could not transmit message in dialog %s\n", p->callid);
+	}
 }
 
 /* \brief Handle SIP response in NOTIFY transaction
@@ -22178,8 +22187,12 @@
 				case 502: /* Bad gateway */
 				case 503: /* Service Unavailable */
 				case 504: /* Server Timeout */
-					if (owner)
-						ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
+					if (sipmethod == SIP_INVITE) {
+						handle_response_invite(p, resp, rest, req, seqno);
+					} else {
+						if (owner)
+							ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
+					}
 					break;
 				case 484: /* Address Incomplete */
 					if (owner && sipmethod != SIP_BYE) {

Added: team/oej/teapot-1.8/patches/cloudberry-480-unavailable-1.8.diff
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/patches/cloudberry-480-unavailable-1.8.diff?view=auto&rev=402883
==============================================================================
--- team/oej/teapot-1.8/patches/cloudberry-480-unavailable-1.8.diff (added)
+++ team/oej/teapot-1.8/patches/cloudberry-480-unavailable-1.8.diff Mon Nov 18 09:39:17 2013
@@ -1,0 +1,44 @@
+Index: channels/chan_sip.c
+===================================================================
+--- channels/chan_sip.c	(.../branches/1.8)	(revision 402882)
++++ channels/chan_sip.c	(.../team/oej/cloudberry-480-unavailable-1.8)	(revision 402882)
+@@ -21204,14 +21204,23 @@
+ 	case 408: /* Request timeout */
+ 	case 405: /* Not allowed */
+ 	case 501: /* Not implemented */
++	case 480: /* Temporarily Unavailable */
++	case 482: /* Loop Detected */
++	case 410: /* Gone */
++	case 400: /* Bad Request */
++	case 500: /* Server error */
++	case 502: /* Bad gateway */
++	case 503: /* Service Unavailable */
+ 		xmitres = transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE);
+ 		if (p->owner) {
+ 			ast_queue_hangup_with_cause(p->owner, hangup_sip2cause(resp));
+ 		}
+ 		break;
++
+ 	}
+-	if (xmitres == XMIT_ERROR)
++	if (xmitres == XMIT_ERROR) {
+ 		ast_log(LOG_WARNING, "Could not transmit message in dialog %s\n", p->callid);
++	}
+ }
+ 
+ /* \brief Handle SIP response in NOTIFY transaction
+@@ -22060,8 +22069,12 @@
+ 				case 502: /* Bad gateway */
+ 				case 503: /* Service Unavailable */
+ 				case 504: /* Server Timeout */
+-					if (owner)
+-						ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
++					if (sipmethod == SIP_INVITE) {
++						handle_response_invite(p, resp, rest, req, seqno);
++					} else {
++						if (owner)
++							ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
++					}
+ 					break;
+ 				case 484: /* Address Incomplete */
+ 					if (owner && sipmethod != SIP_BYE) {

Propchange: team/oej/teapot-1.8/patches/cloudberry-480-unavailable-1.8.diff
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/oej/teapot-1.8/patches/cloudberry-480-unavailable-1.8.diff
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/oej/teapot-1.8/patches/cloudberry-480-unavailable-1.8.diff
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/oej/teapot-1.8/patches/ignore-mki-index.diff
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/patches/ignore-mki-index.diff?view=auto&rev=402883
==============================================================================
--- team/oej/teapot-1.8/patches/ignore-mki-index.diff (added)
+++ team/oej/teapot-1.8/patches/ignore-mki-index.diff Mon Nov 18 09:39:17 2013
@@ -1,0 +1,15 @@
+Index: channels/sip/sdp_crypto.c
+===================================================================
+--- channels/sip/sdp_crypto.c	(revision 402877)
++++ channels/sip/sdp_crypto.c	(working copy)
+@@ -295,7 +295,9 @@
+ 					mki = strsep(&info, "|");
+ 				}
+ 				/* At this point we do not support multiple keys, sorry */
+-				if (mki != NULL && *mki != '1') {
++				//if (mki != NULL && *mki != '1') {
++				//If there's an MKI, give up.
++				if (mki != NULL) {
+ 					ast_log(LOG_ERROR, "Crypto mki handling not implemented. MKI = %s \n", mki);
+ 					continue;
+ 				}

Propchange: team/oej/teapot-1.8/patches/ignore-mki-index.diff
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/oej/teapot-1.8/patches/ignore-mki-index.diff
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/oej/teapot-1.8/patches/ignore-mki-index.diff
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/oej/teapot-1.8/patches/totag-fix.txt
URL: http://svnview.digium.com/svn/asterisk/team/oej/teapot-1.8/patches/totag-fix.txt?view=auto&rev=402883
==============================================================================
--- team/oej/teapot-1.8/patches/totag-fix.txt (added)
+++ team/oej/teapot-1.8/patches/totag-fix.txt Mon Nov 18 09:39:17 2013
@@ -1,0 +1,19 @@
+Index: channels/chan_sip.c
+===================================================================
+--- channels/chan_sip.c	(revision 402874)
++++ channels/chan_sip.c	(working copy)
+@@ -21811,8 +21811,12 @@
+ 		p->pendinginvite = 0;
+ 	}
+ 
+-	/* Get their tag if we haven't already */
+-	if (ast_strlen_zero(p->theirtag) || (resp >= 200)) {
++	/* Get their tag if we haven't already 
++	   If the dialog is established, we need to lock on to the to-tag. Before that,
++	   we can change and just use the latest one. Otherwise forking won't really
++	   work. Or, well, it doesn't work, but we are responding to the wrong
++	   fork. */
++	if (! ast_test_flag(&p->flags[1], SIP_PAGE2_DIALOG_ESTABLISHED)) {
+ 		char tag[128];
+ 
+ 		gettag(req, "To", tag, sizeof(tag));

Propchange: team/oej/teapot-1.8/patches/totag-fix.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/oej/teapot-1.8/patches/totag-fix.txt
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/oej/teapot-1.8/patches/totag-fix.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the svn-commits mailing list