[asterisk-commits] branch group/autoconf_and_menuselect r18488 - /team/group/autoconf_and_menuse...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Apr 8 11:39:26 MST 2006


Author: russell
Date: Sat Apr  8 13:39:25 2006
New Revision: 18488

URL: http://svn.digium.com/view/asterisk?rev=18488&view=rev
Log:
use autoconf magic for libmfcr2

Modified:
    team/group/autoconf_and_menuselect/channels/Makefile
    team/group/autoconf_and_menuselect/channels/chan_zap.c

Modified: team/group/autoconf_and_menuselect/channels/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/channels/Makefile?rev=18488&r1=18487&r2=18488&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/channels/Makefile (original)
+++ team/group/autoconf_and_menuselect/channels/Makefile Sat Apr  8 13:39:25 2006
@@ -77,11 +77,6 @@
 endif
 
 CFLAGS+=-Wno-missing-prototypes -Wno-missing-declarations
-
-ifeq ($(LIBMFCR2),1)
-  CFLAGS+=-DZAPATA_R2
-  ZAPR2=-lmfcr2
-endif
 
 ALSA_SRC=chan_alsa.c
 
@@ -186,7 +181,7 @@
 	$(CC) -c $(CFLAGS) -o chan_zap.o chan_zap.c
 
 chan_zap.so: chan_zap.o
-	$(CC) $(SOLINK) -o $@ $<  $(PRI_LIB) $(ZAPR2) -ltonezone
+	$(CC) $(SOLINK) -o $@ $<  $(PRI_LIB) $(MFCR2_LIB) -ltonezone
 
 chan_sip.so: chan_sip.o
 	$(CC) $(SOLINK) -o $@ ${CYGSOLINK} chan_sip.o ${CYGSOLIB}

Modified: team/group/autoconf_and_menuselect/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/channels/chan_zap.c?rev=18488&r1=18487&r2=18488&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/channels/chan_zap.c (original)
+++ team/group/autoconf_and_menuselect/channels/chan_zap.c Sat Apr  8 13:39:25 2006
@@ -60,9 +60,6 @@
 #include <math.h>
 #include <tonezone.h>
 #include <ctype.h>
-#ifdef ZAPATA_R2
-#include <libmfcr2.h>
-#endif
 
 #include "asterisk.h"
 
@@ -71,6 +68,9 @@
 #ifndef PRI_KEYPAD_FACILITY_TX
 #error "You need newer libpri"
 #endif
+#endif
+#ifdef HAVE_MFCR2
+#include <libmfcr2.h>
 #endif
 
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
@@ -153,7 +153,7 @@
 #ifdef HAVE_LIBPRI
                " w/PRI"
 #endif
-#ifdef ZAPATA_R2
+#ifdef HAVE_MFCR2
                " w/R2"
 #endif
 ;
@@ -162,7 +162,7 @@
 #ifdef HAVE_LIBPRI
                " w/PRI"
 #endif
-#ifdef ZAPATA_R2
+#ifdef HAVE_MFCR2
                " w/R2"
 #endif
 ;
@@ -406,7 +406,7 @@
 struct zt_pvt;
 
 
-#ifdef ZAPATA_R2
+#ifdef HAVE_MFCR2
 static int r2prot = -1;
 #endif
 
@@ -611,7 +611,7 @@
 	unsigned int resetting:1;
 	unsigned int setup_ack:1;
 #endif
-#if defined(ZAPATA_R2)
+#if defined(HAVE_MFCR2)
 	unsigned int hasr2call:1;
 	unsigned int r2blocked:1;
 	unsigned int sigchecked:1;
@@ -701,7 +701,7 @@
 	int prioffset;
 	int logicalspan;
 #endif	
-#ifdef ZAPATA_R2
+#ifdef HAVE_MFCR2
 	int r2prot;
 	mfcr2_t *r2;
 #endif	
@@ -1135,7 +1135,7 @@
 }
 #endif
 
-#ifdef ZAPATA_R2
+#ifdef HAVE_MFCR2
 static int str2r2prot(char *swtype)
 {
 	 if (!strcasecmp(swtype, "ar"))
@@ -2599,7 +2599,7 @@
 			}
 		}
 #endif
-#ifdef ZAPATA_R2
+#ifdef HAVE_MFCR2
 		if (p->sig == SIG_R2) {
 			if (p->hasr2call) {
 				mfcr2_DropCall(p->r2, NULL, UC_NORMAL_CLEARING);
@@ -2788,7 +2788,7 @@
 		}
 		break;
 #endif
-#ifdef ZAPATA_R2
+#ifdef HAVE_MFCR2
 	case SIG_R2:
 		res = mfcr2_AnswerCall(p->r2, NULL);
 		if (res)
@@ -3483,7 +3483,7 @@
 	return 0;
 }
 
-#ifdef ZAPATA_R2
+#ifdef HAVE_MFCR2
 static struct ast_frame *handle_r2_event(struct zt_pvt *p, mfcr2_event_t *e, int index)
 {
 	struct ast_frame *f;
@@ -3675,7 +3675,7 @@
 #endif
 		case ZT_EVENT_BITSCHANGED:
 			if (p->sig == SIG_R2) {
-#ifdef ZAPATA_R2
+#ifdef HAVE_MFCR2
 				struct ast_frame  *f = &p->subs[index].f;
 				mfcr2_event_t *e;
 				e = r2_get_event_bits(p);
@@ -6391,7 +6391,7 @@
 	return NULL;
 }
 
-#ifdef ZAPATA_R2
+#ifdef HAVE_MFCR2
 static int handle_init_r2_event(struct zt_pvt *i, mfcr2_event_t *e)
 {
 	struct ast_channel *chan;
@@ -6448,7 +6448,7 @@
 	case ZT_EVENT_NONE:
 	case ZT_EVENT_BITSCHANGED:
 		if (i->radio) break;
-#ifdef ZAPATA_R2
+#ifdef HAVE_MFCR2
 		if (i->r2) {
 			mfcr2_event_t *e;
 			e = r2_get_event_bits(i);
@@ -6684,7 +6684,7 @@
 					pfds[count].events = POLLPRI;
 					pfds[count].revents = 0;
 					/* Message waiting or r2 channels also get watched for reading */
-#ifdef ZAPATA_R2
+#ifdef HAVE_MFCR2
 					if (i->cidspill || i->r2)
 #else					
 					if (i->cidspill)
@@ -6785,7 +6785,7 @@
 						i = i->next;
 						continue;
 					}
-#ifdef ZAPATA_R2
+#ifdef HAVE_MFCR2
 					if (i->r2) {
 						/* If it's R2 signalled, we always have to check for events */
 						mfcr2_event_t *e;
@@ -6834,7 +6834,7 @@
 					handle_init_event(i, res);
 					ast_mutex_lock(&iflock);	
 				}
-#ifdef ZAPATA_R2
+#ifdef HAVE_MFCR2
 				if ((pollres & POLLPRI) || (i->r2 && !i->sigchecked)) 
 #else				
 				if (pollres & POLLPRI) 
@@ -7234,7 +7234,7 @@
 				tmp->prioffset = 0;
 			}
 #endif
-#ifdef ZAPATA_R2
+#ifdef HAVE_MFCR2
 			if (signalling == SIG_R2) {
 				if (r2prot < 0) {
 					ast_log(LOG_WARNING, "R2 Country not specified for channel %d -- Assuming China\n", tmp->channel);
@@ -7539,7 +7539,7 @@
 				return 1;
 		}
 #endif
-#ifdef ZAPATA_R2
+#ifdef HAVE_MFCR2
 		/* Trust R2 as well */
 		if (p->r2) {
 			if (p->hasr2call || p->r2blocked)
@@ -9683,7 +9683,7 @@
 #endif /* HAVE_LIBPRI */
 
 
-#ifdef ZAPATA_R2
+#ifdef HAVE_MFCR2
 static int handle_r2_no_debug(int fd, int argc, char *argv[])
 {
 	int chan;
@@ -9947,7 +9947,7 @@
 			}
 				
 #endif
-#ifdef ZAPATA_R2
+#ifdef HAVE_MFCR2
 			if (tmp->r2) {
 				ast_cli(fd, "R2 Flags: ");
 				if (tmp->r2blocked)
@@ -10296,7 +10296,7 @@
 	ast_cli_unregister_multiple(zap_pri_cli, sizeof(zap_pri_cli) / sizeof(zap_pri_cli[0]));
 	ast_unregister_application(zap_send_keypad_facility_app);
 #endif
-#ifdef ZAPATA_R2
+#ifdef HAVE_MFCR2
 	ast_cli_unregister_multiple(zap_r2_cli, sizeof(zap_r2_cli) / sizeof(zap_r2_cli[0]));
 #endif
 	ast_cli_unregister_multiple(zap_cli, sizeof(zap_cli) / sizeof(zap_cli[0]));
@@ -10872,7 +10872,7 @@
 					cur_radio = 0;
 					pritype = PRI_CPE;
 #endif
-#ifdef ZAPATA_R2
+#ifdef HAVE_MFCR2
 				} else if (!strcasecmp(v->value, "r2")) {
 					cur_signalling = SIG_R2;
 					cur_radio = 0;
@@ -10916,7 +10916,7 @@
 				} else {
 					ast_log(LOG_ERROR, "Unknown signalling method '%s'\n", v->value);
 				}
-#ifdef ZAPATA_R2
+#ifdef HAVE_MFCR2
 			} else if (!strcasecmp(v->name, "r2country")) {
 				r2prot = str2r2prot(v->value);
 				if (r2prot < 0) {
@@ -11260,7 +11260,7 @@
 	ast_string_field_set(&inuse, name, "GR-303InUse");
 	ast_cli_register_multiple(zap_pri_cli, sizeof(zap_pri_cli) / sizeof(zap_pri_cli[0]));
 #endif	
-#ifdef ZAPATA_R2
+#ifdef HAVE_MFCR2
 	ast_cli_register_multiple(zap_r2_cli, sizeof(zap_r2_cli) / sizeof(zap_r2_cli[0]));
 #endif	
 	ast_cli_register_multiple(zap_cli, sizeof(zap_cli) / sizeof(zap_cli[0]));



More information about the asterisk-commits mailing list