Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***** FIXED VERSION: *process_rfc2833 *****/
- if (ast_test_flag(rtp, FLAG_DTMF_COMPENSATE)) {
- if ((rtp->lastevent != timestamp) || (rtp->resp && rtp->resp != resp)) {
- rtp->resp = resp;
- f = send_dtmf(rtp, AST_FRAME_DTMF_END);
- f->len = 0;
- rtp->lastevent = timestamp;
- }
- } else {
- if ((!(rtp->resp) && (!(event_end & 0x80))) || (rtp->resp && rtp->resp != resp)) {
- rtp->resp = resp;
- f = send_dtmf(rtp, AST_FRAME_DTMF_BEGIN);
- } else if ((event_end & 0x80) && (rtp->lastevent != seqno) && rtp->resp) {
- f = send_dtmf(rtp, AST_FRAME_DTMF_END);
- f->len = ast_tvdiff_ms(ast_samp2tv(samples, 8000), ast_tv(0, 0)); /* XXX hard coded 8kHz */
- rtp->resp = 0;
- rtp->lastevent = seqno;
- }
- }
- @@rtp->dtmfcount = dtmftimeout;
- /****** BROKEN VERSION" *process_rfc2833 *******/
- if (ast_test_flag(rtp, FLAG_DTMF_COMPENSATE)) {
- if ((rtp->lastevent != timestamp) || (rtp->resp && rtp->resp != resp)) {
- rtp->resp = resp;
- @@rtp->dtmfcount = 0;
- f = send_dtmf(rtp, AST_FRAME_DTMF_END);
- f->len = 0;
- rtp->lastevent = timestamp;
- }
- } else {
- if ((!(rtp->resp) && (!(event_end & 0x80))) || (rtp->resp && rtp->resp != resp)) {
- rtp->resp = resp;
- f = send_dtmf(rtp, AST_FRAME_DTMF_BEGIN);
- @@rtp->dtmfcount = dtmftimeout;
- } else if ((event_end & 0x80) && (rtp->lastevent != seqno) && rtp->resp) {
- f = send_dtmf(rtp, AST_FRAME_DTMF_END);
- f->len = ast_tvdiff_ms(ast_samp2tv(samples, 8000), ast_tv(0, 0)); /* XXX hard coded 8kHz */
- rtp->resp = 0;
- @@rtp->dtmfcount = 0;
- rtp->lastevent = seqno;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement