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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 24 18:07:55 CDT 2009


Author: jpeeler
Date: Wed Jun 24 18:07:51 2009
New Revision: 203106

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=203106
Log:
fix trunkgroup functionality to behave as expected with NFAS

Modified:
    team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.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=203106&r1=203105&r2=203106
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c Wed Jun 24 18:07:51 2009
@@ -571,7 +571,6 @@
 
 struct dahdi_pri {
 	int dchannels[NUM_DCHANS];					/*!< What channel are the dchannels on */
-	int trunkgroup;							/*!< What our trunkgroup is */
 	int mastertrunkgroup;						/*!< What trunk group is our master */
 	int prilogicalspan;						/*!< Logical span number within trunk group */
 	struct sig_pri_pri pri;
@@ -2270,12 +2269,14 @@
 {
 	struct dahdi_pvt *old = old_chan;
 	struct dahdi_pvt *new = new_chan;
+	struct sig_pri_chan *pchan = new->sig_pvt;
+	struct sig_pri_pri *pri = pchan->pri;
 
 	new->owner = old->owner;
 	old->owner = NULL;
 	if (new->owner) {
 		char newname[AST_CHANNEL_NAME];
-		snprintf(newname, sizeof(newname), "DAHDI/%d-%d", new->channel, 1);
+		snprintf(newname, sizeof(newname), "DAHDI/%d:%d-%d", pri->trunkgroup, new->channel, 1);
 		ast_change_name(new->owner, newname);
 
 		new->owner->tech_pvt = new;
@@ -9916,7 +9917,7 @@
 	if (trunkgroup) {
 		/* Select a specific trunk group */
 		for (x = 0; x < NUM_SPANS; x++) {
-			if (pris[x].trunkgroup == trunkgroup) {
+			if (pris[x].pri.trunkgroup == trunkgroup) {
 				*span = x;
 				return 0;
 			}
@@ -9924,8 +9925,8 @@
 		ast_log(LOG_WARNING, "Channel %d on span %d configured to use nonexistent trunk group %d\n", channel, *span, trunkgroup);
 		*span = -1;
 	} else {
-		if (pris[*span].trunkgroup) {
-			ast_log(LOG_WARNING, "Unable to use span %d implicitly since it is trunk group %d (please use spanmap)\n", *span, pris[*span].trunkgroup);
+		if (pris[*span].pri.trunkgroup) {
+			ast_log(LOG_WARNING, "Unable to use span %d implicitly since it is trunk group %d (please use spanmap)\n", *span, pris[*span].pri.trunkgroup);
 			*span = -1;
 		} else if (pris[*span].mastertrunkgroup) {
 			ast_log(LOG_WARNING, "Unable to use span %d implicitly since it is already part of trunk group %d\n", *span, pris[*span].mastertrunkgroup);
@@ -9994,7 +9995,7 @@
 		}
 		span = p.spanno - 1;
 		if (pris[span].pri.trunkgroup) {
-			ast_log(LOG_WARNING, "Span %d is already provisioned for trunk group %d\n", span + 1, pris[span].trunkgroup);
+			ast_log(LOG_WARNING, "Span %d is already provisioned for trunk group %d\n", span + 1, pris[span].pri.trunkgroup);
 			close(fd);
 			return -1;
 		}
@@ -12213,7 +12214,6 @@
 	struct dahdi_bufferinfo bi;
 	struct dahdi_spaninfo si;
 
-	pri->pri.trunkgroup = pri->trunkgroup;
 	pri->pri.calls = &dahdi_pri_callbacks;
 
 	for (i = 0; i < NUM_DCHANS; i++) {




More information about the asterisk-commits mailing list