diff -Nru asterisk-1.8.8.1/channels/chan_dahdi.c asterisk-cnet-1.8.8.1/channels/chan_dahdi.c --- asterisk-1.8.8.1/channels/chan_dahdi.c 2011-09-30 17:05:10.000000000 -0500 +++ asterisk-cnet-1.8.8.1/channels/chan_dahdi.c 2011-12-31 21:06:16.000000000 -0600 @@ -970,6 +970,9 @@ struct sig_pri_span *pri; int logicalspan; #endif +#ifdef DAHDI_CNET + unsigned int hearpulsing:1; /* FXO pulsing audible to caller */ +#endif /*! * \brief TRUE if SMDI (Simplified Message Desk Interface) is enabled * \note Set from the "usesmdi" value read in from chan_dahdi.conf @@ -1451,6 +1454,9 @@ .buf_no = numbufs, .usefaxbuffers = 0, .cc_params = ast_cc_config_params_init(), +#ifdef DAHDI_CNET + .hearpulsing = 0, +#endif }, .timing = { .prewinktime = -1, @@ -1612,6 +1618,10 @@ return DAHDI_TONE_DIALRECALL; case ANALOG_TONE_INFO: return DAHDI_TONE_INFO; +#ifdef DAHDI_CNET + case ANALOG_TONE_SECONDDIALTONE: + return DAHDI_TONE_SECONDDIALTONE; +#endif default: return -1; } @@ -9059,10 +9069,19 @@ #if 0 ast_debug(1, "Read %d of voice on %s\n", p->subs[idx].f.datalen, ast->name); #endif +#ifdef DAHDI_CNET + /* Let audio through when FXO is dialing if hearpulsing enabled */ + if ((!p->hearpulsing && (p->dialing || p->radio || /* Transmitting something */ + (idx && (ast->_state != AST_STATE_UP)))) || /* Three-way or callwait that isn't up */ + ((idx == SUB_CALLWAIT) && !p->subs[SUB_CALLWAIT].inthreeway) /* Inactive and non-confed call-wait */ + ) +#else if (p->dialing || p->radio || /* Transmitting something */ (idx && (ast->_state != AST_STATE_UP)) || /* Three-way or callwait that isn't up */ ((idx == 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[idx].f.frametype = AST_FRAME_NULL; @@ -10097,7 +10116,11 @@ if (!ast_ignore_pattern(chan->context, exten)) tone_zone_play_tone(p->subs[idx].dfd, -1); else +#ifdef DAHDI_CNET + tone_zone_play_tone(p->subs[idx].dfd, DAHDI_TONE_SECONDDIALTONE); +#else tone_zone_play_tone(p->subs[idx].dfd, DAHDI_TONE_DIALTONE); +#endif if (ast_exists_extension(chan, chan->context, exten, 1, p->cid_num) && !ast_parking_ext_valid(exten, chan, chan->context)) { if (!res || !ast_matchmore_extension(chan, chan->context, exten, 1, p->cid_num)) { if (getforward) { @@ -12682,6 +12705,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"); @@ -15229,6 +15255,9 @@ ast_cli(a->fd, "\tnone\n"); } ast_cli(a->fd, "Wait for dialtone: %dms\n", tmp->waitfordialtone); +#ifdef DAHDI_CNET + ast_cli(a->fd, "Caller Hears Pulsing: %s\n", tmp->hearpulsing ? "yes" : "no"); +#endif if (tmp->master) ast_cli(a->fd, "Master Channel: %d\n", tmp->master->channel); for (x = 0; x < MAX_SLAVES; x++) { @@ -17014,6 +17043,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 (!strcasecmp(v->name, "mwimonitornotify")) { ast_copy_string(mwimonitornotify, v->value, sizeof(mwimonitornotify)); } else if (ast_cc_is_config_param(v->name)) { diff -Nru asterisk-1.8.8.1/channels/sig_analog.c asterisk-cnet-1.8.8.1/channels/sig_analog.c --- asterisk-1.8.8.1/channels/sig_analog.c 2011-08-03 08:38:17.000000000 -0500 +++ asterisk-cnet-1.8.8.1/channels/sig_analog.c 2011-12-31 21:06:16.000000000 -0600 @@ -40,6 +40,9 @@ #include "asterisk/cel.h" #include "asterisk/causes.h" +/* (CNET) Need this to determine if we have secondary dialtone */ +#include + #include "sig_analog.h" /*! \note @@ -2107,7 +2110,11 @@ if (!ast_ignore_pattern(chan->context, exten)) { analog_play_tone(p, idx, -1); } else { +#ifdef DAHDI_CNET + analog_play_tone(p, idx, ANALOG_TONE_SECONDDIALTONE); +#else analog_play_tone(p, idx, ANALOG_TONE_DIALTONE); +#endif } if (ast_exists_extension(chan, chan->context, exten, 1, p->cid_num) && !ast_parking_ext_valid(exten, chan, chan->context)) { if (!res || !ast_matchmore_extension(chan, chan->context, exten, 1, p->cid_num)) { diff -Nru asterisk-1.8.8.1/channels/sig_analog.h asterisk-cnet-1.8.8.1/channels/sig_analog.h --- asterisk-1.8.8.1/channels/sig_analog.h 2010-11-24 16:49:48.000000000 -0600 +++ asterisk-cnet-1.8.8.1/channels/sig_analog.h 2011-12-31 21:06:16.000000000 -0600 @@ -67,6 +67,9 @@ ANALOG_TONE_DIALTONE, ANALOG_TONE_DIALRECALL, ANALOG_TONE_INFO, +#ifdef DAHDI_CNET + ANALOG_TONE_SECONDDIALTONE, +#endif }; enum analog_event { diff -Nru asterisk-1.8.8.1/configs/chan_dahdi.conf.sample asterisk-cnet-1.8.8.1/configs/chan_dahdi.conf.sample --- asterisk-1.8.8.1/configs/chan_dahdi.conf.sample 2011-08-17 10:51:08.000000000 -0500 +++ asterisk-cnet-1.8.8.1/configs/chan_dahdi.conf.sample 2011-12-31 21:06:16.000000000 -0600 @@ -46,6 +46,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.8.8.1/Makefile asterisk-cnet-1.8.8.1/Makefile --- asterisk-1.8.8.1/Makefile 2011-10-04 17:54:15.000000000 -0500 +++ asterisk-cnet-1.8.8.1/Makefile 2011-12-31 21:06:16.000000000 -0600 @@ -261,6 +261,9 @@ ASTERISKVERSIONNUM:=999999 endif +# mark as a CNET version +ASTERISKVERSION:=${ASTERISKVERSION}-cnet + _ASTCFLAGS+=$(OPTIONS) MOD_SUBDIRS:=channels pbx apps codecs formats cdr cel bridges funcs tests main res addons $(LOCAL_MOD_SUBDIRS) diff -Nru asterisk-1.8.8.1/READMEFIRST.cnet asterisk-cnet-1.8.8.1/READMEFIRST.cnet --- asterisk-1.8.8.1/READMEFIRST.cnet 1969-12-31 18:00:00.000000000 -0600 +++ asterisk-cnet-1.8.8.1/READMEFIRST.cnet 2011-12-31 21:06:33.000000000 -0600 @@ -0,0 +1,76 @@ +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-31: Updated to 1.8.8.1 +2011-12-16: Updated to 1.8.8.0. +2011-12-10: Updated to 1.8.7.2. +2011-10-25: Updated to 1.8.7.1. +2011-09-30: Updated to 1.8.7.0. +2011-09-01: Updated to 1.8.6.0. +2011-07-27: First 1.8 release: 1.8.5.0. +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).