[asterisk-commits] moy: branch moy/mfcr2-1.4 r172364 - /team/moy/mfcr2-1.4/channels/chan_dahdi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 29 11:59:47 CST 2009


Author: moy
Date: Thu Jan 29 11:59:47 2009
New Revision: 172364

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=172364
Log:
added proper cause management, experimental yet!

Modified:
    team/moy/mfcr2-1.4/channels/chan_dahdi.c

Modified: team/moy/mfcr2-1.4/channels/chan_dahdi.c
URL: http://svn.digium.com/svn-view/asterisk/team/moy/mfcr2-1.4/channels/chan_dahdi.c?view=diff&rev=172364&r1=172363&r2=172364
==============================================================================
--- team/moy/mfcr2-1.4/channels/chan_dahdi.c (original)
+++ team/moy/mfcr2-1.4/channels/chan_dahdi.c Thu Jan 29 11:59:47 2009
@@ -1208,19 +1208,41 @@
 			/* being the forward side we must report what happened to the call to whoever requested it */
 			switch (cause) {
 			case OR2_CAUSE_BUSY_NUMBER:
+				p->owner->hangupcause = AST_CAUSE_BUSY;
+				p->subs[SUB_REAL].needbusy = 1;
+				break;
+			case OR2_CAUSE_NUMBER_CHANGED:
+				p->owner->hangupcause = AST_CAUSE_NOTDEFINED;
 				p->subs[SUB_REAL].needbusy = 1;
 				break;
 			case OR2_CAUSE_NETWORK_CONGESTION:
+				p->owner->hangupcause = AST_CAUSE_NETWORK_OUT_OF_ORDER;
+				p->subs[SUB_REAL].needcongestion = 1;
+				break;
 			case OR2_CAUSE_OUT_OF_ORDER:
+				p->owner->hangupcause = AST_CAUSE_DESTINATION_OUT_OF_ORDER;
+				p->subs[SUB_REAL].needcongestion = 1;
+				break;
 			case OR2_CAUSE_UNALLOCATED_NUMBER:
+				p->owner->hangupcause = AST_CAUSE_UNALLOCATED;
+				p->subs[SUB_REAL].needcongestion = 1;
+				break;
 			case OR2_CAUSE_NO_ANSWER:
+				p->owner->hangupcause = AST_CAUSE_NO_ANSWER;
+				p->subs[SUB_REAL].needcongestion = 1;
+				break;
 			case OR2_CAUSE_UNSPECIFIED:
+				p->owner->hangupcause = AST_CAUSE_NOTDEFINED;
+				p->subs[SUB_REAL].needcongestion = 1;
+				break;
 			case OR2_CAUSE_NORMAL_CLEARING:
+				p->owner->hangupcause = AST_CAUSE_NORMAL_CLEARING;
 				p->subs[SUB_REAL].needcongestion = 1;
 				break;
 			default:
-				p->owner->_softhangup |= AST_SOFTHANGUP_DEV;
-			}
+				ast_log(LOG_WARNING, "Unhandled cause %d\n", cause);
+			}
+			p->owner->_softhangup |= AST_SOFTHANGUP_DEV;
 			ast_mutex_unlock(&p->lock);
 		} else {
 			ast_mutex_unlock(&p->lock);




More information about the asterisk-commits mailing list