[asterisk-commits] rmudgett: branch rmudgett/dahdi_deflection r223207 - /team/rmudgett/dahdi_def...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Oct 9 12:53:45 CDT 2009


Author: rmudgett
Date: Fri Oct  9 12:53:40 2009
New Revision: 223207

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=223207
Log:
Make application DAHDISendCallreroutingFacility() not be too picky about ISDN signaling.

Modified:
    team/rmudgett/dahdi_deflection/channels/chan_dahdi.c
    team/rmudgett/dahdi_deflection/channels/sig_pri.c

Modified: team/rmudgett/dahdi_deflection/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/dahdi_deflection/channels/chan_dahdi.c?view=diff&rev=223207&r1=223206&r2=223207
==============================================================================
--- team/rmudgett/dahdi_deflection/channels/chan_dahdi.c (original)
+++ team/rmudgett/dahdi_deflection/channels/chan_dahdi.c Fri Oct  9 12:53:40 2009
@@ -5129,7 +5129,7 @@
 static int dahdi_send_callrerouting_facility_exec(struct ast_channel *chan, const char *data)
 {
 	/* Data will be our digit string */
-	struct dahdi_pvt *p;
+	struct dahdi_pvt *pvt;
 	char *parse;
 	int res = -1;
 	AST_DECLARE_APP_ARGS(args,
@@ -5142,11 +5142,21 @@
 		ast_log(LOG_DEBUG, "No data sent to application!\n");
 		return -1;
 	}
-
-	p = (struct dahdi_pvt *)chan->tech_pvt;
-
-	if (!p) {
+	if (chan->tech != &dahdi_tech) {
+		ast_log(LOG_DEBUG, "Only DAHDI technology accepted!\n");
+		return -1;
+	}
+	pvt = (struct dahdi_pvt *) chan->tech_pvt;
+	if (!pvt) {
 		ast_log(LOG_DEBUG, "Unable to find technology private\n");
+		return -1;
+	}
+	switch (pvt->sig) {
+	case SIG_PRI_LIB_HANDLE_CASES:
+		break;
+	default:
+		ast_log(LOG_DEBUG, "callrerouting attempted on non-ISDN channel %s\n",
+			chan->name);
 		return -1;
 	}
 
@@ -5168,7 +5178,8 @@
 		args.reason = NULL;
 	}
 
-	pri_send_callrerouting_facility_exec(p->sig_pvt, chan->_state, args.destination, args.original, args.reason);
+	pri_send_callrerouting_facility_exec(pvt->sig_pvt, chan->_state, args.destination,
+		args.original, args.reason);
 
 	return res;
 }

Modified: team/rmudgett/dahdi_deflection/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/dahdi_deflection/channels/sig_pri.c?view=diff&rev=223207&r1=223206&r2=223207
==============================================================================
--- team/rmudgett/dahdi_deflection/channels/sig_pri.c (original)
+++ team/rmudgett/dahdi_deflection/channels/sig_pri.c Fri Oct  9 12:53:40 2009
@@ -3673,19 +3673,11 @@
 		return -1;
 	}
 
-	switch (p->pri->sig) {
-	case SIG_PRI:
-		if (!pri_grab(p, p->pri)) {
-			if (chanstate == AST_STATE_RING) {
-				res = pri_callrerouting_facility(p->pri->pri, p->call, destination, original, reason);
-			}
-			pri_rel(p->pri);
-		} else {
-			ast_log(LOG_DEBUG, "Unable to grab pri to send callrerouting facility on span %d!\n", p->pri->span);
-			sig_pri_unlock_private(p);
-			return -1;
-		}
-		break;
+	if (!pri_grab(p, p->pri)) {
+		res = pri_callrerouting_facility(p->pri->pri, p->call, destination, original, reason);
+		pri_rel(p->pri);
+	} else {
+		ast_log(LOG_DEBUG, "Unable to grab pri to send callrerouting facility on span %d!\n", p->pri->span);
 	}
 
 	sig_pri_unlock_private(p);




More information about the asterisk-commits mailing list