Rename very poorly named function to reflect what it actually does. This was causing quite a bit of confusion for me...

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@110132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.1
Jason Parker 18 years ago
parent 515ec9d92f
commit 8d4276578a

@ -1513,7 +1513,7 @@ static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state)
i->dsp = ast_dsp_new(); i->dsp = ast_dsp_new();
ast_dsp_set_features(i->dsp,DSP_FEATURE_DTMF_DETECT); ast_dsp_set_features(i->dsp,DSP_FEATURE_DTMF_DETECT);
/* this is to prevent clipping of dtmf tones during dsp processing */ /* this is to prevent clipping of dtmf tones during dsp processing */
ast_dsp_digitmode(i->dsp, DSP_DIGITMODE_NOQUELCH); ast_dsp_set_digitmode(i->dsp, DSP_DIGITMODE_NOQUELCH);
} else { } else {
i->dsp = NULL; i->dsp = NULL;
} }

@ -5319,7 +5319,7 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit
i->vad = ast_dsp_new(); i->vad = ast_dsp_new();
ast_dsp_set_features(i->vad, DSP_FEATURE_DTMF_DETECT); ast_dsp_set_features(i->vad, DSP_FEATURE_DTMF_DETECT);
if (global_relaxdtmf) if (global_relaxdtmf)
ast_dsp_digitmode(i->vad, DSP_DIGITMODE_DTMF | DSP_DIGITMODE_RELAXDTMF); ast_dsp_set_digitmode(i->vad, DSP_DIGITMODE_DTMF | DSP_DIGITMODE_RELAXDTMF);
} }
/* Set file descriptors for audio, video, realtime text and UDPTL as needed */ /* Set file descriptors for audio, video, realtime text and UDPTL as needed */

@ -2285,7 +2285,7 @@ static struct chan_usbradio_pvt *store_config(struct ast_config *cfg, char *ctg)
o->dsp = ast_dsp_new(); o->dsp = ast_dsp_new();
if (o->dsp) { if (o->dsp) {
ast_dsp_set_features(o->dsp, DSP_FEATURE_DTMF_DETECT); ast_dsp_set_features(o->dsp, DSP_FEATURE_DTMF_DETECT);
ast_dsp_digitmode(o->dsp, DSP_DIGITMODE_DTMF | DSP_DIGITMODE_MUTECONF | DSP_DIGITMODE_RELAXDTMF); ast_dsp_set_digitmode(o->dsp, DSP_DIGITMODE_DTMF | DSP_DIGITMODE_MUTECONF | DSP_DIGITMODE_RELAXDTMF);
} }
if (o->rxctcssfreq != 0 && o->rxdemod == RX_AUDIO_SPEAKER) if (o->rxctcssfreq != 0 && o->rxdemod == RX_AUDIO_SPEAKER)

@ -1634,9 +1634,9 @@ static struct vpb_pvt *mkif(int board, int channel, int mode, int gains, float t
if (use_ast_dtmfdet) { if (use_ast_dtmfdet) {
tmp->vad = ast_dsp_new(); tmp->vad = ast_dsp_new();
ast_dsp_set_features(tmp->vad, DSP_FEATURE_DTMF_DETECT); ast_dsp_set_features(tmp->vad, DSP_FEATURE_DTMF_DETECT);
ast_dsp_digitmode(tmp->vad, DSP_DIGITMODE_DTMF); ast_dsp_set_digitmode(tmp->vad, DSP_DIGITMODE_DTMF);
if (relaxdtmf) if (relaxdtmf)
ast_dsp_digitmode(tmp->vad, DSP_DIGITMODE_DTMF|DSP_DIGITMODE_RELAXDTMF); ast_dsp_set_digitmode(tmp->vad, DSP_DIGITMODE_DTMF|DSP_DIGITMODE_RELAXDTMF);
} else { } else {
tmp->vad = NULL; tmp->vad = NULL;
} }

@ -3000,7 +3000,7 @@ static int zt_hangup(struct ast_channel *ast)
p->origcid_name = NULL; p->origcid_name = NULL;
} }
if (p->dsp) if (p->dsp)
ast_dsp_digitmode(p->dsp,DSP_DIGITMODE_DTMF | p->dtmfrelax); ast_dsp_set_digitmode(p->dsp, DSP_DIGITMODE_DTMF | p->dtmfrelax);
if (p->exten) if (p->exten)
p->exten[0] = '\0'; p->exten[0] = '\0';
@ -3452,15 +3452,15 @@ static int zt_setoption(struct ast_channel *chan, int option, void *data, int da
switch (*cp) { switch (*cp) {
case 1: case 1:
ast_debug(1, "Set option TONE VERIFY, mode: MUTECONF(1) on %s\n",chan->name); ast_debug(1, "Set option TONE VERIFY, mode: MUTECONF(1) on %s\n",chan->name);
ast_dsp_digitmode(p->dsp,DSP_DIGITMODE_MUTECONF | p->dtmfrelax); /* set mute mode if desired */ ast_dsp_set_digitmode(p->dsp, DSP_DIGITMODE_MUTECONF | p->dtmfrelax); /* set mute mode if desired */
break; break;
case 2: case 2:
ast_debug(1, "Set option TONE VERIFY, mode: MUTECONF/MAX(2) on %s\n",chan->name); ast_debug(1, "Set option TONE VERIFY, mode: MUTECONF/MAX(2) on %s\n",chan->name);
ast_dsp_digitmode(p->dsp,DSP_DIGITMODE_MUTECONF | DSP_DIGITMODE_MUTEMAX | p->dtmfrelax); /* set mute mode if desired */ ast_dsp_set_digitmode(p->dsp, DSP_DIGITMODE_MUTECONF | DSP_DIGITMODE_MUTEMAX | p->dtmfrelax); /* set mute mode if desired */
break; break;
default: default:
ast_debug(1, "Set option TONE VERIFY, mode: OFF(0) on %s\n",chan->name); ast_debug(1, "Set option TONE VERIFY, mode: OFF(0) on %s\n",chan->name);
ast_dsp_digitmode(p->dsp,DSP_DIGITMODE_DTMF | p->dtmfrelax); /* set mute mode if desired */ ast_dsp_set_digitmode(p->dsp, DSP_DIGITMODE_DTMF | p->dtmfrelax); /* set mute mode if desired */
break; break;
} }
break; break;
@ -3543,7 +3543,7 @@ static int zt_setoption(struct ast_channel *chan, int option, void *data, int da
cp = (char *) data; cp = (char *) data;
ast_debug(1, "Set option RELAX DTMF, value: %s(%d) on %s\n", ast_debug(1, "Set option RELAX DTMF, value: %s(%d) on %s\n",
*cp ? "ON" : "OFF", (int) *cp, chan->name); *cp ? "ON" : "OFF", (int) *cp, chan->name);
ast_dsp_digitmode(p->dsp, ((*cp) ? DSP_DIGITMODE_RELAXDTMF : DSP_DIGITMODE_DTMF) | p->dtmfrelax); ast_dsp_set_digitmode(p->dsp, ((*cp) ? DSP_DIGITMODE_RELAXDTMF : DSP_DIGITMODE_DTMF) | p->dtmfrelax);
break; break;
case AST_OPTION_AUDIO_MODE: /* Set AUDIO mode (or not) */ case AST_OPTION_AUDIO_MODE: /* Set AUDIO mode (or not) */
cp = (char *) data; cp = (char *) data;
@ -5930,7 +5930,7 @@ static struct ast_channel *zt_new(struct zt_pvt *i, int state, int startpbx, int
} }
#endif #endif
ast_dsp_set_features(i->dsp, features); ast_dsp_set_features(i->dsp, features);
ast_dsp_digitmode(i->dsp, DSP_DIGITMODE_DTMF | i->dtmfrelax); ast_dsp_set_digitmode(i->dsp, DSP_DIGITMODE_DTMF | i->dtmfrelax);
if (!ast_strlen_zero(progzone)) if (!ast_strlen_zero(progzone))
ast_dsp_set_call_progress_zone(i->dsp, progzone); ast_dsp_set_call_progress_zone(i->dsp, progzone);
if (i->busydetect && CANBUSYDETECT(i)) { if (i->busydetect && CANBUSYDETECT(i)) {
@ -6203,9 +6203,9 @@ static void *ss_thread(void *data)
/* set digit mode appropriately */ /* set digit mode appropriately */
if (p->dsp) { if (p->dsp) {
if (NEED_MFDETECT(p)) if (NEED_MFDETECT(p))
ast_dsp_digitmode(p->dsp,DSP_DIGITMODE_MF | p->dtmfrelax); ast_dsp_set_digitmode(p->dsp, DSP_DIGITMODE_MF | p->dtmfrelax);
else else
ast_dsp_digitmode(p->dsp,DSP_DIGITMODE_DTMF | p->dtmfrelax); ast_dsp_set_digitmode(p->dsp, DSP_DIGITMODE_DTMF | p->dtmfrelax);
} }
memset(dtmfbuf, 0, sizeof(dtmfbuf)); memset(dtmfbuf, 0, sizeof(dtmfbuf));
/* Wait for the first digit only if immediate=no */ /* Wait for the first digit only if immediate=no */
@ -6319,14 +6319,14 @@ static void *ss_thread(void *data)
return NULL; return NULL;
} }
zt_set_hook(p->subs[SUB_REAL].zfd, ZT_OFFHOOK); zt_set_hook(p->subs[SUB_REAL].zfd, ZT_OFFHOOK);
ast_dsp_digitmode(p->dsp,DSP_DIGITMODE_MF | p->dtmfrelax); ast_dsp_set_digitmode(p->dsp, DSP_DIGITMODE_MF | p->dtmfrelax);
res = my_getsigstr(chan, anibuf, "#", 10000); res = my_getsigstr(chan, anibuf, "#", 10000);
if ((res > 0) && (strlen(anibuf) > 2)) { if ((res > 0) && (strlen(anibuf) > 2)) {
if (anibuf[strlen(anibuf) - 1] == '#') if (anibuf[strlen(anibuf) - 1] == '#')
anibuf[strlen(anibuf) - 1] = 0; anibuf[strlen(anibuf) - 1] = 0;
ast_set_callerid(chan, anibuf + 2, NULL, anibuf + 2); ast_set_callerid(chan, anibuf + 2, NULL, anibuf + 2);
} }
ast_dsp_digitmode(p->dsp,DSP_DIGITMODE_DTMF | p->dtmfrelax); ast_dsp_set_digitmode(p->dsp, DSP_DIGITMODE_DTMF | p->dtmfrelax);
} }
ast_copy_string(exten, dtmfbuf, sizeof(exten)); ast_copy_string(exten, dtmfbuf, sizeof(exten));
@ -6411,7 +6411,7 @@ static void *ss_thread(void *data)
if (NEED_MFDETECT(p)) { if (NEED_MFDETECT(p)) {
if (p->dsp) { if (p->dsp) {
if (!p->hardwaredtmf) if (!p->hardwaredtmf)
ast_dsp_digitmode(p->dsp,DSP_DIGITMODE_DTMF | p->dtmfrelax); ast_dsp_set_digitmode(p->dsp, DSP_DIGITMODE_DTMF | p->dtmfrelax);
else { else {
ast_dsp_free(p->dsp); ast_dsp_free(p->dsp);
p->dsp = NULL; p->dsp = NULL;
@ -8512,7 +8512,7 @@ static struct zt_pvt *mkintf(int channel, struct zt_chan_conf conf, struct zt_pr
if (tmp->subs[SUB_REAL].zfd > -1) { if (tmp->subs[SUB_REAL].zfd > -1) {
set_actual_gain(tmp->subs[SUB_REAL].zfd, 0, tmp->rxgain, tmp->txgain, tmp->law); set_actual_gain(tmp->subs[SUB_REAL].zfd, 0, tmp->rxgain, tmp->txgain, tmp->law);
if (tmp->dsp) if (tmp->dsp)
ast_dsp_digitmode(tmp->dsp, DSP_DIGITMODE_DTMF | tmp->dtmfrelax); ast_dsp_set_digitmode(tmp->dsp, DSP_DIGITMODE_DTMF | tmp->dtmfrelax);
update_conf(tmp); update_conf(tmp);
if (!here) { if (!here) {
if ((conf.chan.sig != SIG_BRI) && (conf.chan.sig != SIG_BRI_PTMP) && (conf.chan.sig != SIG_PRI) && (conf.chan.sig != SIG_SS7)) if ((conf.chan.sig != SIG_BRI) && (conf.chan.sig != SIG_BRI_PTMP) && (conf.chan.sig != SIG_PRI) && (conf.chan.sig != SIG_SS7))

@ -115,7 +115,7 @@ void ast_dsp_set_features(struct ast_dsp *dsp, int features);
int ast_dsp_getdigits(struct ast_dsp *dsp, char *buf, int max); int ast_dsp_getdigits(struct ast_dsp *dsp, char *buf, int max);
/*! \brief Set digit mode */ /*! \brief Set digit mode */
int ast_dsp_digitmode(struct ast_dsp *dsp, int digitmode); int ast_dsp_set_digitmode(struct ast_dsp *dsp, int digitmode);
/*! \brief Set fax mode */ /*! \brief Set fax mode */
int ast_dsp_set_faxmode(struct ast_dsp *dsp, int faxmode); int ast_dsp_set_faxmode(struct ast_dsp *dsp, int faxmode);

@ -1495,7 +1495,7 @@ void ast_dsp_reset(struct ast_dsp *dsp)
dsp->ringtimeout= 0; dsp->ringtimeout= 0;
} }
int ast_dsp_digitmode(struct ast_dsp *dsp, int digitmode) int ast_dsp_set_digitmode(struct ast_dsp *dsp, int digitmode)
{ {
int new; int new;
int old; int old;

Loading…
Cancel
Save