[asterisk-commits] kpfleming: branch 1.6.0 r134283 - in /branches/1.6.0: ./ apps/ channels/

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


Author: kpfleming
Date: Tue Jul 29 17:29:11 2008
New Revision: 134283

URL: http://svn.digium.com/view/asterisk?view=rev&rev=134283
Log:
Merged revisions 134260 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r134260 | kpfleming | 2008-07-29 17:22:13 -0500 (Tue, 29 Jul 2008) | 2 lines

build against the now-typedef-free dahdi/user.h, and remove some #ifdefs for features that will always be present in DAHDI

........

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

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/apps/app_dahdibarge.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/apps/app_dahdibarge.c?view=diff&rev=134283&r1=134282&r2=134283
==============================================================================
--- branches/1.6.0/apps/app_dahdibarge.c (original)
+++ branches/1.6.0/apps/app_dahdibarge.c Tue Jul 29 17:29:11 2008
@@ -100,7 +100,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: branches/1.6.0/apps/app_dahdiras.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/apps/app_dahdiras.c?view=diff&rev=134283&r1=134282&r2=134283
==============================================================================
--- branches/1.6.0/apps/app_dahdiras.c (original)
+++ branches/1.6.0/apps/app_dahdiras.c Tue Jul 29 17:29:11 2008
@@ -191,7 +191,7 @@
 {
 	int res=-1;
 	char *args;
-	DAHDI_PARAMS dahdip;
+	struct dahdi_params dahdip;
 
 	if (!data) 
 		data = "";

Modified: branches/1.6.0/apps/app_dahdiscan.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/apps/app_dahdiscan.c?view=diff&rev=134283&r1=134282&r2=134283
==============================================================================
--- branches/1.6.0/apps/app_dahdiscan.c (original)
+++ branches/1.6.0/apps/app_dahdiscan.c Tue Jul 29 17:29:11 2008
@@ -107,7 +107,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: branches/1.6.0/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/apps/app_meetme.c?view=diff&rev=134283&r1=134282&r2=134283
==============================================================================
--- branches/1.6.0/apps/app_meetme.c (original)
+++ branches/1.6.0/apps/app_meetme.c Tue Jul 29 17:29:11 2008
@@ -1517,7 +1517,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: branches/1.6.0/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/apps/app_rpt.c?view=diff&rev=134283&r1=134282&r2=134283
==============================================================================
--- branches/1.6.0/apps/app_rpt.c (original)
+++ branches/1.6.0/apps/app_rpt.c Tue Jul 29 17:29:11 2008
@@ -1892,7 +1892,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;
@@ -2525,12 +2525,20 @@
 
 static void *rpt_call(void *this)
 {
+<<<<<<< .working
 	DAHDI_CONFINFO ci;  /* conference info */
 	struct rpt *myrpt = (struct rpt *)this;
 	int	res;
 	struct ast_frame wf;
 	int stopped, congstarted, dialtimer, lastcidx, aborted;
 	struct ast_channel *mychannel, *genchannel;
+=======
+struct dahdi_confinfo ci;  /* conference info */
+struct	rpt *myrpt = (struct rpt *)this;
+int	res;
+int stopped,congstarted,dialtimer,lastcidx,aborted;
+struct ast_channel *mychannel,*genchannel;
+>>>>>>> .merge-right.r134260
 
 	myrpt->mydtmf = 0;
 	/* allocate a pseudo-channel thru asterisk */
@@ -2793,6 +2801,250 @@
 	return;
 }
 
+<<<<<<< .working
+=======
+static void send_link_keyquery(struct rpt *myrpt)
+{
+char	str[300];
+struct	ast_frame wf;
+struct	rpt_link *l;
+
+	rpt_mutex_lock(&myrpt->lock);
+	memset(myrpt->topkey,0,sizeof(myrpt->topkey));
+	myrpt->topkeystate = 1;
+	time(&myrpt->topkeytime);
+	rpt_mutex_unlock(&myrpt->lock);
+	snprintf(str, sizeof(str), "K? * %s 0 0", myrpt->name);
+	wf.frametype = AST_FRAME_TEXT;
+	wf.subclass = 0;
+	wf.offset = 0;
+	wf.mallocd = 0;
+	wf.datalen = strlen(str) + 1;
+	wf.samples = 0;
+	l = myrpt->links.next;
+	/* give it to everyone */
+	while(l != &myrpt->links)
+	{
+		wf.data.ptr = str;
+		if (l->chan) ast_write(l->chan,&wf);
+		l = l->next;
+	}
+	return;
+}
+
+/* send newkey request */
+
+static void send_newkey(struct ast_channel *chan)
+{
+
+	/* ast_safe_sleep(chan,10); */
+	ast_sendtext(chan,newkeystr);
+	return;
+}
+
+
+/* 
+ * Connect a link 
+ *
+ * Return values:
+ * -2: Attempt to connect to self 
+ * -1: No such node
+ *  0: Success
+ *  1: No match yet
+ *  2: Already connected to this node
+ */
+
+static int connect_link(struct rpt *myrpt, char* node, int mode, int perma)
+{
+	char *val, *s, *s1, *s2, *tele;
+	char lstr[MAXLINKLIST],*strs[MAXLINKLIST];
+	char tmp[300], deststr[300] = "",modechange = 0;
+	char sx[320],*sy;
+	struct rpt_link *l;
+	int reconnects = 0;
+	int i,n;
+	struct dahdi_confinfo ci;  /* conference info */
+
+	val = node_lookup(myrpt,node);
+	if (!val){
+		if(strlen(node) >= myrpt->longestnode)
+			return -1; /* No such node */
+		return 1; /* No match yet */
+	}
+
+	if(!strcmp(myrpt->name,node)) /* Do not allow connections to self */
+		return -2;
+		
+	if(debug > 3){
+		ast_log(LOG_NOTICE,"Connect attempt to node %s\n", node);
+		ast_log(LOG_NOTICE,"Mode: %s\n",(mode)?"Transceive":"Monitor");
+		ast_log(LOG_NOTICE,"Connection type: %s\n",(perma)?"Permalink":"Normal");
+	}
+
+	strncpy(tmp,val,sizeof(tmp) - 1);
+	s = tmp;
+	s1 = strsep(&s,",");
+	if (!strchr(s1,':') && strchr(s1,'/') && strncasecmp(s1, "local/", 6))
+	{
+		sy = strchr(s1,'/');		
+		*sy = 0;
+		sprintf(sx,"%s:4569/%s",s1,sy + 1);
+		s1 = sx;
+	}
+	s2 = strsep(&s,",");
+	rpt_mutex_lock(&myrpt->lock);
+	l = myrpt->links.next;
+	/* try to find this one in queue */
+	while(l != &myrpt->links){
+		if (l->name[0] == '0') 
+		{
+			l = l->next;
+			continue;
+		}
+	/* if found matching string */
+		if (!strcmp(l->name, node))
+			break;
+		l = l->next;
+	}
+	/* if found */
+	if (l != &myrpt->links){ 
+	/* if already in this mode, just ignore */
+		if ((l->mode) || (!l->chan)) {
+			rpt_mutex_unlock(&myrpt->lock);
+			return 2; /* Already linked */
+		}
+		reconnects = l->reconnects;
+		rpt_mutex_unlock(&myrpt->lock);
+		if (l->chan) ast_softhangup(l->chan, AST_SOFTHANGUP_DEV);
+		l->retries = l->max_retries + 1;
+		l->disced = 2;
+		modechange = 1;
+	} else
+	{
+		__mklinklist(myrpt,NULL,lstr);
+		rpt_mutex_unlock(&myrpt->lock);
+		n = finddelim(lstr,strs,MAXLINKLIST);
+		for(i = 0; i < n; i++)
+		{
+			if ((*strs[i] < '0') || 
+			    (*strs[i] > '9')) strs[i]++;
+			if (!strcmp(strs[i],node))
+			{
+				return 2; /* Already linked */
+			}
+		}
+	}
+	strncpy(myrpt->lastlinknode,node,MAXNODESTR - 1);
+	/* establish call */
+	l = ast_malloc(sizeof(struct rpt_link));
+	if (!l)
+	{
+		ast_log(LOG_WARNING, "Unable to malloc\n");
+		return -1;
+	}
+	/* zero the silly thing */
+	memset((char *)l,0,sizeof(struct rpt_link));
+	l->mode = mode;
+	l->outbound = 1;
+	l->thisconnected = 0;
+	voxinit_link(l,1);
+	strncpy(l->name, node, MAXNODESTR - 1);
+	l->isremote = (s && ast_true(s));
+	if (modechange) l->connected = 1;
+	l->hasconnected = l->perma = perma;
+#ifdef ALLOW_LOCAL_CHANNELS
+	if ((strncasecmp(s1,"iax2/", 5) == 0) || (strncasecmp(s1, "local/", 6) == 0))
+        	strncpy(deststr, s1, sizeof(deststr));
+	else
+	        snprintf(deststr, sizeof(deststr), "IAX2/%s", s1);
+#else
+	snprintf(deststr, sizeof(deststr), "IAX2/%s", s1);
+#endif
+	tele = strchr(deststr, '/');
+	if (!tele){
+		ast_log(LOG_WARNING,"link3:Dial number (%s) must be in format tech/number\n",deststr);
+		ast_free(l);
+		return -1;
+	}
+	*tele++ = 0;
+	l->chan = ast_request(deststr, AST_FORMAT_SLINEAR, tele,NULL);
+	if (l->chan){
+		ast_set_read_format(l->chan, AST_FORMAT_SLINEAR);
+		ast_set_write_format(l->chan, AST_FORMAT_SLINEAR);
+#ifdef	AST_CDR_FLAG_POST_DISABLED
+		if (l->chan->cdr)
+			ast_set_flag(l->chan->cdr,AST_CDR_FLAG_POST_DISABLED);
+#endif
+#ifndef	NEW_ASTERISK
+		l->chan->whentohangup = 0;
+#endif
+		l->chan->appl = "Apprpt";
+		l->chan->data = "(Remote Rx)";
+		if (debug > 3)
+			ast_log(LOG_NOTICE, "rpt (remote) initiating call to %s/%s on %s\n",
+		deststr, tele, l->chan->name);
+		if(l->chan->cid.cid_num)
+			ast_free(l->chan->cid.cid_num);
+		l->chan->cid.cid_num = ast_strdup(myrpt->name);
+		ast_call(l->chan,tele,999);
+	}
+	else {
+		if(debug > 3) 
+			ast_log(LOG_NOTICE, "Unable to place call to %s/%s on %s\n",
+		deststr,tele,l->chan->name);
+		if (myrpt->p.archivedir)
+		{
+			char str[100];
+			sprintf(str,"LINKFAIL,%s",l->name);
+			donodelog(myrpt,str);
+		}
+		ast_free(l);
+		return -1;
+	}
+	/* allocate a pseudo-channel thru asterisk */
+	l->pchan = ast_request("DAHDI",AST_FORMAT_SLINEAR,"pseudo",NULL);
+	if (!l->pchan){
+		ast_log(LOG_WARNING,"rpt connect: Sorry unable to obtain pseudo channel\n");
+		ast_hangup(l->chan);
+		ast_free(l);
+		return -1;
+	}
+	ast_set_read_format(l->pchan, AST_FORMAT_SLINEAR);
+	ast_set_write_format(l->pchan, AST_FORMAT_SLINEAR);
+#ifdef	AST_CDR_FLAG_POST_DISABLED
+	if (l->pchan->cdr)
+		ast_set_flag(l->pchan->cdr,AST_CDR_FLAG_POST_DISABLED);
+#endif
+	/* make a conference for the tx */
+	ci.chan = 0;
+	ci.confno = myrpt->conf;
+	ci.confmode = DAHDI_CONF_CONF | DAHDI_CONF_LISTENER | DAHDI_CONF_TALKER;
+	/* first put the channel on the conference in proper mode */
+	if (ioctl(l->pchan->fds[0], DAHDI_SETCONF, &ci) == -1)
+	{
+		ast_log(LOG_WARNING, "Unable to set conference mode to Announce\n");
+		ast_hangup(l->chan);
+		ast_hangup(l->pchan);
+		ast_free(l);
+		return -1;
+	}
+	rpt_mutex_lock(&myrpt->lock);
+	l->reconnects = reconnects;
+	/* insert at end of queue */
+	l->max_retries = MAX_RETRIES;
+	if (perma)
+		l->max_retries = MAX_RETRIES_PERM;
+	if (l->isremote) l->retries = l->max_retries + 1;
+	insque((struct qelem *)l,(struct qelem *)myrpt->links.next);
+	__kickshort(myrpt);
+	rpt_mutex_unlock(&myrpt->lock);
+	if (!l->phonemode) send_newkey(l->chan);
+	return 0;
+}
+
+
+
+>>>>>>> .merge-right.r134260
 /*
 * Internet linking function 
 */
@@ -5652,6 +5904,7 @@
 /* single thread with one file (request) to dial */
 static void *rpt(void *this)
 {
+<<<<<<< .working
 	struct rpt *myrpt = (struct rpt *)this;
 	char *tele, c;
 	const char *idtalkover;
@@ -5662,6 +5915,18 @@
 	struct rpt_link *l, *m;
 	struct rpt_tele *telem;
 	char tmpstr[300];
+=======
+struct	rpt *myrpt = (struct rpt *)this;
+char *tele,*idtalkover,c,myfirst,*p;
+int ms = MSWAIT,i,lasttx=0,val,remrx=0,identqueued,othertelemqueued;
+int tailmessagequeued,ctqueued,dtmfed,lastmyrx,localmsgqueued;
+struct ast_channel *who;
+struct dahdi_confinfo ci;  /* conference info */
+time_t	t;
+struct rpt_link *l,*m;
+struct rpt_tele *telem;
+char tmpstr[300],lstr[MAXLINKLIST];
+>>>>>>> .merge-right.r134260
 
 	rpt_mutex_lock(&myrpt->lock);
 
@@ -6816,8 +7081,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;
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(node);

Modified: branches/1.6.0/channels/chan_dahdi.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/channels/chan_dahdi.c?view=diff&rev=134283&r1=134282&r2=134283
==============================================================================
--- branches/1.6.0/channels/chan_dahdi.c (original)
+++ branches/1.6.0/channels/chan_dahdi.c Tue Jul 29 17:29:11 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 =
@@ -486,7 +484,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)
@@ -646,7 +644,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 */
@@ -725,7 +723,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];
@@ -1136,7 +1134,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);
@@ -1246,7 +1244,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,
 		};
 
@@ -1442,7 +1440,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;
@@ -1489,7 +1487,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 */
@@ -1555,7 +1553,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));
@@ -2960,7 +2958,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) {
@@ -3681,16 +3679,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_DTMF_DETECT;
 		ast_dsp_set_features(p->dsp, p->dsp_features);
@@ -3699,19 +3694,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_DTMF_DETECT;
 		ast_dsp_set_features(p->dsp, p->dsp_features);
@@ -4124,7 +4116,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;
@@ -4151,7 +4143,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));
@@ -4313,12 +4305,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:
@@ -4707,7 +4697,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:
@@ -4719,7 +4708,6 @@
 				break;
 			}
 			break;
-#endif			
 		case DAHDI_EVENT_RINGEROFF:
 			if (p->inalarm) break;
 			if ((p->radio || (p->oprmode < 0))) break;
@@ -5243,7 +5231,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) {
@@ -5835,7 +5823,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;
@@ -5897,18 +5885,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_DTMF_DETECT;
-#ifdef DAHDI_TONEDETECT
 		} else if (NEED_MFDETECT(i)) {
 			i->hardwaredtmf = 1;
 			features |= DSP_FEATURE_DTMF_DETECT;
 		}
-#endif
 	}
 	if (features) {
 		if (i->dsp) {
@@ -6826,12 +6810,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;
@@ -7321,10 +7303,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;
@@ -7641,7 +7621,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);
@@ -7654,7 +7633,6 @@
 			ast_log(LOG_NOTICE, "NEON MWI cleared for channel %d, mailbox %s\n", i->channel, i->mailbox);
 		}
 		break;
-#endif
 	}
 	return 0;
 }
@@ -7747,11 +7725,9 @@
 							if (last->msgstate != res) {
 								int x;
 								ast_debug(1, "Message status for %s changed from %d to %d on %d\n", last->mailbox, last->msgstate, res, last->channel);
-#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
 								x = DAHDI_FLUSH_BOTH;
 								res2 = ioctl(last->subs[SUB_REAL].zfd, DAHDI_FLUSH, &x);
 								if (res2)
@@ -7949,7 +7925,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;
@@ -8069,7 +8045,7 @@
 	int x;
 	struct dahdi_pvt **wlist;
 	struct dahdi_pvt **wend;
-	DAHDI_PARAMS p;
+	struct dahdi_params p;
 
 	wlist = &iflist;
 	wend = &ifend;
@@ -8611,7 +8587,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) {
@@ -8683,11 +8659,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 */
@@ -8727,7 +8699,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)))) {
@@ -9854,7 +9826,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);
@@ -11262,8 +11234,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;
 	
@@ -11908,8 +11880,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;
@@ -12058,11 +12030,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 {
@@ -12119,19 +12089,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:
@@ -12148,11 +12113,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;
@@ -12188,7 +12149,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" :
@@ -12200,7 +12160,6 @@
 				, s.lineconfig & DAHDI_CONFIG_CRC4 ?
 				  s.lineconfig & DAHDI_CONFIG_NOTOPEN ? "CRC4/YEL" : "CRC4" : "YEL"
 				, lbostr[s.lbo]
-#endif
 			);
 	}
 	close(ctl);
@@ -12771,8 +12730,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;
 
 
@@ -14512,10 +14471,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