[asterisk-commits] rmudgett: branch rmudgett/ss7_27_knk r372047 - in /team/rmudgett/ss7_27_knk: ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 30 12:35:39 CDT 2012


Author: rmudgett
Date: Thu Aug 30 12:35:34 2012
New Revision: 372047

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=372047
Log:
Reviewboard 1676 diff 13 plus my changes.

Modified:
    team/rmudgett/ss7_27_knk/channels/chan_dahdi.c
    team/rmudgett/ss7_27_knk/channels/sig_ss7.c
    team/rmudgett/ss7_27_knk/configs/ss7.timers.sample
    team/rmudgett/ss7_27_knk/configure.ac

Modified: team/rmudgett/ss7_27_knk/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/ss7_27_knk/channels/chan_dahdi.c?view=diff&rev=372047&r1=372046&r2=372047
==============================================================================
--- team/rmudgett/ss7_27_knk/channels/chan_dahdi.c (original)
+++ team/rmudgett/ss7_27_knk/channels/chan_dahdi.c Thu Aug 30 12:35:34 2012
@@ -13236,12 +13236,12 @@
 		tmp->named_pickupgroups = ast_ref_namedgroups(conf->chan.named_pickupgroups);
 		if (conf->chan.vars) {
 			struct ast_variable *v, *tmpvar;
-	                for (v = conf->chan.vars ; v ; v = v->next) {
-        	                if ((tmpvar = ast_variable_new(v->name, v->value, v->file))) {
-                	                tmpvar->next = tmp->vars;
-                        	        tmp->vars = tmpvar;
-                        	}
-                	}
+			for (v = conf->chan.vars ; v ; v = v->next) {
+				if ((tmpvar = ast_variable_new(v->name, v->value, v->file))) {
+					tmpvar->next = tmp->vars;
+					tmp->vars = tmpvar;
+				}
+			}
 		}
 		tmp->cid_rxgain = conf->chan.cid_rxgain;
 		tmp->rxgain = conf->chan.rxgain;
@@ -16709,17 +16709,21 @@
 #endif	/* defined(HAVE_SS7) */
 
 #if defined(HAVE_SS7)
-static char *handle_ss7_linkset_blocking(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *handle_ss7_linkset_mng(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	int linkset, i;
-	int do_block = 0;
+	enum {
+		DO_BLOCK,
+		DO_UNBLOCK,
+		DO_RESET,
+	} do_what;
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "ss7 {block|unblock} linkset";
+		e->command = "ss7 {reset|block|unblock} linkset";
 		e->usage =
-			"Usage: ss7 {block|unblock} linkset <linkset number>\n"
-			"       Sends a remote {blocking|unblocking} request for all CICs on the given linkset\n";
+			"Usage: ss7 {reset|block|unblock} linkset <linkset number>\n"
+			"       Sends a remote {reset|blocking|unblocking} request for all CICs on the given linkset\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
@@ -16732,8 +16736,12 @@
 	}
 
 	if (!strcasecmp(a->argv[1], "block")) {
-		do_block = 1;
-	} else if (strcasecmp(a->argv[1], "unblock")) {
+		do_what = DO_BLOCK;
+	} else if (!strcasecmp(a->argv[1], "unblock")) {
+		do_what = DO_UNBLOCK;
+	} else if (!strcasecmp(a->argv[1], "reset")) {
+		do_what = DO_RESET;
+	} else {
 		return CLI_SHOWUSAGE;
 	}
 
@@ -16742,15 +16750,32 @@
 		return CLI_SUCCESS;
 	}
 
-	if (!linksets[linkset-1].ss7.ss7) {
+	if (!linksets[linkset - 1].ss7.ss7) {
 		ast_cli(a->fd, "No SS7 running on linkset %d\n", linkset);
 		return CLI_SUCCESS;
 	}
 
-	for (i = 0; i < linksets[linkset-1].ss7.numchans; i++) {
-		/* XXX Should be done with GRS instead - see ss7_reset_linkset() */
-		if (linksets[linkset-1].ss7.pvts[i] && !sig_ss7_cic_blocking(&linksets[linkset-1].ss7, do_block, i)) {
-			ast_cli(a->fd, "Sent remote %sblocking request on CIC %d\n", do_block ? "" : "un", linksets[linkset-1].ss7.pvts[i]->cic);
+	for (i = 0; i < linksets[linkset - 1].ss7.numchans; i++) {
+		/* XXX Should be done with GRS/CGB/CGU instead - see ss7_reset_linkset() */
+		if (linksets[linkset - 1].ss7.pvts[i]) {
+			switch (do_what) {
+			case DO_BLOCK:
+			case DO_UNBLOCK:
+				if (sig_ss7_cic_blocking(&linksets[linkset - 1].ss7, do_what == DO_BLOCK, i)) {
+					ast_cli(a->fd, "Sent remote %s request on CIC %d\n",
+						(do_what == DO_BLOCK) ? "blocking" : "unblocking",
+						linksets[linkset - 1].ss7.pvts[i]->cic);
+				}
+				break;
+			case DO_RESET:
+				if (sig_ss7_reset_cic(&linksets[linkset - 1].ss7,
+					linksets[linkset - 1].ss7.pvts[i]->cic,
+					linksets[linkset - 1].ss7.pvts[i]->dpc)) {
+					ast_cli(a->fd, "Sent reset request on CIC %d\n",
+						linksets[linkset - 1].ss7.pvts[i]->cic);
+				}
+				break;
+			}
 		}
 	}
 
@@ -16839,7 +16864,7 @@
 
 	/* We are guaranteed to find chanpos because of sig_ss7_find_cic_range() includes it. */
 	chanpos = sig_ss7_find_cic(&linksets[linkset-1].ss7, cic, dpc);
-	if (sig_ss7_group_blocking(&linksets[linkset-1].ss7, do_block, chanpos, cic + range - 1, state, orient)) {
+	if (sig_ss7_group_blocking(&linksets[linkset-1].ss7, do_block, chanpos, cic + range, state, orient)) {
 		ast_cli(a->fd, "Unable allocate new ss7call\n");
 	} else {
 		ast_cli(a->fd, "Sending remote%s %sblocking request linkset %d on CIC %d range %d\n",
@@ -17330,7 +17355,7 @@
 static struct ast_cli_entry dahdi_ss7_cli[] = {
 	AST_CLI_DEFINE(handle_ss7_debug, "Enables SS7 debugging on a linkset"),
 	AST_CLI_DEFINE(handle_ss7_cic_blocking, "Blocks/Unblocks the given CIC"),
-	AST_CLI_DEFINE(handle_ss7_linkset_blocking, "Blocks/Unblocks all CICs on a linkset"),
+	AST_CLI_DEFINE(handle_ss7_linkset_mng, "Resets/Blocks/Unblocks all CICs on a linkset"),
 	AST_CLI_DEFINE(handle_ss7_group_blocking, "Blocks/Unblocks the given CIC range"),
 	AST_CLI_DEFINE(handle_ss7_reset_cic, "Resets the given CIC"),
 	AST_CLI_DEFINE(handle_ss7_group_reset, "Resets the given CIC range"),

Modified: team/rmudgett/ss7_27_knk/channels/sig_ss7.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/ss7_27_knk/channels/sig_ss7.c?view=diff&rev=372047&r1=372046&r2=372047
==============================================================================
--- team/rmudgett/ss7_27_knk/channels/sig_ss7.c (original)
+++ team/rmudgett/ss7_27_knk/channels/sig_ss7.c Thu Aug 30 12:35:34 2012
@@ -1568,7 +1568,7 @@
 					e->grs.opc)) {
 					ast_log(LOG_WARNING, "GRS on unconfigured range CIC %d - %d PC %d\n",
 						e->grs.startcic, e->grs.endcic, e->grs.opc);
-					chanpos = sig_ss7_find_cic(linkset, e->gra.startcic, e->gra.opc);
+					chanpos = sig_ss7_find_cic(linkset, e->grs.startcic, e->grs.opc);
 					if (chanpos < 0) {
 						isup_free_call(ss7, e->grs.call);
 						break;
@@ -1581,11 +1581,12 @@
 				}
 
 				/* Leave startcic last to collect all cics mb_state */
-				for (i = e->grs.endcic - e->gra.startcic; 0 <= i; --i) {
-					chanpos = sig_ss7_find_cic(linkset, e->gra.startcic + i, e->gra.opc);
-					if (chanpos < 0) {
-						continue;
-					}
+				for (i = e->grs.endcic - e->grs.startcic; 0 <= i; --i) {
+					/*
+					 * We are guaranteed to find chanpos because
+					 * sig_ss7_find_cic_range() includes it.
+					 */
+					chanpos = sig_ss7_find_cic(linkset, e->grs.startcic + i, e->grs.opc);
 					p = linkset->pvts[chanpos];
 					sig_ss7_lock_private(p);
 
@@ -1593,12 +1594,13 @@
 						mb_state[i] = 1;
 					} else {
 						mb_state[i] = 0;
+						sig_ss7_set_locallyblocked(p, 0, SS7_BLOCKED_HARDWARE);
 					}
 
 					sig_ss7_set_remotelyblocked(p, 0, SS7_BLOCKED_MAINTENANCE | SS7_BLOCKED_HARDWARE);
 
 					if (!i) {
-						p->ss7call = e->gra.call;
+						p->ss7call = e->grs.call;
 						isup_gra(ss7, p->ss7call, e->grs.endcic, mb_state);
 					}
 

Modified: team/rmudgett/ss7_27_knk/configs/ss7.timers.sample
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/ss7_27_knk/configs/ss7.timers.sample?view=diff&rev=372047&r1=372046&r2=372047
==============================================================================
--- team/rmudgett/ss7_27_knk/configs/ss7.timers.sample (original)
+++ team/rmudgett/ss7_27_knk/configs/ss7.timers.sample Thu Aug 30 12:35:34 2012
@@ -12,7 +12,6 @@
 mtp3_timer.t5 = 500
 mtp3_timer.t6 = 500
 mtp3_timer.t7 = 1000
-;mtp3_timer.t8 = 800
 
 mtp3_timer.t10 = 60000
 

Modified: team/rmudgett/ss7_27_knk/configure.ac
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/ss7_27_knk/configure.ac?view=diff&rev=372047&r1=372046&r2=372047
==============================================================================
--- team/rmudgett/ss7_27_knk/configure.ac (original)
+++ team/rmudgett/ss7_27_knk/configure.ac Thu Aug 30 12:35:34 2012
@@ -2000,7 +2000,7 @@
 fi
 
 # Check for libss7 v2.0 branch compatible version.
-AST_EXT_LIB_CHECK([SS7], [ss7], [isup_event_iam], [libss7.h])
+AST_EXT_LIB_CHECK([SS7], [ss7], [ss7_set_isup_timer], [libss7.h])
 
 AST_EXT_LIB_CHECK([OPENR2], [openr2], [openr2_chan_new], [openr2.h])
 




More information about the asterisk-commits mailing list