[svn-commits] tzafrir: trunk r222237 - /trunk/channels/chan_dahdi.c
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Tue Oct 6 11:17:33 CDT 2009
Author: tzafrir
Date: Tue Oct 6 11:17:30 2009
New Revision: 222237
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=222237
Log:
Make sure digit events are not reported as "ERROR"
dahdievent_to_analogevent used a simple switch statement to convert DAHDI
event numbers to "ANALOG_*" event numbers. However "digit" events
(DAHDI_EVENT_PULSEDIGIT, DAHDI_EVENT_DTMFDOWN, DAHDI_EVENT_DTMFUP)
are accompannied by the digit in the low word of the event number.
This fix makes dahdievent_to_analogevent() return the event number as-is
for such an event.
This is also required to fix #15924 (in addition to r222108).
Modified:
trunk/channels/chan_dahdi.c
Modified: trunk/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=222237&r1=222236&r2=222237
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Tue Oct 6 11:17:30 2009
@@ -2457,6 +2457,17 @@
res = ANALOG_EVENT_DTMFUP;
break;
default:
+ switch(event & 0xFFFF0000) {
+ case DAHDI_EVENT_PULSEDIGIT:
+ case DAHDI_EVENT_DTMFDOWN:
+ case DAHDI_EVENT_DTMFUP:
+ /* The event includes a digit number in the low word.
+ * Converting it to a 'enum analog_event' would remove
+ * that information. Thus it is returned as-is.
+ */
+ return event;
+ }
+
res = ANALOG_EVENT_ERROR;
break;
}
More information about the svn-commits
mailing list