diff -Nru asterisk-certified-13.13-cert3/channels/chan_dahdi.c asterisk-cnet-13.13-cnet3/channels/chan_dahdi.c --- asterisk-certified-13.13-cert3/channels/chan_dahdi.c 2017-04-04 07:37:14.000000000 -0500 +++ asterisk-cnet-13.13-cnet3/channels/chan_dahdi.c 2017-05-12 18:42:16.069690402 -0500 @@ -65,13 +65,6 @@ #include #include -#include "sig_analog.h" -/* Analog signaling is currently still present in chan_dahdi for use with - * radio. Sig_analog does not currently handle any radio operations. If - * radio only uses analog signaling, then the radio handling logic could - * be placed in sig_analog and the duplicated code could be removed. - */ - #if defined(HAVE_PRI) #include "sig_pri.h" #ifndef PRI_RESTART @@ -132,6 +125,15 @@ #include "chan_dahdi.h" #include "dahdi/bridge_native_dahdi.h" +/* For CNET, we moved sig_analog.h here to better work with the CNET-modified DAHDI. */ +#include "sig_analog.h" +/* Analog signaling is currently still present in chan_dahdi for use with + * radio. Sig_analog does not currently handle any radio operations. If + * radio only uses analog signaling, then the radio handling logic could + * be placed in sig_analog and the duplicated code could be removed. + */ + + /*** DOCUMENTATION @@ -1053,6 +1055,9 @@ .buf_no = numbufs, .usefaxbuffers = 0, .cc_params = ast_cc_config_params_init(), +#ifdef DAHDI_CNET + .hearpulsing = 0, +#endif }, .timing = { .prewinktime = -1, @@ -1169,7 +1174,6 @@ } } - static int analog_tone_to_dahditone(enum analog_tone tone) { switch (tone) { @@ -1185,6 +1189,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; } @@ -8682,10 +8690,18 @@ #if 0 ast_debug(1, "Read %d of voice on %s\n", p->subs[idx].f.datalen, ast->name); #endif +#ifdef DAHDI_CNET + if ((!p->hearpulsing && ((p->dialing && !p->waitingfordt.tv_sec) || p->radio || /* Transmitting something */ + (idx && (ast_channel_state(ast) != 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->waitingfordt.tv_sec) || p->radio || /* Transmitting something */ (idx && (ast_channel_state(ast) != 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; @@ -9829,7 +9845,11 @@ if (!ast_ignore_pattern(ast_channel_context(chan), exten)) { tone_zone_play_tone(p->subs[idx].dfd, -1); } else { - tone_zone_play_tone(p->subs[idx].dfd, DAHDI_TONE_DIALTONE); +#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_parking_provider_registered()) { is_exten_parking = ast_parking_is_exten_park(ast_channel_context(chan), exten); @@ -12621,6 +12641,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"); @@ -15519,6 +15542,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++) { @@ -18031,6 +18057,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-certified-13.13-cert3/channels/chan_dahdi.h asterisk-cnet-13.13-cnet3/channels/chan_dahdi.h --- asterisk-certified-13.13-cert3/channels/chan_dahdi.h 2017-04-04 07:37:14.000000000 -0500 +++ asterisk-cnet-13.13-cnet3/channels/chan_dahdi.h 2017-05-12 18:42:16.072690401 -0500 @@ -57,6 +57,8 @@ #define SUB_CALLWAIT 1 /*!< Call-Waiting call on hold */ #define SUB_THREEWAY 2 /*!< Three-way call */ +/* CNET: Moved from sig_analog.h to make this work with DAHDI_CNET definition */ +#define READ_SIZE 160 struct distRingData { int ring[3]; @@ -424,6 +426,9 @@ struct sig_pri_span *pri; int logicalspan; #endif /* defined(HAVE_PRI) */ +#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 diff -Nru asterisk-certified-13.13-cert3/channels/sig_analog.c asterisk-cnet-13.13-cnet3/channels/sig_analog.c --- asterisk-certified-13.13-cert3/channels/sig_analog.c 2017-04-04 07:37:14.000000000 -0500 +++ asterisk-cnet-13.13-cnet3/channels/sig_analog.c 2017-05-12 18:42:16.076690399 -0500 @@ -47,6 +47,9 @@ #include "asterisk/bridge.h" #include "asterisk/parking.h" +/* (CNET) Need this to determine if we have secondary dialtone */ +#include + #include "sig_analog.h" /*** DOCUMENTATION @@ -2105,7 +2108,11 @@ if (!ast_ignore_pattern(ast_channel_context(chan), 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_parking_provider_registered()) { is_exten_parking = ast_parking_is_exten_park(ast_channel_context(chan), exten); diff -Nru asterisk-certified-13.13-cert3/channels/sig_analog.h asterisk-cnet-13.13-cnet3/channels/sig_analog.h --- asterisk-certified-13.13-cert3/channels/sig_analog.h 2017-04-04 07:37:14.000000000 -0500 +++ asterisk-cnet-13.13-cnet3/channels/sig_analog.h 2017-05-12 18:42:16.078690398 -0500 @@ -31,9 +31,10 @@ #define ANALOG_SMDI_MD_WAIT_TIMEOUT 1500 /* 1.5 seconds */ #define ANALOG_MAX_CID 300 -#define READ_SIZE 160 #define RING_PATTERNS 3 +/* READ_SIZE has been moved to chan_dahdi.h for CNET purposes. */ + /* Signalling types supported */ enum analog_sigtype { ANALOG_SIG_NONE = -1, @@ -67,6 +68,9 @@ ANALOG_TONE_DIALTONE, ANALOG_TONE_DIALRECALL, ANALOG_TONE_INFO, +#ifdef DAHDI_CNET + ANALOG_TONE_SECONDDIALTONE, +#endif }; enum analog_event { diff -Nru asterisk-certified-13.13-cert3/configs/samples/chan_dahdi.conf.sample asterisk-cnet-13.13-cnet3/configs/samples/chan_dahdi.conf.sample --- asterisk-certified-13.13-cert3/configs/samples/chan_dahdi.conf.sample 2017-04-04 07:37:14.000000000 -0500 +++ asterisk-cnet-13.13-cnet3/configs/samples/chan_dahdi.conf.sample 2017-05-12 18:42:16.081690397 -0500 @@ -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-certified-13.13-cert3/READMEFIRST.cnet asterisk-cnet-13.13-cnet3/READMEFIRST.cnet --- asterisk-certified-13.13-cert3/READMEFIRST.cnet 1969-12-31 18:00:00.000000000 -0600 +++ asterisk-cnet-13.13-cnet3/READMEFIRST.cnet 2017-05-12 18:48:03.937493781 -0500 @@ -0,0 +1,100 @@ +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: +2017-05-12: Updated to 13.13-cnet3. The hearpulsing patch is + now deprecated. There were more issues than that + #ifdef, and the best I could manage was to get + a short burst of dial tone after picking up an + FXO port. +2017-03-17: Updated to 13.13-cnet2. + This is based on asterisk-certified-13.13-cert2. + The imminent demise of CentOS 5 forced me to confront + the overall obsolescence of my modifications and finally + update this to the modern world. :) + In bringing the patches to 13.13-cert2, I also discovered + that my hearpulsing patch had the wrong #ifdef sense... + so hearpulsing is BACK after a long absence! +2016-04-10: Updated to 1.8.32.3. +2014-11-21: Updated to 1.8.32.0. +2014-09-22: Updated to 1.8.30.0. +2014-08-13: Updated to 1.8.29.0. Yeah, I know... +2012-07-09: Updated to 1.8.22.0. +2012-06-07: Updated to 1.8.13.0. +2012-04-25: Updated to 1.8.11.1. +2012-04-09: Updated to 1.8.11.0. +2012-03-16: Updated to 1.8.10.1. +2012-03-12: Updated to 1.8.10.0. +2012-03-01: Updated to 1.8.9.3. +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). diff -Nru asterisk-certified-13.13-cert3/.version asterisk-cnet-13.13-cnet3/.version --- asterisk-certified-13.13-cert3/.version 2017-04-04 07:37:14.000000000 -0500 +++ asterisk-cnet-13.13-cnet3/.version 2017-05-12 18:44:06.364623942 -0500 @@ -1 +1 @@ -certified/13.13-cert3 \ No newline at end of file +cnet/13.13-cnet3 \ No newline at end of file