Tuesday, February 11, 2014

Asterisk. Issue with IVR. DTMF not properly detected.

Asterisk routes all incoming calls, received through chan dongle, to IVR, where callers should press '1', '2' or '3'. Depends on selection made in IVR call is routed to different destination.
When call comes from mobile operator everything works fine, but when call received from landline(actually it was from alcatel pbx) it is impossible to choose destination in IVR.
Affter turning on DTMF logging and playing a little with IVR from landline, log looks like:

[Apr 18 07:56:28] DTMF[1787]: channel.c:4062 __ast_read: DTMF begin '1' received on Dongle/dongle0-0100000000
[Apr 18 07:56:28] DTMF[1787]: channel.c:4066 __ast_read: DTMF begin ignored '1' on Dongle/dongle0-0100000000
[Apr 18 07:56:30] DTMF[1787]: channel.c:4062 __ast_read: DTMF begin '2' received on Dongle/dongle0-0100000000
[Apr 18 07:56:30] DTMF[1787]: channel.c:4066 __ast_read: DTMF begin ignored '2' on Dongle/dongle0-0100000000
[Apr 18 07:56:30] DTMF[1787]: channel.c:4062 __ast_read: DTMF begin '3' received on Dongle/dongle0-0100000000
[Apr 18 07:56:30] DTMF[1787]: channel.c:4066 __ast_read: DTMF begin ignored '3' on Dongle/dongle0-0100000000


It means that asterisk detected DTMF, but duration is of DTMF is too short. To resolve this issue edit dongle.conf file. Find the section [dongleX] where 'X' dongle's number, which receives call, and add or edit parameter mindtmfduration=0. Restart asterisk and make test call. Log file should look like:

[Apr 18 10:35:02] DTMF[2014]: channel.c:4062 __ast_read: DTMF begin '1' received on Dongle/dongle0-0100000002
[Apr 18 10:35:02] DTMF[2014]: channel.c:4066 __ast_read: DTMF begin ignored '1' on Dongle/dongle0-0100000002
[Apr 18 10:35:02] DTMF[2014]: channel.c:3977 __ast_read: DTMF end '1' received on Dongle/dongle0-0100000002, duration 63 ms


It means that asterisk received DTMF code and accepted it(because it shows the duration in the log). After that increase mindtmfduration parameter until you find that asterisk do not accept DTMF signals like it was before. Then decrease duration to last working value.

6 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Excellent, it works perfectly. Thanks

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Very helpful pointer that works. Thanks. But wondering if the min duration to detect dtmf is dependent on telecom provider (GSM provider) or dependent on some variations in Dongle used, since I have faced this in only one dongle out of about 50 used so far. mindtmfduration=80 ie. 80ms typically worked for all other dongles/SIM except this one case. Btw, after I made it zero, the recorded times span from 63ms to 89ms. I guess setting it to 60ms should work for most. Is there any adverse effect of leaving it to 0?

    ReplyDelete
  5. Thanks. This really helped me out today!

    ReplyDelete
  6. Thank you! Was having trouble with DTMF tones using chan_dongle, now it's working!

    ReplyDelete