Advertisement
Guest User

geoff

a guest
Apr 9th, 2009
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. /***** FIXED VERSION: *process_rfc2833 *****/
  2.  
  3. if (ast_test_flag(rtp, FLAG_DTMF_COMPENSATE)) {
  4. if ((rtp->lastevent != timestamp) || (rtp->resp && rtp->resp != resp)) {
  5. rtp->resp = resp;
  6. f = send_dtmf(rtp, AST_FRAME_DTMF_END);
  7. f->len = 0;
  8. rtp->lastevent = timestamp;
  9. }
  10. } else {
  11. if ((!(rtp->resp) && (!(event_end & 0x80))) || (rtp->resp && rtp->resp != resp)) {
  12. rtp->resp = resp;
  13. f = send_dtmf(rtp, AST_FRAME_DTMF_BEGIN);
  14. } else if ((event_end & 0x80) && (rtp->lastevent != seqno) && rtp->resp) {
  15. f = send_dtmf(rtp, AST_FRAME_DTMF_END);
  16. f->len = ast_tvdiff_ms(ast_samp2tv(samples, 8000), ast_tv(0, 0)); /* XXX hard coded 8kHz */
  17. rtp->resp = 0;
  18. rtp->lastevent = seqno;
  19. }
  20. }
  21.  
  22. @@rtp->dtmfcount = dtmftimeout;
  23.  
  24.  
  25.  
  26. /****** BROKEN VERSION" *process_rfc2833 *******/
  27.  
  28. if (ast_test_flag(rtp, FLAG_DTMF_COMPENSATE)) {
  29. if ((rtp->lastevent != timestamp) || (rtp->resp && rtp->resp != resp)) {
  30. rtp->resp = resp;
  31. @@rtp->dtmfcount = 0;
  32. f = send_dtmf(rtp, AST_FRAME_DTMF_END);
  33. f->len = 0;
  34. rtp->lastevent = timestamp;
  35. }
  36. } else {
  37. if ((!(rtp->resp) && (!(event_end & 0x80))) || (rtp->resp && rtp->resp != resp)) {
  38. rtp->resp = resp;
  39. f = send_dtmf(rtp, AST_FRAME_DTMF_BEGIN);
  40. @@rtp->dtmfcount = dtmftimeout;
  41. } else if ((event_end & 0x80) && (rtp->lastevent != seqno) && rtp->resp) {
  42. f = send_dtmf(rtp, AST_FRAME_DTMF_END);
  43. f->len = ast_tvdiff_ms(ast_samp2tv(samples, 8000), ast_tv(0, 0)); /* XXX hard coded 8kHz */
  44. rtp->resp = 0;
  45. @@rtp->dtmfcount = 0;
  46. rtp->lastevent = seqno;
  47. }
  48. }
  49.  
  50.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement