[asterisk-commits] rmudgett: branch rmudgett/sig_ss7 r261700 - /team/rmudgett/sig_ss7/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 6 13:48:38 CDT 2010


Author: rmudgett
Date: Thu May  6 13:48:34 2010
New Revision: 261700

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=261700
Log:
Sync inservice, locallyblocked, and remotelyblocked status flags.

Modified:
    team/rmudgett/sig_ss7/channels/chan_dahdi.c
    team/rmudgett/sig_ss7/channels/sig_ss7.h

Modified: team/rmudgett/sig_ss7/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/sig_ss7/channels/chan_dahdi.c?view=diff&rev=261700&r1=261699&r2=261700
==============================================================================
--- team/rmudgett/sig_ss7/channels/chan_dahdi.c (original)
+++ team/rmudgett/sig_ss7/channels/chan_dahdi.c Thu May  6 13:48:34 2010
@@ -550,10 +550,34 @@
 		p->calls->set_dialing(p->chan_pvt, is_dialing);
 	}
 }
+
 static void sig_ss7_set_digital(struct sig_ss7_chan *p, int is_digital)
 {
 	if (p->calls->set_digital) {
 		p->calls->set_digital(p->chan_pvt, is_digital);
+	}
+}
+
+static void sig_ss7_set_inservice(struct sig_ss7_chan *p, int is_inservice)
+{
+	if (p->calls->set_inservice) {
+		p->calls->set_inservice(p->chan_pvt, is_inservice);
+	}
+}
+
+static void sig_ss7_set_locallyblocked(struct sig_ss7_chan *p, int is_blocked)
+{
+	p->locallyblocked = is_blocked;
+	if (p->calls->set_locallyblocked) {
+		p->calls->set_locallyblocked(p->chan_pvt, is_blocked);
+	}
+}
+
+static void sig_ss7_set_remotelyblocked(struct sig_ss7_chan *p, int is_blocked)
+{
+	p->remotelyblocked = is_blocked;
+	if (p->calls->set_remotelyblocked) {
+		p->calls->set_remotelyblocked(p->chan_pvt, is_blocked);
 	}
 }
 
@@ -2215,6 +2239,33 @@
 }
 #endif	/* defined(HAVE_PRI) || defined(HAVE_SS7) */
 
+#if defined(HAVE_SS7)
+static void my_set_inservice(void *pvt, int is_inservice)
+{
+	struct dahdi_pvt *p = pvt;
+
+	p->inservice = is_inservice;
+}
+#endif	/* defined(HAVE_SS7) */
+
+#if defined(HAVE_SS7)
+static void my_set_locallyblocked(void *pvt, int is_blocked)
+{
+	struct dahdi_pvt *p = pvt;
+
+	p->locallyblocked = is_blocked;
+}
+#endif	/* defined(HAVE_SS7) */
+
+#if defined(HAVE_SS7)
+static void my_set_remotelyblocked(void *pvt, int is_blocked)
+{
+	struct dahdi_pvt *p = pvt;
+
+	p->remotelyblocked = is_blocked;
+}
+#endif	/* defined(HAVE_SS7) */
+
 static void my_set_ringtimeout(void *pvt, int ringt)
 {
 	struct dahdi_pvt *p = pvt;
@@ -3240,6 +3291,9 @@
 	.set_alarm = my_set_alarm,
 	.set_dialing = my_set_dialing,
 	.set_digital = my_set_digital,
+	.set_inservice = my_set_inservice,
+	.set_locallyblocked = my_set_locallyblocked,
+	.set_remotelyblocked = my_set_remotelyblocked,
 	.set_callerid = my_set_callerid,
 	.set_dnid = my_set_dnid,
 	.set_rdnis = my_set_rdnis,
@@ -12215,11 +12269,12 @@
 		ast_cc_copy_config_params(tmp->cc_params, conf->chan.cc_params);
 
 		if (!here) {
-			tmp->locallyblocked = tmp->remotelyblocked = 0;
+			tmp->locallyblocked = 0;
+			tmp->remotelyblocked = 0;
 			switch (tmp->sig) {
 #if defined(HAVE_PRI)
 			case SIG_PRI_LIB_HANDLE_CASES:
-				tmp->inservice = 0;
+				tmp->inservice = 1;/* Inservice until actually implemented. */
 #if defined(HAVE_PRI_SERVICE_MESSAGES)
 				((struct sig_pri_chan *) tmp->sig_pvt)->service_status = 0;
 				if (chan_sig == SIG_PRI) {
@@ -12290,10 +12345,8 @@
 /* BUGBUG check that all fields that need initialization are initialized */
 /* BUGBUG check that all fields that need synchronization between upper and submodule are synced with callbacks. */
 				ss7_chan->inalarm = tmp->inalarm;
-/* BUGBUG the following three flags need callbacks for syncing with the upper layer. */
 				ss7_chan->locallyblocked = tmp->locallyblocked;
 				ss7_chan->remotelyblocked = tmp->remotelyblocked;
-				ss7_chan->inservice = tmp->inservice;
 
 				ss7_chan->stripmsd = tmp->stripmsd;
 				ss7_chan->hidecallerid = tmp->hidecallerid;
@@ -13119,9 +13172,9 @@
 		if (linkset->pvts[i] && (linkset->pvts[i]->dpc == dpc && ((linkset->pvts[i]->cic >= startcic) && (linkset->pvts[i]->cic <= endcic)))) {
 			if (state) {
 				if (state[i])
-					linkset->pvts[i]->remotelyblocked = block;
+					sig_ss7_set_remotelyblocked(linkset->pvts[i], block);
 			} else
-				linkset->pvts[i]->remotelyblocked = block;
+				sig_ss7_set_remotelyblocked(linkset->pvts[i], block);
 		}
 	}
 }
@@ -13134,7 +13187,7 @@
 
 	for (i = 0; i < linkset->numchans; i++) {
 		if (linkset->pvts[i] && (linkset->pvts[i]->dpc == dpc && ((linkset->pvts[i]->cic >= startcic) && (linkset->pvts[i]->cic <= endcic))))
-			linkset->pvts[i]->inservice = 1;
+			sig_ss7_set_inservice(linkset->pvts[i], 1);
 	}
 }
 #endif	/* defined(HAVE_SS7) */
@@ -13493,8 +13546,8 @@
 				}
 				p = linkset->pvts[chanpos];
 				sig_ss7_lock_private(p);
-				p->inservice = 1;
-				p->remotelyblocked = 0;
+				sig_ss7_set_inservice(p, 1);
+				sig_ss7_set_remotelyblocked(p, 0);
 				dpc = p->dpc;
 				isup_set_call_dpc(e->rsc.call, dpc);
 				if (p->ss7call)
@@ -13746,8 +13799,8 @@
 				p = linkset->pvts[chanpos];
 				ast_debug(1, "Unequiped Circuit Id Code on CIC %d\n", e->ucic.cic);
 				sig_ss7_lock_private(p);
-				p->remotelyblocked = 1;
-				p->inservice = 0;
+				sig_ss7_set_remotelyblocked(p, 1);
+				sig_ss7_set_inservice(p, 0);
 				sig_ss7_unlock_private(p);/* doesn't require a SS7 acknowledgement */
 				break;
 			case ISUP_EVENT_BLO:
@@ -13759,7 +13812,7 @@
 				p = linkset->pvts[chanpos];
 				ast_debug(1, "Blocking CIC %d\n", e->blo.cic);
 				sig_ss7_lock_private(p);
-				p->remotelyblocked = 1;
+				sig_ss7_set_remotelyblocked(p, 1);
 				sig_ss7_unlock_private(p);
 				isup_bla(linkset->ss7, e->blo.cic, p->dpc);
 				break;
@@ -13772,7 +13825,7 @@
 				ast_debug(1, "Blocking CIC %d\n", e->bla.cic);
 				p = linkset->pvts[chanpos];
 				sig_ss7_lock_private(p);
-				p->locallyblocked = 1;
+				sig_ss7_set_locallyblocked(p, 1);
 				sig_ss7_unlock_private(p);
 				break;
 			case ISUP_EVENT_UBL:
@@ -13784,7 +13837,7 @@
 				p = linkset->pvts[chanpos];
 				ast_debug(1, "Unblocking CIC %d\n", e->ubl.cic);
 				sig_ss7_lock_private(p);
-				p->remotelyblocked = 0;
+				sig_ss7_set_remotelyblocked(p, 0);
 				sig_ss7_unlock_private(p);
 				isup_uba(linkset->ss7, e->ubl.cic, p->dpc);
 				break;
@@ -13797,7 +13850,7 @@
 				p = linkset->pvts[chanpos];
 				ast_debug(1, "Unblocking CIC %d\n", e->uba.cic);
 				sig_ss7_lock_private(p);
-				p->locallyblocked = 0;
+				sig_ss7_set_locallyblocked(p, 0);
 				sig_ss7_unlock_private(p);
 				break;
 			case ISUP_EVENT_CON:

Modified: team/rmudgett/sig_ss7/channels/sig_ss7.h
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/sig_ss7/channels/sig_ss7.h?view=diff&rev=261700&r1=261699&r2=261700
==============================================================================
--- team/rmudgett/sig_ss7/channels/sig_ss7.h (original)
+++ team/rmudgett/sig_ss7/channels/sig_ss7.h Thu May  6 13:48:34 2010
@@ -100,6 +100,9 @@
 	void (* const set_alarm)(void *pvt, int in_alarm);
 	void (* const set_dialing)(void *pvt, int is_dialing);
 	void (* const set_digital)(void *pvt, int is_digital);
+	void (* const set_inservice)(void *pvt, int is_inservice);
+	void (* const set_locallyblocked)(void *pvt, int is_blocked);
+	void (* const set_remotelyblocked)(void *pvt, int is_blocked);
 	void (* const set_callerid)(void *pvt, const struct ast_party_caller *caller);
 	void (* const set_dnid)(void *pvt, const char *dnid);
 	void (* const set_rdnis)(void *pvt, const char *rdnis);
@@ -171,11 +174,6 @@
 	unsigned int dpc;						/*!< CIC's DPC */
 	int channel;					/*!< Channel Number */
 
-	/*!
-	 * \brief TRUE if channel is out of reset and ready
-	 * \note Set but not used.
-	 */
-	unsigned int inservice:1;
 	/*! \brief TRUE if the channel is locally blocked. */
 	unsigned int locallyblocked:1;
 	/*! \brief TRUE if the channel is remotely blocked. */




More information about the asterisk-commits mailing list