diff -Nru asterisk-1.4.43/channels/chan_dahdi.c asterisk-cnet-1.4.43/channels/chan_dahdi.c --- asterisk-1.4.43/channels/chan_dahdi.c 2011-04-11 10:27:52.000000000 -0500 +++ asterisk-cnet-1.4.43/channels/chan_dahdi.c 2011-12-10 07:40:32.000000000 -0600 @@ -728,6 +728,9 @@ /*! Call establishment life cycle level for simple comparisons. */ enum dahdi_call_level call_level; #endif +#ifdef DAHDI_CNET + unsigned int hearpulsing:1; /* FXO pulsing audible to caller */ +#endif /*! \brief The serial port to listen for SMDI data on */ struct ast_smdi_interface *smdi_iface; @@ -1017,6 +1020,7 @@ .buf_policy = DAHDI_POLICY_IMMEDIATE, .buf_no = numbufs, + .hearpulsing = 0, }, .timing = { .prewinktime = -1, @@ -5681,10 +5685,20 @@ #if 0 ast_log(LOG_DEBUG, "Read %d of voice on %s\n", p->subs[index].f.datalen, ast->name); #endif - 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 */ - ) { +#ifdef DAHDI_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; @@ -6364,7 +6378,11 @@ if (len && !ast_ignore_pattern(chan->context, exten)) tone_zone_play_tone(p->subs[index].dfd, -1); else +#ifdef DAHDI_CNET + tone_zone_play_tone(p->subs[index].dfd, DAHDI_TONE_SECONDDIALTONE); +#else tone_zone_play_tone(p->subs[index].dfd, DAHDI_TONE_DIALTONE); +#endif if (ast_exists_extension(chan, chan->context, exten, 1, p->cid_num)) timeout = matchdigittimeout; else @@ -6740,7 +6758,11 @@ if (!ast_ignore_pattern(chan->context, exten)) tone_zone_play_tone(p->subs[index].dfd, -1); else +#ifdef DAHDI_CNET + tone_zone_play_tone(p->subs[index].dfd, DAHDI_TONE_SECONDDIALTONE); +#else tone_zone_play_tone(p->subs[index].dfd, DAHDI_TONE_DIALTONE); +#endif if (!strcmp(exten,ast_pickup_ext())) { /* Scan all channels and see if there are any * ringing channels that have call groups @@ -8498,6 +8520,9 @@ tmp->dahditrcallerid = conf->chan.dahditrcallerid; tmp->restrictcid = conf->chan.restrictcid; tmp->use_callingpres = conf->chan.use_callingpres; +#ifdef DAHDI_CNET + tmp->hearpulsing = conf->chan.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"); @@ -11815,6 +11840,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 DAHDI_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; x < MAX_SLAVES; x++) { @@ -12693,6 +12721,23 @@ confp->chan.hanguponpolarityswitch = ast_true(v->value); } else if (!strcasecmp(v->name, "sendcalleridafter")) { confp->chan.sendcalleridafter = atoi(v->value); +#ifdef DAHDI_CNET + } else if(!strcasecmp(v->name, "hearpulsing")) { + /* FXO pulsing audible to caller */ + confp->chan.hearpulsing = ast_true(v->value); + } else if(!strcasecmp(v->name, "global_firstdigittimeout")) { + y = atoi(v->value); + ast_log(LOG_DEBUG, "Setting global firstdigittimeout to %d\n", y); + firstdigittimeout = y; + } else if(!strcasecmp(v->name, "global_gendigittimeout")) { + y = atoi(v->value); + ast_log(LOG_DEBUG, "Setting global gendigittimeout to %d\n", y); + gendigittimeout = y; + } else if(!strcasecmp(v->name, "global_matchdigittimeout")) { + y = atoi(v->value); + ast_log(LOG_DEBUG, "Setting global matchdigittimeout to %d\n", y); + matchdigittimeout = y; +#endif } else if (reload != 1) { if (!strcasecmp(v->name, "signalling") || !strcasecmp(v->name, "signaling")) { confp->chan.outsigmod = -1; diff -Nru asterisk-1.4.43/configs/chan_dahdi.conf.sample asterisk-cnet-1.4.43/configs/chan_dahdi.conf.sample --- asterisk-1.4.43/configs/chan_dahdi.conf.sample 2010-04-27 13:14:54.000000000 -0500 +++ asterisk-cnet-1.4.43/configs/chan_dahdi.conf.sample 2011-12-10 07:40:32.000000000 -0600 @@ -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.4.43/include/asterisk/dahdi_compat.h asterisk-cnet-1.4.43/include/asterisk/dahdi_compat.h --- asterisk-1.4.43/include/asterisk/dahdi_compat.h 2009-02-13 15:53:16.000000000 -0600 +++ asterisk-cnet-1.4.43/include/asterisk/dahdi_compat.h 2011-12-10 07:40:32.000000000 -0600 @@ -410,6 +410,9 @@ #if defined(ZT_TONE_DIALTONE) #define DAHDI_TONE_DIALTONE ZT_TONE_DIALTONE #endif +#if defined(ZT_TONE_SECONDDIALTONE) +#define DAHDI_TONE_SECONDDIALTONE ZT_TONE_SECONDDIALTONE +#endif #if defined(ZT_TONE_DTMF_BASE) #define DAHDI_TONE_DTMF_BASE ZT_TONE_DTMF_BASE #endif diff -Nru asterisk-1.4.43/Makefile asterisk-cnet-1.4.43/Makefile --- asterisk-1.4.43/Makefile 2010-12-07 16:35:50.000000000 -0600 +++ asterisk-cnet-1.4.43/Makefile 2011-12-10 07:40:32.000000000 -0600 @@ -266,6 +266,9 @@ ASTERISKVERSIONNUM=999999 endif +# mark as a CNET version +ASTERISKVERSION:=${ASTERISKVERSION}-cnet + _ASTCFLAGS+=$(BUSYDETECT)$(OPTIONS) MOD_SUBDIRS:=res channels pbx apps codecs formats cdr funcs tests main diff -Nru asterisk-1.4.43/READMEFIRST.cnet asterisk-cnet-1.4.43/READMEFIRST.cnet --- asterisk-1.4.43/READMEFIRST.cnet 1969-12-31 18:00:00.000000000 -0600 +++ asterisk-cnet-1.4.43/READMEFIRST.cnet 2011-12-10 07:40:55.000000000 -0600 @@ -0,0 +1,70 @@ +asterisk-cnet: Asterisk modified for antique telephony purposes. +Modifications by Russ Price , with help from Max Parke. + +DISCLAIMER: This modified version of Asterisk is UNSUPPORTED BY DIGIUM. + +This is a modified version of Digium's Asterisk that provides several +features not provided in official version: + + * An option to allow incoming callers to hear a DAHDI channel pick up + an FXO port and dial into a switch + * A distinctive dial tone when using the "ignorepat" option in + extensions.conf. + * The ability to set timeout values that are hard-coded in the + Digium chan_dahdi module. The following may be set in the [channels] + section of chan_dahdi.conf; all values are in milliseconds: + global_firstdigittimeout: Timeout for the channel to + receive the first digit. Default is 16000. + global_gendigittimeout: Timeout for the channel to + receive subsequent digits. Default is 8000. + global_matchdigittimeout: Timeout for the channel to + wait for extra digits when there is an ambiguous match. + Default is 3000. + These values are GLOBAL; they apply to ALL channels, even though + they go in the [channels] section. + + Note that if you remove the settings from chan_dahdi.conf, you + will need to restart Asterisk to change the settings back to the + defaults. + + Example: + + [channels] + global_firstdigittimeout=30000 + global_gendigittimeout=10000 + global_matchdigittimeout=2000 + +NOTE! This version MUST be used with the modified DAHDI driver +available at . See the READMEFIRST.cnet file +in the dahdi-cnet distribution for further details. If you compile it +against vanilla DAHDI, the CNET features will be unavailable. + +Latest Changes: +2011-12-10: Updated to 1.4.43. +2011-07-01: Updated to 1.4.42. +2011-06-27: Updated to 1.4.41.1. +2011-05-13: Updated to 1.4.41. +2011-04-01: Added global_firstdigittimeout, global_gendigittimeout, and + global_matchdigittimeout options to chan_dahdi.conf. +2011-03-09: Updated to 1.4.40. +2011-02-25: Updated to 1.4.39.2. +2011-02-09: Updated to 1.4.39.1. +2010-12-16: Updated to 1.4.38. +2010-10-13: Updated to 1.4.36. +2010-07-16: Updated to 1.4.33.1. +2010-06-15: Updated to 1.4.32. +2010-05-04: Updated to 1.4.31. +2010-04-16: Updated to 1.4.30. +2010-01-20: Updated to 1.4.29. +2010-01-07: Updated to 1.4.28. +2009-12-12: Updated to 1.4.27.1. +2009-11-19: Updated to 1.4.27. +2009-11-06: Updated to 1.4.26.3. +2009-09-13: Updated to 1.4.26.2. + See http://downloads.asterisk.org/pub/security/AST-2009-006.html + for information about IAX2 protocol change. +2009-08-10: Updated to 1.4.26.1. +2009-07-24: Updated to 1.4.26. +2009-07-15: Respin of 1.4.25.1 with fixed dahdi_compat.h to fix + compilation with zaptel-cnet. +2009-06-24: First 1.4 version (1.4.25.1).