diff -Nru asterisk-1.2.29/channels/chan_zap.c asterisk-1.2.29-cnet/channels/chan_zap.c --- asterisk-1.2.29/channels/chan_zap.c 2007-08-07 12:44:04.000000000 -0500 +++ asterisk-1.2.29-cnet/channels/chan_zap.c 2008-07-09 18:48:06.000000000 -0500 @@ -536,6 +536,9 @@ int priindication_oob; int radio; +#ifdef ZAPATA_CNET + int hearpulsing; /* FXO pulsing audible to caller */ +#endif }; /** returns a new zt_chan_conf with default values (by-value) */ @@ -665,7 +668,12 @@ * kept as the one without the comma. for the moment, * until we add all fields. */ - .radio = 0 + .radio = 0, + +#ifdef ZAPATA_CNET + /* Make FXO pulsing audible */ + .hearpulsing = 0 +#endif }; return chan_conf; @@ -750,6 +758,9 @@ unsigned int r2blocked:1; unsigned int sigchecked:1; #endif +#ifdef ZAPATA_CNET + unsigned int hearpulsing:1; /* FXO pulsing audible to caller */ +#endif struct zt_distRings drings; @@ -4810,10 +4821,19 @@ #if 0 ast_log(LOG_DEBUG, "Read %d of voice on %s\n", p->subs[index].f.datalen, ast->name); #endif +#ifdef ZAPATA_CNET + /* Let audio through when FXO is dialing if hearpulsing enabled */ + if ((!p->hearpulsing && (p->dialing || /* Transmitting something */ + (index && (ast->_state != AST_STATE_UP)))) || /* Three-way or callwait that isn't up */ + ((index == SUB_CALLWAIT) && !p->subs[SUB_CALLWAIT].inthreeway) /* Inactive and non-confed call-wait */ + ) +#else if (p->dialing || /* Transmitting something */ (index && (ast->_state != AST_STATE_UP)) || /* Three-way or callwait that isn't up */ ((index == SUB_CALLWAIT) && !p->subs[SUB_CALLWAIT].inthreeway) /* Inactive and non-confed call-wait */ - ) { + ) +#endif + { /* Whoops, we're still dialing, or in a state where we shouldn't transmit.... don't send anything */ p->subs[index].f.frametype = AST_FRAME_NULL; @@ -5425,7 +5445,11 @@ if (len && !ast_ignore_pattern(chan->context, exten)) tone_zone_play_tone(p->subs[index].zfd, -1); else +#ifdef ZAPATA_CNET + tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_SECONDDIALTONE); /* Secondary Dialtone */ +#else tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALTONE); +#endif if (ast_exists_extension(chan, chan->context, exten, 1, p->cid_num)) timeout = matchdigittimeout; else @@ -5716,7 +5740,11 @@ if (!ast_ignore_pattern(chan->context, exten)) tone_zone_play_tone(p->subs[index].zfd, -1); else +#ifdef ZAPATA_CNET + tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_SECONDDIALTONE); /* Secondary Dialtone */ +#else tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALTONE); +#endif if (ast_exists_extension(chan, chan->context, exten, 1, p->cid_num) && strcmp(exten, ast_parking_ext())) { if (!res || !ast_matchmore_extension(chan, chan->context, exten, 1, p->cid_num)) { if (getforward) { @@ -7331,6 +7359,9 @@ tmp->use_callingpres = chan_conf.use_callingpres; tmp->priindication_oob = chan_conf.priindication_oob; tmp->priexclusive = chan_conf.priexclusive; +#ifdef ZAPATA_CNET + tmp->hearpulsing = chan_conf.hearpulsing; /* Make FXO pulsing audible */ +#endif if (tmp->usedistinctiveringdetection) { if (!tmp->use_callerid) { ast_log(LOG_NOTICE, "Distinctive Ring detect requires 'usecallerid' be on\n"); @@ -9854,6 +9885,9 @@ ast_cli(fd, "Fax Handled: %s\n", tmp->faxhandled ? "yes" : "no"); ast_cli(fd, "Pulse phone: %s\n", tmp->pulsedial ? "yes" : "no"); ast_cli(fd, "Echo Cancellation: %d taps%s, currently %s\n", tmp->echocancel, tmp->echocanbridged ? "" : " unless TDM bridged", tmp->echocanon ? "ON" : "OFF"); +#ifdef ZAPATA_CNET + ast_cli(fd, "Caller Hears Pulsing: %s\n", tmp->hearpulsing ? "yes" : "no"); +#endif if (tmp->master) ast_cli(fd, "Master Channel: %d\n", tmp->master->channel); for (x=0;xvalue); } else if (!strcasecmp(v->name, "sendcalleridafter")) { chan_conf.sendcalleridafter = atoi(v->value); +#ifdef ZAPATA_CNET + } else if(!strcasecmp(v->name, "hearpulsing")) { + /* FXO pulsing audible to caller */ + chan_conf.hearpulsing = ast_true(v->value); +#endif } else if(!reload){ if (!strcasecmp(v->name, "signalling")) { if (!strcasecmp(v->value, "em")) { diff -Nru asterisk-1.2.29/configs/zapata.conf.sample asterisk-1.2.29-cnet/configs/zapata.conf.sample --- asterisk-1.2.29/configs/zapata.conf.sample 2006-09-18 10:05:56.000000000 -0500 +++ asterisk-1.2.29-cnet/configs/zapata.conf.sample 2008-07-09 18:40:20.000000000 -0500 @@ -40,6 +40,14 @@ ;spanmap => 4,1,4 [channels] +; CNET extra: the hearpulsing option allows a caller to hear +; an FXO port pick up a line and dial into it. This can be useful for +; debugging, or to allow a caller to hear a call get pulsed into an old +; step-by-step switch. In general, it should be applied on a per-channel +; basis. +; +; Default is: +; hearpulsing=no ; ; Default language ; diff -Nru asterisk-1.2.29/Makefile asterisk-1.2.29-cnet/Makefile --- asterisk-1.2.29/Makefile 2008-05-05 12:53:26.000000000 -0500 +++ asterisk-1.2.29-cnet/Makefile 2008-07-07 09:53:27.000000000 -0500 @@ -336,6 +336,9 @@ endif endif +# mark as a CNET version +ASTERISKVERSION:=${ASTERISKVERSION}-cnet + ASTCFLAGS+= $(DEBUG_THREADS) ASTCFLAGS+= $(TRACE_FRAMES) ASTCFLAGS+= $(MALLOC_DEBUG) diff -Nru asterisk-1.2.29/READMEFIRST.cnet asterisk-1.2.29-cnet/READMEFIRST.cnet --- asterisk-1.2.29/READMEFIRST.cnet 1969-12-31 18:00:00.000000000 -0600 +++ asterisk-1.2.29-cnet/READMEFIRST.cnet 2008-07-09 18:41:22.000000000 -0500 @@ -0,0 +1,24 @@ +asterisk-cnet: Asterisk modified for antique telephony purposes. + +Modifications by Russ Price , with help from Max Parke. + +This is a modified version of Digium's Asterisk that provides a couple +of features not provided in conventional Asterisk: + + * An option to allow incoming callers to hear a Zap channel pick up + an FXO port and dial into a switch + * A distinctive dial tone when using the "ignorepat" option in + extensions.conf. + +NOTE! This version SHOULD be used with the modified Zaptel driver +available at . See the READMEFIRST.cnet file +in the zaptel-cnet distribution for further details. If you compile it +against vanilla Zaptel, the hearpulsing option and secondary dial tone +will not be available. + +Latest Changes: +2008-07-09: Updated to 1.2.29. Set up chan_zap.c to honor ZAPATA_CNET + definition; added example of hearpulsing option in sample + zapata.conf file. +2008-05-30: Updated to 1.2.28.1. +2008-05-08: Updated to 1.2.28.