diff -Nru asterisk-1.4.39.2/channels/chan_dahdi.c asterisk-cnet-1.4.39.2/channels/chan_dahdi.c --- asterisk-1.4.39.2/channels/chan_dahdi.c 2010-11-24 16:41:07.000000000 -0600 +++ asterisk-cnet-1.4.39.2/channels/chan_dahdi.c 2011-02-25 15:51:06.000000000 -0600 @@ -692,6 +692,9 @@ * \note Set from the "usesmdi" value read in from chan_dahdi.conf */ unsigned int use_smdi:1; +#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; @@ -981,6 +984,7 @@ .buf_policy = DAHDI_POLICY_IMMEDIATE, .buf_no = numbufs, + .hearpulsing = 0, }, .timing = { .prewinktime = -1, @@ -5602,10 +5606,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; @@ -6246,7 +6260,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 @@ -6601,7 +6619,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 @@ -8353,6 +8375,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"); @@ -11114,6 +11139,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++) { @@ -11990,6 +12018,11 @@ 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); +#endif } else if (reload != 1) { if (!strcasecmp(v->name, "signalling") || !strcasecmp(v->name, "signaling")) { confp->chan.outsigmod = -1; diff -Nru asterisk-1.4.39.2/configs/chan_dahdi.conf.sample asterisk-cnet-1.4.39.2/configs/chan_dahdi.conf.sample --- asterisk-1.4.39.2/configs/chan_dahdi.conf.sample 2010-04-27 13:14:54.000000000 -0500 +++ asterisk-cnet-1.4.39.2/configs/chan_dahdi.conf.sample 2011-02-25 15:51:06.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.39.2/include/asterisk/dahdi_compat.h asterisk-cnet-1.4.39.2/include/asterisk/dahdi_compat.h --- asterisk-1.4.39.2/include/asterisk/dahdi_compat.h 2009-02-13 15:53:16.000000000 -0600 +++ asterisk-cnet-1.4.39.2/include/asterisk/dahdi_compat.h 2011-02-25 15:51:06.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.39.2/Makefile asterisk-cnet-1.4.39.2/Makefile --- asterisk-1.4.39.2/Makefile 2010-12-07 16:35:50.000000000 -0600 +++ asterisk-cnet-1.4.39.2/Makefile 2011-02-25 15:51:06.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.39.2/READMEFIRST.cnet asterisk-cnet-1.4.39.2/READMEFIRST.cnet --- asterisk-1.4.39.2/READMEFIRST.cnet 1969-12-31 18:00:00.000000000 -0600 +++ asterisk-cnet-1.4.39.2/READMEFIRST.cnet 2011-02-25 15:51:44.000000000 -0600 @@ -0,0 +1,40 @@ +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 a couple +of 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. + +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-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).