[asterisk-commits] kpfleming: trunk r134260 - in /trunk: ./ apps/ channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 29 17:22:13 CDT 2008


Author: kpfleming
Date: Tue Jul 29 17:22:13 2008
New Revision: 134260

URL: http://svn.digium.com/view/asterisk?view=rev&rev=134260
Log:
build against the now-typedef-free dahdi/user.h, and remove some #ifdefs for features that will always be present in DAHDI

Modified:
    trunk/   (props changed)
    trunk/apps/app_dahdibarge.c
    trunk/apps/app_dahdiras.c
    trunk/apps/app_dahdiscan.c
    trunk/apps/app_meetme.c
    trunk/apps/app_rpt.c
    trunk/channels/chan_dahdi.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/apps/app_dahdibarge.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_dahdibarge.c?view=diff&rev=134260&r1=134259&r2=134260
==============================================================================
--- trunk/apps/app_dahdibarge.c (original)
+++ trunk/apps/app_dahdibarge.c Tue Jul 29 17:22:13 2008
@@ -99,7 +99,7 @@
 	int origfd;
 	int ret = -1;
 
-	DAHDI_BUFFERINFO bi;
+	struct dahdi_bufferinfo bi;
 	char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
 	char *buf = __buf + AST_FRIENDLY_OFFSET;
 

Modified: trunk/apps/app_dahdiras.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_dahdiras.c?view=diff&rev=134260&r1=134259&r2=134260
==============================================================================
--- trunk/apps/app_dahdiras.c (original)
+++ trunk/apps/app_dahdiras.c Tue Jul 29 17:22:13 2008
@@ -180,7 +180,7 @@
 {
 	int res=-1;
 	char *args;
-	DAHDI_PARAMS dahdip;
+	struct dahdi_params dahdip;
 
 	if (!data) 
 		data = "";

Modified: trunk/apps/app_dahdiscan.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_dahdiscan.c?view=diff&rev=134260&r1=134259&r2=134260
==============================================================================
--- trunk/apps/app_dahdiscan.c (original)
+++ trunk/apps/app_dahdiscan.c Tue Jul 29 17:22:13 2008
@@ -108,7 +108,7 @@
 	char input[4];
 	int ic = 0;
 	
-	DAHDI_BUFFERINFO bi;
+	struct dahdi_bufferinfo bi;
 	char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
 	char *buf = __buf + AST_FRIENDLY_OFFSET;
 	

Modified: trunk/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_meetme.c?view=diff&rev=134260&r1=134259&r2=134260
==============================================================================
--- trunk/apps/app_meetme.c (original)
+++ trunk/apps/app_meetme.c Tue Jul 29 17:22:13 2008
@@ -1520,7 +1520,7 @@
 	char members[10] = "";
 	int dtmf, opt_waitmarked_timeout = 0;
 	time_t timeout = 0;
-	DAHDI_BUFFERINFO bi;
+	struct dahdi_bufferinfo bi;
 	char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
 	char *buf = __buf + AST_FRIENDLY_OFFSET;
 	char *exitkeys = NULL;

Modified: trunk/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_rpt.c?view=diff&rev=134260&r1=134259&r2=134260
==============================================================================
--- trunk/apps/app_rpt.c (original)
+++ trunk/apps/app_rpt.c Tue Jul 29 17:22:13 2008
@@ -3929,7 +3929,7 @@
 
 static void *rpt_tele_thread(void *this)
 {
-DAHDI_CONFINFO ci;  /* conference info */
+struct dahdi_confinfo ci;  /* conference info */
 int	res = 0,haslink,hastx,hasremote,imdone = 0, unkeys_queued, x;
 struct	rpt_tele *mytele = (struct rpt_tele *)this;
 struct  rpt_tele *tlist;
@@ -5280,7 +5280,7 @@
 
 static void *rpt_call(void *this)
 {
-DAHDI_CONFINFO ci;  /* conference info */
+struct dahdi_confinfo ci;  /* conference info */
 struct	rpt *myrpt = (struct rpt *)this;
 int	res;
 int stopped,congstarted,dialtimer,lastcidx,aborted;
@@ -5685,7 +5685,7 @@
 	struct rpt_link *l;
 	int reconnects = 0;
 	int i,n;
-	DAHDI_CONFINFO ci;  /* conference info */
+	struct dahdi_confinfo ci;  /* conference info */
 
 	val = node_lookup(myrpt,node);
 	if (!val){
@@ -10721,7 +10721,7 @@
 int ms = MSWAIT,i,lasttx=0,val,remrx=0,identqueued,othertelemqueued;
 int tailmessagequeued,ctqueued,dtmfed,lastmyrx,localmsgqueued;
 struct ast_channel *who;
-DAHDI_CONFINFO ci;  /* conference info */
+struct dahdi_confinfo ci;  /* conference info */
 time_t	t;
 struct rpt_link *l,*m;
 struct rpt_tele *telem;
@@ -13120,8 +13120,8 @@
 	struct ast_channel *who;
 	struct ast_channel *cs[20];
 	struct	rpt_link *l;
-	DAHDI_CONFINFO ci;  /* conference info */
-	DAHDI_PARAMS par;
+	struct dahdi_confinfo ci;  /* conference info */
+	struct dahdi_params par;
 	int ms,elap,nullfd;
 	time_t t,last_timeout_warning;
 	struct	dahdi_radio_param z;

Modified: trunk/channels/chan_dahdi.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=134260&r1=134259&r2=134260
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Tue Jul 29 17:22:13 2008
@@ -103,7 +103,6 @@
 
 #define SMDI_MD_WAIT_TIMEOUT 1500 /* 1.5 seconds */
 
-#ifdef DAHDI_SPANINFO_HAS_LINECONFIG
 static const char *lbostr[] = {
 "0 db (CSU)/0-133 feet (DSX-1)",
 "133-266 feet (DSX-1)",
@@ -114,7 +113,6 @@
 "-15db (CSU)",
 "-22.5db (CSU)"
 };
-#endif
 
 /*! Global jitterbuffer configuration - by default, jb is disabled */
 static struct ast_jb_conf default_jbconf =
@@ -489,7 +487,7 @@
 	unsigned int needunhold:1;
 	unsigned int linear:1;
 	unsigned int inthreeway:1;
-	DAHDI_CONFINFO curconf;
+	struct dahdi_confinfo curconf;
 };
 
 #define CONF_USER_REAL		(1 << 0)
@@ -651,7 +649,7 @@
 	struct timeval flashtime;			/*!< Last flash-hook time */
 	struct ast_dsp *dsp;
 	int cref;					/*!< Call reference number */
-	DAHDI_DIAL_OPERATION dop;
+	struct dahdi_dialoperation dop;
 	int whichwink;					/*!< SIG_FEATDMF_TA Which wink are we on? */
 	char finaldial[64];
 	char accountcode[AST_MAX_ACCOUNT_CODE];		/*!< Account code */
@@ -731,7 +729,7 @@
 #ifdef HAVE_SS7
 	struct dahdi_ss7 ss7;
 #endif
-	DAHDI_PARAMS timing;
+	struct dahdi_params timing;
 	int is_sig_auto; /*!< Use channel signalling from DAHDI? */
 
 	char smdi_port[SMDI_MAX_FILENAME_LEN];
@@ -1144,7 +1142,7 @@
 
 static int alloc_sub(struct dahdi_pvt *p, int x)
 {
-	DAHDI_BUFFERINFO bi;
+	struct dahdi_bufferinfo bi;
 	int res;
 	if (p->subs[x].zfd >= 0) {
 		ast_log(LOG_WARNING, "%s subchannel of %d already in use\n", subnames[x], p->channel);
@@ -1254,7 +1252,7 @@
 
 	if (pvt->pulse || ioctl(pvt->subs[SUB_REAL].zfd, DAHDI_SENDTONE, &dtmf)) {
 		int res;
-		DAHDI_DIAL_OPERATION zo = {
+		struct dahdi_dialoperation zo = {
 			.op = DAHDI_DIAL_OP_APPEND,
 		};
 
@@ -1450,7 +1448,7 @@
 {
 	/* If the conference already exists, and we're already in it
 	   don't bother doing anything */
-	DAHDI_CONFINFO zi;
+	struct dahdi_confinfo zi;
 	
 	memset(&zi, 0, sizeof(zi));
 	zi.chan = 0;
@@ -1497,7 +1495,7 @@
 
 static int conf_del(struct dahdi_pvt *p, struct dahdi_subchannel *c, int index)
 {
-	DAHDI_CONFINFO zi;
+	struct dahdi_confinfo zi;
 	if (/* Can't delete if there's no zfd */
 		(c->zfd < 0) ||
 		/* Don't delete from the conference if it's not our conference */
@@ -1563,7 +1561,7 @@
 
 static int reset_conf(struct dahdi_pvt *p)
 {
-	DAHDI_CONFINFO zi;
+	struct dahdi_confinfo zi;
 	memset(&zi, 0, sizeof(zi));
 	p->confno = -1;
 	memset(&p->subs[SUB_REAL].curconf, 0, sizeof(p->subs[SUB_REAL].curconf));
@@ -2968,7 +2966,7 @@
 	struct dahdi_pvt *p = ast->tech_pvt;
 	struct dahdi_pvt *tmp = NULL;
 	struct dahdi_pvt *prev = NULL;
-	DAHDI_PARAMS par;
+	struct dahdi_params par;
 
 	ast_debug(1, "dahdi_hangup(%s)\n", ast->name);
 	if (!ast->tech_pvt) {
@@ -3690,16 +3688,13 @@
 
 static void disable_dtmf_detect(struct dahdi_pvt *p)
 {
-#ifdef DAHDI_TONEDETECT
 	int val;
-#endif
 
 	p->ignoredtmf = 1;
 
-#ifdef DAHDI_TONEDETECT
 	val = 0;
 	ioctl(p->subs[SUB_REAL].zfd, DAHDI_TONEDETECT, &val);
-#endif		
+
 	if (!p->hardwaredtmf && p->dsp) {
 		p->dsp_features &= ~DSP_FEATURE_DIGIT_DETECT;
 		ast_dsp_set_features(p->dsp, p->dsp_features);
@@ -3708,19 +3703,16 @@
 
 static void enable_dtmf_detect(struct dahdi_pvt *p)
 {
-#ifdef DAHDI_TONEDETECT
 	int val;
-#endif
 
 	if (p->channel == CHAN_PSEUDO)
 		return;
 
 	p->ignoredtmf = 0;
 
-#ifdef DAHDI_TONEDETECT
 	val = DAHDI_TONEDETECT_ON | DAHDI_TONEDETECT_MUTE;
 	ioctl(p->subs[SUB_REAL].zfd, DAHDI_TONEDETECT, &val);
-#endif		
+
 	if (!p->hardwaredtmf && p->dsp) {
 		p->dsp_features |= DSP_FEATURE_DIGIT_DETECT;
 		ast_dsp_set_features(p->dsp, p->dsp_features);
@@ -4129,7 +4121,7 @@
 
 static int check_for_conference(struct dahdi_pvt *p)
 {
-	DAHDI_CONFINFO ci;
+	struct dahdi_confinfo ci;
 	/* Fine if we already have a master, etc */
 	if (p->master || (p->confno > -1))
 		return 0;
@@ -4156,7 +4148,7 @@
 static int get_alarms(struct dahdi_pvt *p)
 {
 	int res;
-	DAHDI_SPANINFO zi;
+	struct dahdi_spaninfo zi;
 	struct dahdi_params params;
 
 	memset(&zi, 0, sizeof(zi));
@@ -4304,12 +4296,10 @@
 	}
 
 	switch (res) {
-#ifdef DAHDI_EVENT_EC_DISABLED
 		case DAHDI_EVENT_EC_DISABLED:
 			ast_verb(3, "Channel %d echo canceler disabled due to CED detection\n", p->channel);
 			p->echocanon = 0;
 			break;
-#endif
 		case DAHDI_EVENT_BITSCHANGED:
 			ast_log(LOG_WARNING, "Recieved bits changed on %s signalling?\n", sig2str(p->sig));
 		case DAHDI_EVENT_PULSE_START:
@@ -4696,7 +4686,6 @@
 				ast_log(LOG_WARNING, "Don't know how to handle ring/off hook for signalling %d\n", p->sig);
 			}
 			break;
-#ifdef DAHDI_EVENT_RINGBEGIN
 		case DAHDI_EVENT_RINGBEGIN:
 			switch (p->sig) {
 			case SIG_FXSLS:
@@ -4708,7 +4697,6 @@
 				break;
 			}
 			break;
-#endif			
 		case DAHDI_EVENT_RINGEROFF:
 			if (p->inalarm) break;
 			if ((p->radio || (p->oprmode < 0))) break;
@@ -5232,7 +5220,7 @@
 	/* make sure it sends initial key state as first frame */
 	if ((p->radio || (p->oprmode < 0)) && (!p->firstradio))
 	{
-		DAHDI_PARAMS ps;
+		struct dahdi_params ps;
 
 		ps.channo = p->channel;
 		if (ioctl(p->subs[SUB_REAL].zfd, DAHDI_GET_PARAMS, &ps) < 0) {
@@ -5834,7 +5822,7 @@
 	int features;
 	struct ast_str *chan_name;
 	struct ast_variable *v;
-	DAHDI_PARAMS ps;
+	struct dahdi_params ps;
 	if (i->subs[index].owner) {
 		ast_log(LOG_WARNING, "Channel %d already has a %s call\n", i->channel,subnames[index]);
 		return NULL;
@@ -5896,18 +5884,14 @@
 		    (i->outgoing && (i->callprogress & CALLPROGRESS_FAX_OUTGOING))) {
 			features |= DSP_FEATURE_FAX_DETECT;
 		}
-#ifdef DAHDI_TONEDETECT
 		x = DAHDI_TONEDETECT_ON | DAHDI_TONEDETECT_MUTE;
 		if (ioctl(i->subs[index].zfd, DAHDI_TONEDETECT, &x)) {
-#endif		
 			i->hardwaredtmf = 0;
 			features |= DSP_FEATURE_DIGIT_DETECT;
-#ifdef DAHDI_TONEDETECT
 		} else if (NEED_MFDETECT(i)) {
 			i->hardwaredtmf = 1;
 			features |= DSP_FEATURE_DIGIT_DETECT;
 		}
-#endif
 	}
 	if (features) {
 		if (i->dsp) {
@@ -6828,12 +6812,10 @@
 							ast_log(LOG_NOTICE, "Got event %d (%s)...\n", res, event2str(res));
 
 							if (p->cid_signalling == CID_SIG_V23_JP) {
-#ifdef DAHDI_EVENT_RINGBEGIN
 								if (res == DAHDI_EVENT_RINGBEGIN) {
 									res = dahdi_set_hook(p->subs[SUB_REAL].zfd, DAHDI_OFFHOOK);
 									usleep(1);
 								}
-#endif
 							} else {
 								res = 0;
 								break;
@@ -7335,10 +7317,8 @@
 			res = dahdi_get_event(mtd->pvt->subs[SUB_REAL].zfd);
 
 			switch (res) {
-#ifdef HAVE_DAHDI_NEONMWI
 			case DAHDI_EVENT_NEONMWI_ACTIVE:
 			case DAHDI_EVENT_NEONMWI_INACTIVE:
-#endif
 			case DAHDI_EVENT_NONE:
 			case DAHDI_EVENT_BITSCHANGED:
 				break;
@@ -7821,7 +7801,6 @@
 				i->channel);
 		dahdi_destroy_channel_bynum(i->channel);
 		break;
-#ifdef HAVE_DAHDI_NEONMWI
 	case DAHDI_EVENT_NEONMWI_ACTIVE:
 		if (i->mwimonitor_neon) {
 			notify_message(i->mailbox, 1);
@@ -7834,7 +7813,6 @@
 			ast_log(LOG_NOTICE, "NEON MWI cleared for channel %d, mailbox %s\n", i->channel, i->mailbox);
 		}
 		break;
-#endif
 	}
 	return thread_spawned;
 }
@@ -7931,12 +7909,10 @@
 								pthread_attr_t attr;
 								pthread_t threadid;
 								struct mwi_thread_data *mtd;
-#ifdef DAHDI_VMWI
 								res2 = ioctl(last->subs[SUB_REAL].zfd, DAHDI_VMWI, res);
 								if (res2) {
 									ast_log(LOG_DEBUG, "Unable to control message waiting led on channel %d: %s\n", last->channel, strerror(errno));
 								}
-#endif
 								pthread_attr_init(&attr);
 								pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 								if ((mtd = ast_calloc(1, sizeof(*mtd)))) {
@@ -8116,7 +8092,7 @@
 static int pri_create_trunkgroup(int trunkgroup, int *channels)
 {
 	struct dahdi_spaninfo si;
-	DAHDI_PARAMS p;
+	struct dahdi_params p;
 	int fd;
 	int span;
 	int ospan=0;
@@ -8237,7 +8213,7 @@
 	int x;
 	struct dahdi_pvt **wlist;
 	struct dahdi_pvt **wend;
-	DAHDI_PARAMS p;
+	struct dahdi_params p;
 
 	wlist = &iflist;
 	wend = &ifend;
@@ -8780,7 +8756,7 @@
 static inline int available(struct dahdi_pvt *p, int channelmatch, ast_group_t groupmatch, int *busy, int *channelmatched, int *groupmatched)
 {
 	int res;
-	DAHDI_PARAMS par;
+	struct dahdi_params par;
 
 	/* First, check group matching */
 	if (groupmatch) {
@@ -8852,11 +8828,7 @@
 				if (par.rxisoffhook)
 					return 1;
 				else
-#ifdef DAHDI_CHECK_HOOKSTATE
 					return 0;
-#else
-					return 1;
-#endif
 			} else if (par.rxisoffhook) {
 				ast_debug(1, "Channel %d off hook, can't use\n", p->channel);
 				/* Not available when the other end is off hook */
@@ -8896,7 +8868,7 @@
 static struct dahdi_pvt *chandup(struct dahdi_pvt *src)
 {
 	struct dahdi_pvt *p;
-	DAHDI_BUFFERINFO bi;
+	struct dahdi_bufferinfo bi;
 	int res;
 	
 	if ((p = ast_malloc(sizeof(*p)))) {
@@ -10020,7 +9992,7 @@
 	int x;
 	int span = PRI_SPAN(channel);
 	int spanfd;
-	DAHDI_PARAMS param;
+	struct dahdi_params param;
 	int principle = -1;
 	int explicit = PRI_EXPLICIT(channel);
 	channel = PRI_CHANNEL(channel);
@@ -11428,8 +11400,8 @@
 static int start_pri(struct dahdi_pri *pri)
 {
 	int res, x;
-	DAHDI_PARAMS p;
-	DAHDI_BUFFERINFO bi;
+	struct dahdi_params p;
+	struct dahdi_bufferinfo bi;
 	struct dahdi_spaninfo si;
 	int i;
 	
@@ -12090,8 +12062,8 @@
 {
 	int channel;
 	struct dahdi_pvt *tmp = NULL;
-	DAHDI_CONFINFO ci;
-	DAHDI_PARAMS ps;
+	struct dahdi_confinfo ci;
+	struct dahdi_params ps;
 	int x;
 	ast_mutex_t *lock;
 	struct dahdi_pvt *start;
@@ -12241,11 +12213,9 @@
 				if (!ioctl(tmp->subs[SUB_REAL].zfd, DAHDI_GETCONF, &ci)) {
 					ast_cli(a->fd, "Actual Confinfo: Num/%d, Mode/0x%04x\n", ci.confno, ci.confmode);
 				}
-#ifdef DAHDI_GETCONFMUTE
 				if (!ioctl(tmp->subs[SUB_REAL].zfd, DAHDI_GETCONFMUTE, &x)) {
 					ast_cli(a->fd, "Actual Confmute: %s\n", x ? "Yes" : "No");
 				}
-#endif
 				if (ioctl(tmp->subs[SUB_REAL].zfd, DAHDI_GET_PARAMS, &ps) < 0) {
 					ast_log(LOG_WARNING, "Failed to get parameters on channel %d: %s\n", tmp->channel, strerror(errno));
 				} else {
@@ -12302,19 +12272,14 @@
 /* Based on irqmiss.c */
 static char *dahdi_show_status(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) 
 {
-#ifdef DAHDI_SPANINFO_HAS_LINECONFIG
 	#define FORMAT "%-40.40s %-7.7s %-6d %-6d %-6d %-3.3s %-4.4s %-8.8s %s\n"
 	#define FORMAT2 "%-40.40s %-7.7s %-6.6s %-6.6s %-6.6s %-3.3s %-4.4s %-8.8s %s\n"
-#else
-	#define FORMAT "%-40.40s %-10.10s %-10d %-10d %-10d\n"
-	#define FORMAT2 "%-40.40s %-10.10s %-10.10s %-10.10s %-10.10s\n"
-#endif
 	int span;
 	int res;
 	char alarms[50];
 
 	int ctl;
-	DAHDI_SPANINFO s;
+	struct dahdi_spaninfo s;
 
 	switch (cmd) {
 	case CLI_INIT:
@@ -12331,11 +12296,7 @@
 		ast_cli(a->fd, "No DAHDI found. Unable to open /dev/dahdi/ctl: %s\n", strerror(errno));
 		return CLI_FAILURE;
 	}
-	ast_cli(a->fd, FORMAT2, "Description", "Alarms", "IRQ", "bpviol", "CRC4"
-#ifdef DAHDI_SPANINFO_HAS_LINECONFIG
-			, "Framing", "Coding", "Options", "LBO"
-#endif
-		);
+	ast_cli(a->fd, FORMAT2, "Description", "Alarms", "IRQ", "bpviol", "CRC4", "Framing", "Coding", "Options", "LBO");
 
 	for (span = 1; span < DAHDI_MAX_SPANS; ++span) {
 		s.spanno = span;
@@ -12371,7 +12332,6 @@
 		}
 
 		ast_cli(a->fd, FORMAT, s.desc, alarms, s.irqmisses, s.bpvcount, s.crc4count
-#ifdef DAHDI_SPANINFO_HAS_LINECONFIG
 				, s.lineconfig & DAHDI_CONFIG_D4 ? "D4" :
 				  s.lineconfig & DAHDI_CONFIG_ESF ? "ESF" :
 				  s.lineconfig & DAHDI_CONFIG_CCS ? "CCS" :
@@ -12383,7 +12343,6 @@
 				, s.lineconfig & DAHDI_CONFIG_CRC4 ?
 				  s.lineconfig & DAHDI_CONFIG_NOTOPEN ? "CRC4/YEL" : "CRC4" : "YEL"
 				, lbostr[s.lbo]
-#endif
 			);
 	}
 	close(ctl);
@@ -12954,8 +12913,8 @@
 	struct dahdi_ss7 *link;
 	int res;
 	int curfd;
-	DAHDI_PARAMS p;
-	DAHDI_BUFFERINFO bi;
+	struct dahdi_params p;
+	struct dahdi_bufferinfo bi;
 	struct dahdi_spaninfo si;
 
 
@@ -14772,10 +14731,18 @@
  * AST_MODULE_INFO(, , "DAHDI Telephony"
  */
 
-#ifdef DAHDI_PRI
+#ifdef HAVE_PRI
+#ifdef HAVE_SS7
+#define tdesc "DAHDI Telephony w/PRI & SS7"
+#else
 #define tdesc "DAHDI Telephony w/PRI"
+#endif
+#else
+#ifdef HAVE_SS7
+#define tdesc "DAHDI Telephony w/SS7"
 #else
 #define tdesc "DAHDI Telephony"
+#endif
 #endif
 
 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, tdesc,




More information about the asterisk-commits mailing list