[asterisk-commits] kpfleming: trunk r90880 - /trunk/channels/chan_zap.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 4 11:40:29 CST 2007


Author: kpfleming
Date: Tue Dec  4 11:40:29 2007
New Revision: 90880

URL: http://svn.digium.com/view/asterisk?view=rev&rev=90880
Log:
fix build of this module when libpri and/or libss7 are or are not present

Modified:
    trunk/channels/chan_zap.c

Modified: trunk/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_zap.c?view=diff&rev=90880&r1=90879&r2=90880
==============================================================================
--- trunk/channels/chan_zap.c (original)
+++ trunk/channels/chan_zap.c Tue Dec  4 11:40:29 2007
@@ -5800,7 +5800,10 @@
 	tmp->cid.cid_pres = i->callingpres;
 	tmp->cid.cid_ton = i->cid_ton;
 	tmp->cid.cid_ani2 = i->cid_ani2;
-#if defined(HAVE_PRI) || defined(HAVE_SS7)
+/* TODO: enable this code for HAVE_SS7 when PRI_TRANS_CAP_DIGITAL gets renamed
+   and doesn't come from libpri.h any longer
+*/
+#if defined(HAVE_PRI)
 	tmp->transfercapability = transfercapability;
 	pbx_builtin_setvar_helper(tmp, "TRANSFERCAPABILITY", ast_transfercapability2str(transfercapability));
 	if (transfercapability & PRI_TRANS_CAP_DIGITAL)
@@ -8560,8 +8563,14 @@
 	return tmp;
 }
 
+#if defined(HAVE_PRI) || defined(HAVE_SS7)
+static int zt_setlaw(int zfd, int law)
+{
+	return ioctl(zfd, ZT_SETLAW, &law);
+}
+#endif
+
 #ifdef HAVE_SS7
-static int zt_setlaw(int zfd, int law);
 
 static int ss7_find_cic(struct zt_ss7 *linkset, int cic)
 {
@@ -9578,14 +9587,6 @@
 	}
 }
 
-static int zt_setlaw(int zfd, int law)
-{
-	int res;
-	res = ioctl(zfd, ZT_SETLAW, &law);
-	if (res)
-		return res;
-	return 0;
-}
 
 static void *pri_dchannel(void *vpri)
 {
@@ -11778,9 +11779,11 @@
 {
 	int x;
 	struct zt_pvt *p, *pl;
-
-#ifdef HAVE_PRI
+#if defined(HAVE_PRI) || defined(HAVE_SS7)
 	int i;
+#endif
+
+#if defined(HAVE_PRI)
 	for (i = 0; i < NUM_SPANS; i++) {
 		if (pris[i].master != AST_PTHREADT_NULL) 
 			pthread_cancel(pris[i].master);
@@ -11788,6 +11791,7 @@
 	ast_cli_unregister_multiple(zap_pri_cli, sizeof(zap_pri_cli) / sizeof(struct ast_cli_entry));
 	ast_unregister_application(zap_send_keypad_facility_app);
 #endif
+
 	ast_cli_unregister_multiple(zap_cli, sizeof(zap_cli) / sizeof(struct ast_cli_entry));
 	ast_manager_unregister( "ZapDialOffhook" );
 	ast_manager_unregister( "ZapHangup" );
@@ -11836,20 +11840,23 @@
 	iflist = NULL;
 	ifcount = 0;
 	ast_mutex_unlock(&iflock);
-#ifdef HAVE_PRI		
+
+#if defined(HAVE_PRI)
 	for (i = 0; i < NUM_SPANS; i++) {
 		if (pris[i].master && (pris[i].master != AST_PTHREADT_NULL))
 			pthread_join(pris[i].master, NULL);
 		zt_close(pris[i].fds[i]);
 	}
-#endif
-#ifdef HAVE_SS7
+#endif /* HAVE_PRI */
+
+#if defined(HAVE_SS7)
 	for (i = 0; i < NUM_SPANS; i++) {
 		if (linksets[i].master && (linksets[i].master != AST_PTHREADT_NULL))
 			pthread_join(linksets[i].master, NULL);
 		zt_close(linksets[i].fds[i]);
 	}
 #endif /* HAVE_SS7 */
+
 	return 0;
 }
 




More information about the asterisk-commits mailing list