diff options
-rw-r--r-- | main/rtp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/main/rtp.c b/main/rtp.c index 8e1c6a7ff..016d3b57e 100644 --- a/main/rtp.c +++ b/main/rtp.c @@ -992,10 +992,10 @@ static struct ast_frame *process_cisco_dtmf(struct ast_rtp *rtp, unsigned char * } } else if ((rtp->resp == resp) && !power) { f = create_dtmf_frame(rtp, AST_FRAME_DTMF_END); - f->samples = rtp->dtmfsamples * (rtp_get_rate(f->subclass) / 1000); + f->samples = rtp->dtmfsamples * (rtp->lastrxformat ? (rtp_get_rate(rtp->lastrxformat) / 1000) : 8); rtp->resp = 0; } else if (rtp->resp == resp) - rtp->dtmfsamples += 20 * (rtp_get_rate(f->subclass) / 1000); + rtp->dtmfsamples += 20 * (rtp->lastrxformat ? (rtp_get_rate(rtp->lastrxformat) / 1000) : 8); rtp->dtmf_timeout = dtmftimeout; return f; } |