[asterisk-commits] kpfleming: branch group/vldtmf r40515 - /team/group/vldtmf/dsp.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Aug 18 21:33:51 MST 2006


Author: kpfleming
Date: Fri Aug 18 23:33:50 2006
New Revision: 40515

URL: http://svn.digium.com/view/asterisk?rev=40515&view=rev
Log:
well.. this might work. let's try to get the DSP to generate DTMF begin/end events

Modified:
    team/group/vldtmf/dsp.c

Modified: team/group/vldtmf/dsp.c
URL: http://svn.digium.com/view/asterisk/team/group/vldtmf/dsp.c?rev=40515&r1=40514&r2=40515&view=diff
==============================================================================
--- team/group/vldtmf/dsp.c (original)
+++ team/group/vldtmf/dsp.c Fri Aug 18 23:33:50 2006
@@ -1497,42 +1497,45 @@
 			} else {
 				if (digit) {
 					/* Thought we saw one last time.  Pretty sure we really have now */
-					if (dsp->thinkdigit) {
-						if ((dsp->thinkdigit != 'x') && (dsp->thinkdigit != digit)) {
-							/* If we found a digit, and we're changing digits, go
-							   ahead and send this one, but DON'T stop confmute because
-							   we're detecting something else, too... */
-							memset(&dsp->f, 0, sizeof(dsp->f));
-							dsp->f.frametype = AST_FRAME_DTMF;
-							dsp->f.subclass = dsp->thinkdigit;
-							FIX_INF(af);
-							if (chan)
-								ast_queue_frame(chan, af);
-							ast_frfree(af);
-						}
-						dsp->thinkdigit = digit;
-						return &dsp->f;
-					}
-					dsp->thinkdigit = digit;
-				} else {
-					if (dsp->thinkdigit) {
+					if ((dsp->thinkdigit != 'x') && (dsp->thinkdigit != digit)) {
+						/* If we found a digit, and we're changing digits, go
+						   ahead and send this one, but DON'T stop confmute because
+						   we're detecting something else, too... */
 						memset(&dsp->f, 0, sizeof(dsp->f));
-						if (dsp->thinkdigit != 'x') {
-							/* If we found a digit, send it now */
-							dsp->f.frametype = AST_FRAME_DTMF;
-							dsp->f.subclass = dsp->thinkdigit;
-							dsp->thinkdigit = 0;
-						} else {
-							dsp->f.frametype = AST_FRAME_DTMF;
-							dsp->f.subclass = 'u';
-							dsp->thinkdigit = 0;
-						}
+						dsp->f.frametype = AST_FRAME_DTMF_END;
+						dsp->f.subclass = dsp->thinkdigit;
 						FIX_INF(af);
 						if (chan)
 							ast_queue_frame(chan, af);
 						ast_frfree(af);
-						return &dsp->f;
+					} else {
+						dsp->thinkdigit = digit;
+						memset(&dsp->f, 0, sizeof(dsp->f));
+						dsp->f.frametype = AST_FRAME_DTMF_BEGIN;
+						dsp->f.subclass = dsp->thinkdigit;
+						FIX_INF(af);
+						if (chan)
+							ast_queue_frame(chan, af);
+						ast_frfree(af);
 					}
+					return &dsp->f;
+				} else {
+					memset(&dsp->f, 0, sizeof(dsp->f));
+					if (dsp->thinkdigit != 'x') {
+						/* If we found a digit, send it now */
+						dsp->f.frametype = AST_FRAME_DTMF_END;
+						dsp->f.subclass = dsp->thinkdigit;
+						dsp->thinkdigit = 0;
+					} else {
+						dsp->f.frametype = AST_FRAME_DTMF;
+						dsp->f.subclass = 'u';
+						dsp->thinkdigit = 0;
+					}
+					FIX_INF(af);
+					if (chan)
+						ast_queue_frame(chan, af);
+					ast_frfree(af);
+					return &dsp->f;
 				}
 			}
 		} else if (!digit) {
@@ -1553,7 +1556,7 @@
 			} else {
 				if (dsp->td.dtmf.current_digits) {
 					memset(&dsp->f, 0, sizeof(dsp->f));
-					dsp->f.frametype = AST_FRAME_DTMF;
+					dsp->f.frametype = AST_FRAME_DTMF_END;
 					dsp->f.subclass = dsp->td.dtmf.digits[0];
 					memmove(dsp->td.dtmf.digits, dsp->td.dtmf.digits + 1, dsp->td.dtmf.current_digits);
 					dsp->td.dtmf.current_digits--;



More information about the asterisk-commits mailing list