# HG changeset patch # User sgutierrez # Date 1298919853 7200 # Node ID 82303412d9501e02e22855a705a64a9191525b7c # Parent 3f4ce6a34df0c0ba0faedbdf2db9f7dcdcc3c8d6 cambio la forma de generar el DTMF CID Level, ahora es por canal y no global, esto permite que si por ejemplo usamos una base telular con ahorro de energia poder seterale mas alto el valor y que no moleste a los demas canales que lo necesitan mas bajo. diff -r 3f4ce6a34df0 -r 82303412d950 channels/chan_dahdi.c --- a/channels/chan_dahdi.c Mon Feb 28 16:12:38 2011 -0200 +++ b/channels/chan_dahdi.c Mon Feb 28 17:04:13 2011 -0200 @@ -313,7 +313,7 @@ static int numbufs = 4; static int mwilevel = 512; -static int dtmfcid_level = 256; + #ifdef HAVE_PRI static struct ast_channel inuse; @@ -1055,6 +1055,7 @@ time_t guardtime; /*!< Must wait this much time before using for new call */ int cid_signalling; /*!< CID signalling type bell202 or v23 */ int cid_start; /*!< CID start indicator, polarity or ring or DTMF without warning event */ + int dtmfcid_level; int dtmfcid_holdoff_state; /*!< State indicator that allows for line to settle before checking for dtmf energy */ struct timeval dtmfcid_delay; /*!< Time value used for allow line to settle */ @@ -1356,6 +1357,7 @@ .cid_signalling = CID_SIG_BELL, .cid_start = CID_START_RING, + .dtmfcid_level = 400, .dahditrcallerid = 0, .use_callerid = 1, .sig = -1, @@ -10127,7 +10129,7 @@ } } else { energy = calc_energy((unsigned char *) buf, res, AST_LAW(i)); - if (!i->mwisendactive && energy > dtmfcid_level) { + if (!i->mwisendactive && energy > i->dtmfcid_level) { pthread_t threadid; struct ast_channel *chan; ast_mutex_unlock(&iflock); @@ -10943,6 +10945,7 @@ tmp->use_callerid = conf->chan.use_callerid; tmp->cid_signalling = conf->chan.cid_signalling; tmp->cid_start = conf->chan.cid_start; + tmp->dtmfcid_level = conf->chan.dtmfcid_level; tmp->dahditrcallerid = conf->chan.dahditrcallerid; tmp->restrictcid = conf->chan.restrictcid; tmp->use_callingpres = conf->chan.use_callingpres; @@ -16842,6 +16845,8 @@ confp->chan.cid_start = CID_START_DTMF_NOALERT; else if (ast_true(v->value)) confp->chan.cid_start = CID_START_RING; + } else if (!strcasecmp(v->name, "dtmfcidlevel")) { + confp->chan.dtmfcid_level = atoi(v->value); } else if (!strcasecmp(v->name, "threewaycalling")) { confp->chan.threewaycalling = ast_true(v->value); } else if (!strcasecmp(v->name, "cancallforward")) { @@ -17680,8 +17685,6 @@ ast_copy_string(defaultozz, v->value, sizeof(defaultozz)); } else if (!strcasecmp(v->name, "mwilevel")) { mwilevel = atoi(v->value); - } else if (!strcasecmp(v->name, "dtmfcidlevel")) { - dtmfcid_level = atoi(v->value); } } else if (!(options & PROC_DAHDI_OPT_NOWARN) ) ast_log(LOG_WARNING, "Ignoring any changes to '%s' (on reload) at line %d.\n", v->name, v->lineno);