[asterisk-commits] seanbright: trunk r204919 - in /trunk: ./ channels/ include/asterisk/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jul 3 10:44:08 CDT 2009


Author: seanbright
Date: Fri Jul  3 10:44:01 2009
New Revision: 204919

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=204919
Log:
Add a configure check for Reverse Charging Indication support in LibPRI.

Also go back and wrap all of the places that use the specific reverse charge
APIs with preprocessor conditionals.

Modified:
    trunk/channels/chan_dahdi.c
    trunk/channels/sig_pri.c
    trunk/channels/sig_pri.h
    trunk/configure
    trunk/configure.ac
    trunk/include/asterisk/autoconfig.h.in

Modified: trunk/channels/chan_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=204919&r1=204918&r2=204919
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Fri Jul  3 10:44:01 2009
@@ -5412,7 +5412,7 @@
 		ast_mutex_lock(&p->lock);
 		snprintf(buf, len, "%f", p->txgain);
 		ast_mutex_unlock(&p->lock);
-#ifdef HAVE_PRI
+#if defined(HAVE_PRI_REVERSE_CHARGE)
 	} else if (!strcasecmp(data, "reversecharge")) {
 		ast_mutex_lock(&p->lock);
 		if (p->sig == SIG_PRI || p->sig == SIG_BRI || p->sig == SIG_BRI_PTMP) {

Modified: trunk/channels/sig_pri.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/sig_pri.c?view=diff&rev=204919&r1=204918&r2=204919
==============================================================================
--- trunk/channels/sig_pri.c (original)
+++ trunk/channels/sig_pri.c Fri Jul  3 10:44:01 2009
@@ -1163,7 +1163,9 @@
 							pbx_builtin_setvar_helper(c, "CALLEDTON", calledtonstr);
 							if (e->ring.redirectingreason >= 0)
 								pbx_builtin_setvar_helper(c, "PRIREDIRECTREASON", redirectingreason2str(e->ring.redirectingreason));
+#if defined(HAVE_PRI_REVERSE_CHARGE)
 							pri->pvts[chanpos]->reverse_charging_indication = e->ring.reversecharge;
+#endif
 
 							sig_pri_lock_private(pri->pvts[chanpos]);
 							ast_mutex_lock(&pri->lock);
@@ -1209,7 +1211,9 @@
 
 								if (e->ring.redirectingreason >= 0)
 									pbx_builtin_setvar_helper(c, "PRIREDIRECTREASON", redirectingreason2str(e->ring.redirectingreason));
+#if defined(HAVE_PRI_REVERSE_CHARGE)
 								pri->pvts[chanpos]->reverse_charging_indication = e->ring.reversecharge;
+#endif
 
 								snprintf(calledtonstr, sizeof(calledtonstr)-1, "%d", e->ring.calledplan);
 								pbx_builtin_setvar_helper(c, "CALLEDTON", calledtonstr);
@@ -1890,7 +1894,7 @@
 		case 'r':
 			pridialplan = PRI_NPI_RESERVED | (pridialplan & 0xf0);
 			break;
-#if defined(PRI_REVERSECHARGE_REQUESTED)
+#if defined(HAVE_PRI_REVERSE_CHARGE)
 		case 'C':
 			pri_sr_set_reversecharge(sr, PRI_REVERSECHARGE_REQUESTED);
 			break;

Modified: trunk/channels/sig_pri.h
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/sig_pri.h?view=diff&rev=204919&r1=204918&r2=204919
==============================================================================
--- trunk/channels/sig_pri.h (original)
+++ trunk/channels/sig_pri.h Fri Jul  3 10:44:01 2009
@@ -162,7 +162,9 @@
 	struct sig_pri_callback *calls;
 	void *chan_pvt;
 	ast_mutex_t service_lock;						/*!< Mutex for service messages */
+#if defined(HAVE_PRI_REVERSE_CHARGE)
 	int reverse_charging_indication;
+#endif
 };
 
 struct sig_pri_pri {

Modified: trunk/configure.ac
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/configure.ac?view=diff&rev=204919&r1=204918&r2=204919
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Fri Jul  3 10:44:01 2009
@@ -1441,6 +1441,8 @@
 
 AST_EXT_LIB_CHECK([PRI_SERVICE_MESSAGES], [pri], [pri_maintenance_service], [libpri.h])
 
+AST_EXT_LIB_CHECK([PRI_REVERSE_CHARGE], [pri], [pri_sr_set_reversecharge], [libpri.h])
+
 AST_EXT_LIB_CHECK([RESAMPLE], [resample], [resample_open], [libresample.h], [-lm])
 
 AST_C_COMPILE_CHECK([SPANDSP], [

Modified: trunk/include/asterisk/autoconfig.h.in
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/include/asterisk/autoconfig.h.in?view=diff&rev=204919&r1=204918&r2=204919
==============================================================================
--- trunk/include/asterisk/autoconfig.h.in (original)
+++ trunk/include/asterisk/autoconfig.h.in Fri Jul  3 10:44:01 2009
@@ -706,6 +706,12 @@
 
 /* Define to indicate the ${PRI_PROG_W_CAUSE_DESCRIP} library version */
 #undef HAVE_PRI_PROG_W_CAUSE_VERSION
+
+/* Define this to indicate the ${PRI_REVERSE_CHARGE_DESCRIP} library */
+#undef HAVE_PRI_REVERSE_CHARGE
+
+/* Define to indicate the ${PRI_REVERSE_CHARGE_DESCRIP} library version */
+#undef HAVE_PRI_REVERSE_CHARGE_VERSION
 
 /* Define this to indicate the ${PRI_SERVICE_MESSAGES_DESCRIP} library */
 #undef HAVE_PRI_SERVICE_MESSAGES




More information about the asterisk-commits mailing list