[asterisk-commits] jpeeler: branch jpeeler/asterisk-sigwork-trunk r198950 - /team/jpeeler/asteri...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 3 11:37:55 CDT 2009


Author: jpeeler
Date: Wed Jun  3 11:37:45 2009
New Revision: 198950

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=198950
Log:
missed a few places BRI needed to handled in sig_pri

Modified:
    team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c
    team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.c

Modified: team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c?view=diff&rev=198950&r1=198949&r2=198950
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c Wed Jun  3 11:37:45 2009
@@ -4767,7 +4767,7 @@
 
 	idx = dahdi_get_index(ast, p, 1);
 
-	if (p->sig == SIG_PRI) {
+	if (p->sig == SIG_PRI || p->sig == SIG_BRI || p->sig == SIG_BRI_PTMP) {
 		x = 1;
 		ast_channel_setoption(ast,AST_OPTION_AUDIO_MODE,&x,sizeof(char),0);
 		dahdi_confmute(p, 0);
@@ -4789,7 +4789,7 @@
 		goto hangup_out;
 	}
 
-	if ((p->sig == SIG_SS7) || (p->sig == SIG_BRI) || (p->sig == SIG_BRI_PTMP)) {
+	if (p->sig == SIG_SS7) {
 		x = 1;
 		ast_channel_setoption(ast,AST_OPTION_AUDIO_MODE,&x,sizeof(char),0);
 	}
@@ -10399,9 +10399,7 @@
 						destroy_dahdi_pvt(&tmp);
 						return NULL;
 					}
-					if ((chan_sig == SIG_PRI) ||
-							(chan_sig == SIG_BRI) ||
-							(chan_sig == SIG_BRI_PTMP))
+					if ((chan_sig == SIG_PRI) || (chan_sig == SIG_BRI) || (chan_sig == SIG_BRI_PTMP))
 						myswitchtype = conf->pri.pri.switchtype;
 					else
 						myswitchtype = PRI_SWITCH_GR303_TMC;
@@ -12257,22 +12255,6 @@
 			ast_log(LOG_ERROR, "Unable to set appropriate buffering on channel %d: %s\n", x, strerror(errno));
 			dahdi_close_pri_fd(pri, i);
 			return -1;
-		}
-		switch (pri->pri.sig) {
-		case SIG_BRI:
-			pri->pri.dchans[i] = pri_new_bri(pri->pri.fds[i], 1, pri->pri.nodetype, pri->pri.switchtype);
-			break;
-		case SIG_BRI_PTMP:
-			pri->pri.dchans[i] = pri_new_bri(pri->pri.fds[i], 0, pri->pri.nodetype, pri->pri.switchtype);
-			break;
-		default:
-			pri->pri.dchans[i] = pri_new(pri->pri.fds[i], pri->pri.nodetype, pri->pri.switchtype);
-#ifdef HAVE_PRI_SERVICE_MESSAGES
-				if (pri->pri.enable_service_message_support) {
-					pri_set_service_message_support(pri->pri.dchans[i], 1);
-				}
-#endif
-			break;
 		}
 		pri->pri.dchan_logical_span[i] = pris[p.spanno - 1].prilogicalspan;
 	}

Modified: team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.c?view=diff&rev=198950&r1=198949&r2=198950
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.c (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.c Wed Jun  3 11:37:45 2009
@@ -1774,7 +1774,6 @@
 		goto exit;
 	}
 
-	
 	/* Make sure we have a call (or REALLY have a call in the case of a PRI) */
 	if (!pri_grab(p, p->pri)) {
 		if (p->alreadyhungup) {
@@ -1806,6 +1805,7 @@
 			ast_log(LOG_WARNING, "pri_disconnect failed\n");
 		pri_rel(p->pri);			
 	} else {
+		ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->pri->span);
 		res = -1;
 	}
 
@@ -2331,7 +2331,22 @@
 			break;
 		}
 
-		pri->dchans[i] = pri_new(pri->fds[i], pri->nodetype, pri->switchtype);
+		switch (pri->sig) {
+		case SIG_BRI:
+			pri->dchans[i] = pri_new_bri(pri->fds[i], 1, pri->nodetype, pri->switchtype);
+			break;
+		case SIG_BRI_PTMP:
+			pri->dchans[i] = pri_new_bri(pri->fds[i], 0, pri->nodetype, pri->switchtype);
+			break;
+		default:
+			pri->dchans[i] = pri_new(pri->fds[i], pri->nodetype, pri->switchtype);
+#ifdef HAVE_PRI_SERVICE_MESSAGES
+				if (pri->enable_service_message_support) {
+					pri_set_service_message_support(pri->dchans[i], 1);
+				}
+#endif
+		}
+
 		/* Force overlap dial if we're doing GR-303! */
 		pri_set_overlapdial(pri->dchans[i], pri->overlapdial);
 		pri_set_inbanddisconnect(pri->dchans[i], pri->inbanddisconnect);




More information about the asterisk-commits mailing list