aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_dahdi.c
diff options
context:
space:
mode:
authortzafrir <tzafrir@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-06 16:17:30 +0000
committertzafrir <tzafrir@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-06 16:17:30 +0000
commit1805a24b827bc76d2acaa034412c96ef6bdee9d0 (patch)
tree1ad60ebc0949d32f7b91d3fdd766a5b9190df7ca /channels/chan_dahdi.c
parente299cf0653557f0e54cf263b07c0201eebef00d8 (diff)
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). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@222237 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_dahdi.c')
-rw-r--r--channels/chan_dahdi.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 2477100d5..8a43bacad 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -2457,6 +2457,17 @@ static enum analog_event dahdievent_to_analogevent(int event)
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;
}