Showing posts with label asterisk. Show all posts
Showing posts with label asterisk. Show all posts

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.

Friday, October 11, 2013

Chan_dongle do not compile with asterisk 11

The symptoms are:

In file included from app.c:21:0:
/usr/include/asterisk/version.h:1:2: error: #error "Do not include 'asterisk/version.h'; use 'asterisk/ast_version.h' instead."
app.c: In function 'app_register':
app.c:162:3: warning: passing argument 2 of 'ast_register_application2' from incompatible pointer type [enabled by default]
In file included from app.c:20:0:
/usr/include/asterisk/module.h:458:5: note: expected 'int (*)(struct ast_channel *, const char *)' but argument is of type 'int (*)(struct ast_channel *, void *)'
make: *** [app.o] Error 1


Solution:
  • Download patched sources
  • autoconf and autmake should be installed
  • uzip sources
  • cd to unzipped folder
  • issue commands: aclocal, autoconf, automake -a
  • install chan_dongle as usual ./configure, make, make install.
then I got next error

# sudo make install
./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
strip chan_dongle.so
/usr/bin/install -c -m 755 chan_dongle.so
/usr/bin/install: missing destination file operand after `chan_dongle.so'
Try `/usr/bin/install --help' for more information.
make: *** [install] Error 1

Error because on chan_dongle installed on 64 bit OS. In that case DESTDIR should be: DESTDIR="/usr/lib64/asterisk/modules

after that you can run asterisk console and load module:

CLI> module load chan_dongle.so

but then next error comes:

WARNING[24644]: chan_dongle.c:218 opentty: unable to open /dev/ttyUSB2: Permission denied
that because of wrong permissions.


That usually happens when asterisk running in non root mode. Set the correct permissions to /dev/ttyUSB

#chmod 666 /dev/ttyUSB*

after all chan_dongle is up and runnin, but after adding second dongle, problem with permissions comes back. The silution is to set permission automatically. Create file in /etc/udev/rules.d/92-dongle.rules
and add

KERNEL=="ttyUSB*", MODE="0666", OWNER="asterisk", GROUP="uucp"