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

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Aug 22 08:40:10 MST 2006


Author: mattf
Date: Tue Aug 22 10:40:09 2006
New Revision: 40836

URL: http://svn.digium.com/view/asterisk?rev=40836&view=rev
Log:
Add support for blocking and unblocking for single 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=40836&r1=40835&r2=40836&view=diff
==============================================================================
--- team/mattf/asterisk-ss7/channels/chan_zap.c (original)
+++ team/mattf/asterisk-ss7/channels/chan_zap.c Tue Aug 22 10:40:09 2006
@@ -635,6 +635,9 @@
 	unsigned int progress:1;
 	unsigned int resetting:1;
 	unsigned int setup_ack:1;
+#endif
+#if defined(HAVE_SS7)
+	unsigned int blocked:1;
 #endif
 	unsigned int use_smdi:1;		/* Whether to use SMDI on this channel */
 	struct ast_smdi_interface *smdi_iface;	/* The serial port to listen for SMDI data on */
@@ -7648,7 +7651,7 @@
 #ifdef HAVE_SS7
 		/* Trust PRI */
 		if (p->ss7) {
-			if (p->ss7call)
+			if (p->ss7call || p->blocked)
 				return 0;
 			else
 				return 1;
@@ -8293,6 +8296,32 @@
 
 					ast_mutex_unlock(&p->lock);
 				}
+				break;
+			case ISUP_EVENT_BLO:
+				chanpos = ss7_find_cic(linkset, e->blo.cic);
+				if (chanpos < 0) {
+					ast_log(LOG_WARNING, "BLO on unconfigured CIC %d\n", e->blo.cic);
+					break;
+				}
+				p = linkset->pvts[chanpos];
+				ast_log(LOG_DEBUG, "Blocking CIC %d\n", e->blo.cic);
+				ast_mutex_lock(&p->lock);
+				p->blocked = 1;
+				ast_mutex_unlock(&p->lock);
+				isup_bla(linkset->ss7, e->blo.cic);
+				break;
+			case ISUP_EVENT_UBL:
+				chanpos = ss7_find_cic(linkset, e->ubl.cic);
+				if (chanpos < 0) {
+					ast_log(LOG_WARNING, "UBL on unconfigured CIC %d\n", e->ubl.cic);
+					break;
+				}
+				p = linkset->pvts[chanpos];
+				ast_log(LOG_DEBUG, "Unblocking CIC %d\n", e->ubl.cic);
+				ast_mutex_lock(&p->lock);
+				p->blocked = 0;
+				ast_mutex_unlock(&p->lock);
+				isup_uba(linkset->ss7, e->ubl.cic);
 				break;
 			case ISUP_EVENT_CON:
 			case ISUP_EVENT_ANM:



More information about the asterisk-commits mailing list