[asterisk-commits] moy: branch moy/dahdi-tap-1.6.2 r220455 - /team/moy/dahdi-tap-1.6.2/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Sep 24 19:03:48 CDT 2009


Author: moy
Date: Thu Sep 24 19:03:44 2009
New Revision: 220455

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=220455
Log:
fix layer 1 configuration in peer channel

Modified:
    team/moy/dahdi-tap-1.6.2/channels/chan_dahdi.c

Modified: team/moy/dahdi-tap-1.6.2/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/moy/dahdi-tap-1.6.2/channels/chan_dahdi.c?view=diff&rev=220455&r1=220454&r2=220455
==============================================================================
--- team/moy/dahdi-tap-1.6.2/channels/chan_dahdi.c (original)
+++ team/moy/dahdi-tap-1.6.2/channels/chan_dahdi.c Thu Sep 24 19:03:44 2009
@@ -12498,21 +12498,6 @@
 		/* at this point we should know the real b chan that will be used and can therefore proceed to setup the ast channels, but
 		 * only if a couple of call tests are passed */
 
-		/* check that the layer 1 and trans capability are supported 
-		 * we could have saved layer 1 and capability when receiving the PRI_EVENT_RING, but that requires maintaining 
-		 * those values somewhere until the PROCEEDING msg arrives, no point in doing so, better we ask libpri at this
-		 * point the right values since libpri keeps those values anyways. Note that even though PRI_TRANS_CAP_SPEECH
-		 * and AST_TRANS_CAP_SPEECH conveniently have the same value, we don't assume it
-		 * the settings of the call are in the peer call structure because we are the originating side, and therefore
-		 * we did not get a PRI_EVENT_RING event
-		 * */
-		peerpos = pri_find_principle(peerpri, e->proceeding.channel);
-		if (peerpos < 0) {
-			ast_log(LOG_ERROR, "Proceeding requested on odd/unavailable channel number %d/%d on peer span %d\n",
-				PRI_SPAN(e->proceeding.channel), PRI_CHANNEL(e->proceeding.channel), peerpri->span);
-			break;
-		}
-
 		/* check that we already know about this call in the peer PRI (which was the one receiving the PRI_EVENT_RING event) */
 		if (!(pcall = pri_get_crv_pcall(peerpri, pri_get_crv(pri->pri, e->proceeding.call, NULL)))) {
 			ast_log(LOG_ERROR, 
@@ -12523,6 +12508,8 @@
 				pri->span, e->proceeding.cref, peerpri->span);
 			break;
 		}
+
+		/* check that the layer 1 and trans capability are supported */
 		layer1 = pri_get_layer1(peerpri->pri, pcall->callref);
 		transcap = pri_get_transcap(peerpri->pri, pcall->callref);
 
@@ -12596,7 +12583,14 @@
 		ast_log(LOG_DEBUG, "Set owner %s on span %d pos %d\n", c->name, pri->span, chanpos);
 
 		/* now setup the bridged peer, far more easy, no need to set any fields */
-		c = dahdi_new(peerpri->pvts[chanpos], AST_STATE_RINGING, 0, SUB_REAL, DAHDI_LAW_MULAW, AST_TRANS_CAP_SPEECH);
+		peerpos = pri_find_principle(peerpri, e->proceeding.channel);
+		if (peerpos < 0) {
+			ast_log(LOG_ERROR, "Proceeding requested on odd/unavailable channel number %d/%d on peer span %d\n",
+				PRI_SPAN(e->proceeding.channel), PRI_CHANNEL(e->proceeding.channel), peerpri->span);
+			break;
+		}
+
+		c = dahdi_new(peerpri->pvts[chanpos], AST_STATE_RINGING, 0, SUB_REAL, law, AST_TRANS_CAP_SPEECH);
 		if (!c) {
 			ast_log(LOG_ERROR, "Failed to create channel for call on channel %d/%d on peer span %d\n",
 				PRI_SPAN(e->restart.channel), PRI_CHANNEL(e->restart.channel), peerpri->span);




More information about the asterisk-commits mailing list