[asterisk-commits] oej: branch oej/earl-grey-sip2cause-configurable-1.8 r392264 - /team/oej/earl...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 19 11:17:00 CDT 2013


Author: oej
Date: Wed Jun 19 11:16:58 2013
New Revision: 392264

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=392264
Log:
Handling hangup cause conversion on congestion as well

Modified:
    team/oej/earl-grey-sip2cause-configurable-1.8/channels/chan_sip.c

Modified: team/oej/earl-grey-sip2cause-configurable-1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/earl-grey-sip2cause-configurable-1.8/channels/chan_sip.c?view=diff&rev=392264&r1=392263&r2=392264
==============================================================================
--- team/oej/earl-grey-sip2cause-configurable-1.8/channels/chan_sip.c (original)
+++ team/oej/earl-grey-sip2cause-configurable-1.8/channels/chan_sip.c Wed Jun 19 11:16:58 2013
@@ -7140,7 +7140,15 @@
 		break;
 	case AST_CONTROL_CONGESTION:
 		if (ast->_state != AST_STATE_UP) {
-			transmit_response_reliable(p, "503 Service Unavailable", &p->initreq);
+			const char *res;
+			if (p->owner) {
+                		p->hangupcause = p->owner->hangupcause;
+			}
+			if (p->hangupcause && (res = hangup_cause2sip(p->hangupcause))) {
+				transmit_response_reliable(p, res, &p->initreq);
+			} else {
+				transmit_response_reliable(p, "503 Service Unavailable", &p->initreq);
+			}
 			p->invitestate = INV_COMPLETED;
 			sip_alreadygone(p);
 			ast_softhangup_nolock(ast, AST_SOFTHANGUP_DEV);




More information about the asterisk-commits mailing list