[asterisk-commits] mattf: branch mattf/asterisk-ss7 r41104 - /team/mattf/asterisk-ss7/channels/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Aug 25 10:56:19 MST 2006


Author: mattf
Date: Fri Aug 25 12:56:19 2006
New Revision: 41104

URL: http://svn.digium.com/view/asterisk?rev=41104&view=rev
Log:
Do blocking and unblocking properly of circuits.

Modified:
    team/mattf/asterisk-ss7/channels/chan_zap.c

Modified: team/mattf/asterisk-ss7/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/mattf/asterisk-ss7/channels/chan_zap.c?rev=41104&r1=41103&r2=41104&view=diff
==============================================================================
--- team/mattf/asterisk-ss7/channels/chan_zap.c (original)
+++ team/mattf/asterisk-ss7/channels/chan_zap.c Fri Aug 25 12:56:19 2006
@@ -8019,13 +8019,15 @@
 	return winner;
 }
 
-static void ss7_block_cics(struct zt_ss7 *linkset, int startcic, int endcic, int block)
+static void ss7_block_cics(struct zt_ss7 *linkset, int startcic, int endcic, unsigned char state[], int block)
 {
 	int i;
 
 	for (i = 0; i < linkset->numchans; i++) {
-		if (linkset->pvts[i] && ((linkset->pvts[i]->cic >= startcic) && (linkset->pvts[i]->cic <= endcic)))
-			linkset->pvts[i]->blocked = block;
+		if (linkset->pvts[i] && ((linkset->pvts[i]->cic >= startcic) && (linkset->pvts[i]->cic <= endcic))) {
+			if (state[i])
+				linkset->pvts[i]->blocked = block;
+		}
 	}
 }
 
@@ -8193,6 +8195,7 @@
 				break;
 			case ISUP_EVENT_GRA:
 				ast_log(LOG_DEBUG, "Got GRA from CIC %d to %d.\n", e->gra.startcic, e->gra.endcic);
+				ss7_block_cics(linkset, e->gra.startcic, e->gra.endcic, e->gra.status, 1);
 				break;
 			case ISUP_EVENT_IAM:
 				ast_log(LOG_DEBUG, "Got IAM for CIC %d and number %s\n", e->iam.cic, e->iam.called_party_num);
@@ -8308,12 +8311,12 @@
 				}
 				break;
 			case ISUP_EVENT_CGB:
-				ss7_block_cics(linkset, e->cgb.startcic, e->cgb.endcic, 1);
-				isup_cgba(linkset->ss7, e->cgb.startcic, e->cgb.endcic);
+				ss7_block_cics(linkset, e->cgb.startcic, e->cgb.endcic, e->cgb.status, 1);
+				isup_cgba(linkset->ss7, e->cgb.startcic, e->cgb.endcic, e->cgb.status);
 				break;
 			case ISUP_EVENT_CGU:
-				ss7_block_cics(linkset, e->cgu.startcic, e->cgu.endcic, 0);
-				isup_cgua(linkset->ss7, e->cgu.startcic, e->cgu.endcic);
+				ss7_block_cics(linkset, e->cgu.startcic, e->cgu.endcic, e->cgb.status, 0);
+				isup_cgua(linkset->ss7, e->cgu.startcic, e->cgu.endcic, e->cgb.status);
 				break;
 			case ISUP_EVENT_BLO:
 				chanpos = ss7_find_cic(linkset, e->blo.cic);
@@ -10378,6 +10381,7 @@
 #ifdef HAVE_SS7
 			if (tmp->ss7) {
 				ast_cli(fd, "CIC: %d\n", tmp->cic);
+				ast_cli(fd, "Blocked: %s\n", tmp->blocked ? "yes" : "no");
 			}
 #endif
 #ifdef HAVE_PRI



More information about the asterisk-commits mailing list