diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-04-02 14:40:21 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-04-02 14:40:21 +0000 |
commit | 1a59123c99f2592a8c0ddcc7e017d24b3faf5437 (patch) | |
tree | cc1d6c2b454d875de447e3046e08600816c6b2d7 /channels | |
parent | e22999aa42691e0901bdef577fadaa21f575fc4c (diff) |
When going to in-band, be sure to allocate DSP (bug #1336)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2602 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-x | channels/chan_sip.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 93dd67fee..35a355325 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -1679,7 +1679,7 @@ static struct ast_frame *sip_rtp_read(struct ast_channel *ast, struct sip_pvt *p ast_set_read_format(p->owner, p->owner->readformat, 0); ast_set_write_format(p->owner, p->owner->writeformat, 0); } - if (p->dtmfmode & SIP_DTMF_INBAND) { + if ((p->dtmfmode & SIP_DTMF_INBAND) && p->vad) { f = ast_dsp_process(p->owner,p->vad,f,0); } } @@ -6729,6 +6729,17 @@ static int sip_dtmfmode(struct ast_channel *chan, void *data) p->dtmfmode = SIP_DTMF_INBAND; else ast_log(LOG_WARNING, "I don't know about this dtmf mode: %s\n",mode); + if (p->dtmfmode & SIP_DTMF_INBAND) { + if (!p->vad) { + p->vad = ast_dsp_new(); + ast_dsp_set_features(p->vad, DSP_FEATURE_DTMF_DETECT); + } + } else { + if (p->vad) { + ast_dsp_free(p->vad); + p->vad = NULL; + } + } ast_mutex_unlock(&p->lock); } ast_mutex_unlock(&chan->lock); |