[Asterisk-Dev] Re: [Asterisk-cvs] asterisk/channels chan_zap.c,1.154,1.155

Martin Pycko martinp at digium.com
Thu Dec 18 09:00:50 MST 2003


It should be fixed now.

regards
Martin

On Thu, 18 Dec 2003, James Sizemore wrote:

> A clean checkout of CVS asterisk and zaptel are now failing to build:
>
> gcc -c -pipe  -Wall -Wstrict-prototypes -Wmissing-prototypes
> -Wmissing-declarations -g  -Iinclude -I../include -D_REENTRANT
> -D_GNU_SOURCE  -O6 -march=i686  -DZAPTEL_OPTIMIZATIONS
> -DASTERISK_VERSION=\"CVS-12/18/03-04:09:32\" -DINSTALL_PREFIX=\"\"
> -DASTETCDIR=\"/etc/asterisk\" -DASTLIBDIR=\"/usr/lib/asterisk\"
> -DASTVARLIBDIR=\"/var/lib/asterisk\" -DASTVARRUNDIR=\"/var/run\"
> -DASTSPOOLDIR=\"/var/spool/asterisk\" -DASTLOGDIR=\"/var/log/asterisk\"
> -DASTCONFPATH=\"/etc/asterisk/asterisk.conf\"
> -DASTMODDIR=\"/usr/lib/asterisk/modules\"
> -DASTAGIDIR=\"/var/lib/asterisk/agi-bin\"     -DBUSYDETECT_MARTIN
> -DNEW_PRI_HANGUP  -Wno-missing-prototypes -Wno-missing-declarations
> -DIAX_TRUNKING -DCRYPTO -fPIC  -o chan_zap.o chan_zap.c
> chan_zap.c: In function `zt_handle_event':
> chan_zap.c:3027: structure has no member named
> `useincomingcalleridonzaptransfer'
> chan_zap.c:3037: structure has no member named
> `useincomingcalleridonzaptransfer'
> chan_zap.c: In function `mkintf':
> chan_zap.c:5322: structure has no member named
> `useincomingcalleridonzaptransfer'
> make[1]: *** [chan_zap.o] Error 1
> make[1]: Leaving directory `/usr/src/asterisk/channels'
> make: *** [subdirs] Error 1
>
>
> martinp at lists.digium.com wrote:
>
> >Update of /usr/cvsroot/asterisk/channels
> >In directory mongoose.digium.com:/tmp/cvs-serv20837/channels
> >
> >Modified Files:
> >	chan_zap.c
> >Log Message:
> >Add 'useincomingcalleridonzaptransfer' keyword to chan_zap so that if there is incoming call on fxs port and you flashhook and transfer that call (or do a threeway call) the incoming callerid will be presented.
> >
> >
> >Index: chan_zap.c
> >===================================================================
> >RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
> >retrieving revision 1.154
> >retrieving revision 1.155
> >diff -u -d -r1.154 -r1.155
> >--- chan_zap.c	11 Dec 2003 20:55:26 -0000	1.154
> >+++ chan_zap.c	17 Dec 2003 23:39:16 -0000	1.155
> >@@ -136,7 +136,7 @@
> > static char musicclass[MAX_LANGUAGE] = "";
> >
> > static int use_callerid = 1;
> >-
> >+static int useincomingcalleridonzaptransfer = 0;
> > static int cur_signalling = -1;
> >
> > static unsigned int cur_group = 0;
> >@@ -372,6 +372,7 @@
> > 	char musicclass[MAX_LANGUAGE];
> > 	char callerid[AST_MAX_EXTENSION];
> > 	char lastcallerid[AST_MAX_EXTENSION];
> >+	char *origcallerid;			/* malloced original callerid */
> > 	char callwaitcid[AST_MAX_EXTENSION];
> > 	char rdnis[AST_MAX_EXTENSION];
> > 	char dnid[AST_MAX_EXTENSION];
> >@@ -455,6 +456,7 @@
> > 	int resetting;
> > 	int prioffset;
> > 	int alreadyhungup;
> >+	int useincomingcalleridonzaptransfer;
> > #ifdef PRI_EVENT_PROCEEDING
> > 	int proceeding;
> > #endif
> >@@ -1664,7 +1666,11 @@
> > 	x = 0;
> > 	zt_confmute(p, 0);
> > 	restore_gains(p);
> >-
> >+	if (p->origcallerid) {
> >+		strncpy(p->callerid, p->origcallerid, sizeof(p->callerid) - 1);
> >+		free(p->origcallerid);
> >+		p->origcallerid = NULL;
> >+	}
> > 	if (p->dsp)
> > 		ast_dsp_digitmode(p->dsp,DSP_DIGITMODE_DTMF | p->dtmfrelax);
> >
> >@@ -3016,7 +3022,10 @@
> > 						if (p->subs[SUB_REAL].owner->bridge)
> > 								ast_moh_stop(p->subs[SUB_REAL].owner->bridge);
> > 					} else if (!p->subs[SUB_THREEWAY].owner) {
> >+						char callerid[256];
> > 						if (p->threewaycalling && !check_for_conference(p)) {
> >+							if (p->useincomingcalleridonzaptransfer && p->owner)
> >+								strncpy(callerid, p->owner->callerid, sizeof(callerid) - 1);
> > 							/* XXX This section needs much more error checking!!! XXX */
> > 							/* Start a 3-way call if feasible */
> > 							if ((ast->pbx) ||
> >@@ -3025,6 +3034,13 @@
> > 								if (!alloc_sub(p, SUB_THREEWAY)) {
> > 									/* Make new channel */
> > 									chan = zt_new(p, AST_STATE_RESERVED, 0, SUB_THREEWAY, 0, 0);
> >+									if (p->useincomingcalleridonzaptransfer) {
> >+										if (!p->origcallerid) {
> >+											p->origcallerid = malloc(strlen(p->callerid) + 1);
> >+											strncpy(p->origcallerid, p->callerid, strlen(p->callerid) + 1);
> >+										}
> >+										strncpy(p->callerid, callerid, sizeof(p->callerid) -1);
> >+									}
> > 									/* Swap things around between the three-way and real call */
> > 									swap_subs(p, SUB_THREEWAY, SUB_REAL);
> > 									/* Disable echo canceller for better dialing */
> >@@ -5303,6 +5319,7 @@
> > 		tmp->channel = channel;
> > 		tmp->stripmsd = stripmsd;
> > 		tmp->use_callerid = use_callerid;
> >+		tmp->useincomingcalleridonzaptransfer = useincomingcalleridonzaptransfer;
> > 		tmp->restrictcid = restrictcid;
> > 		tmp->use_callingpres = use_callingpres;
> > 		strncpy(tmp->accountcode, accountcode, sizeof(tmp->accountcode)-1);
> >@@ -7143,6 +7160,8 @@
> > 				strcpy(callerid,"");
> > 			else
> > 				strncpy(callerid, v->value, sizeof(callerid)-1);
> >+		} else if (!strcasecmp(v->name, "useincomingcalleridonzaptransfer")) {
> >+			useincomingcalleridonzaptransfer = ast_true(v->value);
> > 		} else if (!strcasecmp(v->name, "restrictcid")) {
> > 			restrictcid = ast_true(v->value);
> > 		} else if (!strcasecmp(v->name, "usecallingpres")) {
> >
> >_______________________________________________
> >Asterisk-Cvs mailing list
> >Asterisk-Cvs at lists.digium.com
> >http://lists.digium.com/mailman/listinfo/asterisk-cvs
> >
> >
>
>
> _______________________________________________
> Asterisk-Dev mailing list
> Asterisk-Dev at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-dev
>




More information about the asterisk-dev mailing list