aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-19 14:47:14 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-19 14:47:14 +0000
commit3c67cc75f63d4921f5a156b05903137a04e307ec (patch)
treeb489bfafb33ee584c896433e32ce42505a569363
parent2b779bcf3930f2302e30c8aab9da685c2370c3bf (diff)
Merged revisions 264114 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r264114 | dvossel | 2010-05-19 09:38:02 -0500 (Wed, 19 May 2010) | 13 lines fixes crash during dtmf During the processing of Cisco dtmf the dtmf samples were not being calculated correctly. In an attempt to determine what sample rate was being used, a NULL frame was processed which caused a crash. This patch resolves this. (closes issue #17248) Reported by: falves11 Patches: issue_17248.diff uploaded by dvossel (license 671) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@264115 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/rtp.c4
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;
}