Ivr not working

I’ve set up freepbx 2.5.1.1 on an ubuntu 8.10 x86_64 server. Outgoing, incoming, and internal calls are now working fine it seems, but if I set my inbound destination to IVR, an incoming caller just hears “good bye”. Freepbx logs the call with Destination “hang”.

My IVR is very basic at this point, it’s supposed to play an announcement and loop twice. I haven’t set up any i or t destination. I’ve tried built-in recordings for the announcement as well as recordings I’ve made on an extension, always with the same result. I have set up * to terminate the call, but it seems to be terminating immediately after “good bye” and no buttons pressed.

Permissions on sound files look proper, world readable.

Any thoughts?

is apache running as the user asterisk or as another user? are the files owned by asterisk.asterisk or otherwise? It should be running as asterisk, if not please fix it.

Apache is running as asterisk and the sound files are owned by asterisk:asterisk.

It seems that when the incoming route is pointed to an IVR, the result is always the same regardless of what I set the destination to in the IVR, so I’m not sure whether the problem is with the announcement or with the IVR setup itself.

Just to be clear:

# ls -l /var/lib/asterisk/sounds
total 96
lrwxrwxrwx 1 asterisk asterisk    58 2009-02-09 22:30 agent-login.sln -> /var/www/freepbx/admin/modules/core/sounds/agent-login.sln
lrwxrwxrwx 1 asterisk asterisk    59 2009-02-09 22:30 agent-logoff.sln -> /var/www/freepbx/admin/modules/core/sounds/agent-logoff.sln
drwxrwxr-x 2 asterisk asterisk    72 2009-02-10 00:31 custom
-rw-rw-r-- 1 asterisk asterisk 18744 2009-02-09 22:04 dir-intro-fnln.gsm
-rw-rw-r-- 1 asterisk asterisk 22836 2009-02-09 22:04 dir-intro-fnln-oper.gsm
-rw-rw-r-- 1 asterisk asterisk 21516 2009-02-09 22:04 dir-intro-fn-oper.gsm
-rw-rw-r-- 1 asterisk asterisk 21648 2009-02-09 22:04 dir-intro-oper.gsm
lrwxrwxrwx 1 asterisk asterisk    75 2009-02-09 22:30 exited-vm-will-be-transfered.sln -> /var/www/freepbx/admin/modules/core/sounds/exited-vm-will-be-transfered.sln
lrwxrwxrwx 1 asterisk asterisk    58 2009-02-09 22:30 featurecode.sln -> /var/www/freepbx/admin/modules/core/sounds/featurecode.sln
lrwxrwxrwx 1 asterisk asterisk    79 2009-02-09 22:30 incoming-call-1-accept-2-decline.sln -> /var/www/freepbx/admin/modules/core/sounds/incoming-call-1-accept-2-decline.sln
lrwxrwxrwx 1 asterisk asterisk    76 2009-02-09 22:30 incoming-call-no-longer-avail.sln -> /var/www/freepbx/admin/modules/core/sounds/incoming-call-no-longer-avail.sln
lrwxrwxrwx 1 asterisk asterisk    57 2009-02-10 00:06 intercom.wav -> /var/www/freepbx/admin/modules/paging/sounds/intercom.wav
lrwxrwxrwx 1 asterisk asterisk    70 2009-02-09 22:30 line-busy-transfer-menu.sln -> /var/www/freepbx/admin/modules/core/sounds/line-busy-transfer-menu.sln
lrwxrwxrwx 1 asterisk asterisk    91 2009-02-09 22:30 please-enter-your-extension-then-press-pound.sln -> /var/www/freepbx/admin/modules/core/sounds/please-enter-your-extension-then-press-pound.sln
lrwxrwxrwx 1 asterisk asterisk    74 2009-02-09 22:30 you-will-be-transfered-menu.sln -> /var/www/freepbx/admin/modules/core/sounds/you-will-be-transfered-menu.sln
# ls -l /var/www/freepbx/admin/modules/core/sounds/
total 900
-rwxrwxr-x 1 asterisk asterisk  80384 2008-07-05 11:10 agent-login.sln
-rwxrwxr-x 1 asterisk asterisk  95574 2008-07-05 11:10 agent-logoff.sln
-rwxrwxr-x 1 asterisk asterisk 148140 2008-08-24 19:32 exited-vm-will-be-transfered.sln
-rwxrwxr-x 1 asterisk asterisk  23552 2008-07-05 11:10 featurecode.sln
-rwxrwxr-x 1 asterisk asterisk 151894 2008-07-19 13:23 incoming-call-1-accept-2-decline.sln
-rwxrwxr-x 1 asterisk asterisk  90284 2008-07-19 13:23 incoming-call-no-longer-avail.sln
-rwxrwxr-x 1 asterisk asterisk 163500 2008-08-24 19:32 line-busy-transfer-menu.sln
-rwxrwxr-x 1 asterisk asterisk  55040 2008-08-23 15:54 please-enter-your-extension-then-press-pound.sln
-rwxrwxr-x 1 asterisk asterisk  91136 2008-08-24 19:32 you-will-be-transfered-menu.sln
# ls -l /var/lib/asterisk/sounds/custom/
total 64
-rw-r--r-- 1 asterisk asterisk 64844 2009-02-10 00:31 thanks.wav
# ps aux | grep apache
root      4736  0.0  0.7 159968  7928 ?        Ss   00:02   0:00 /usr/sbin/apache2 -k start
asterisk  4756  0.0  1.2 164344 12156 ?        S    00:02   0:06 /usr/sbin/apache2 -k start
asterisk  4757  0.0  1.7 171892 17800 ?        S    00:02   0:04 /usr/sbin/apache2 -k start
asterisk  4759  0.0  1.7 171636 17744 ?        S    00:02   0:11 /usr/sbin/apache2 -k start
asterisk  4760  0.0  1.6 168744 16312 ?        S    00:02   0:09 /usr/sbin/apache2 -k start
asterisk  4796  0.0  1.5 167712 15388 ?        S    00:02   0:06 /usr/sbin/apache2 -k start
asterisk  5584  0.0  1.6 169024 16040 ?        S    00:14   0:00 /usr/sbin/apache2 -k start
asterisk  5595  0.0  1.6 168772 16356 ?        S    00:14   0:02 /usr/sbin/apache2 -k start
asterisk  6371  0.0  1.6 169008 16168 ?        S    00:46   0:01 /usr/sbin/apache2 -k start
asterisk  6372  0.0  1.6 168752 16088 ?        S    00:46   0:00 /usr/sbin/apache2 -k start
asterisk  6373  0.0  1.6 168736 16092 ?        S    00:46   0:00 /usr/sbin/apache2 -k start
root     12406  0.0  0.0   7452   880 pts/1    R+   09:30   0:00 grep apache

Can you go in to the asterisk cli and type: set verbose 5
then make a call and post the cli’s output from that call here for us to look at.

You can do a set verbose 1 at the end to return it to the default logging level so that your logs don’t grow to fast.

As requested. Note that I have replaced the two phone numbers with * as well as part of the sip name. “WiseWelcome” is the name of the IVR that the incoming call should route to. “WiseWelcome” is also the name of the recording that the IVR should be playing, but I’m only hearing “good bye” when I call, then I hang up.

Hopefully this output will mean more to somebody than it does to me. Thanks for looking.

Verbosity was 1 and is now 5
  == Parsing '/etc/asterisk/manager.conf': Found
  == Parsing '/etc/asterisk/manager_additional.conf': Found
  == Parsing '/etc/asterisk/manager_custom.conf': Found
  == Manager 'admin' logged on from 127.0.0.1
  == Manager 'admin' logged off from 127.0.0.1
    -- Executing [1780*******@from-trunk:1] Set("SIP/clarknova-********", "__FROM_DID=1780*******") in new stack
    -- Executing [1780*******@from-trunk:2] ExecIf("SIP/clarknova-********", "0 |Set|CALLERID(name)=780*******") in new stack
    -- Executing [1780*******@from-trunk:3] Set("SIP/clarknova-********", "__CALLINGPRES_SV=allowed_not_screened") in new stack
    -- Executing [1780*******@from-trunk:4] SetCallerPres("SIP/clarknova-********", "allowed_not_screened") in new stack
    -- Executing [1780*******@from-trunk:5] Goto("SIP/clarknova-********", "ivr-10|s|1") in new stack
    -- Goto (ivr-10,s,1)
    -- Executing [s@ivr-10:1] Set("SIP/clarknova-********", "MSG=custom/WiseWelcome") in new stack
    -- Executing [s@ivr-10:2] Set("SIP/clarknova-********", "LOOPCOUNT=0") in new stack
    -- Executing [s@ivr-10:3] Set("SIP/clarknova-********", "__DIR-CONTEXT=default") in new stack
    -- Executing [s@ivr-10:4] Set("SIP/clarknova-********", "_IVR_CONTEXT_ivr-10=") in new stack
    -- Executing [s@ivr-10:5] Set("SIP/clarknova-********", "_IVR_CONTEXT=ivr-10") in new stack
    -- Executing [s@ivr-10:6] GotoIf("SIP/clarknova-********", "0?begin") in new stack
    -- Executing [s@ivr-10:7] Answer("SIP/clarknova-********", "") in new stack
    -- Executing [s@ivr-10:8] Wait("SIP/clarknova-********", "1") in new stack
    -- Executing [s@ivr-10:9] Set("SIP/clarknova-********", "TIMEOUT(digit)=3") in new stack
    -- Digit timeout set to 3
    -- Executing [s@ivr-10:10] Set("SIP/clarknova-********", "TIMEOUT(response)=0") in new stack
    -- Response timeout set to 0
    -- Executing [s@ivr-10:11] Set("SIP/clarknova-********", "__IVR_RETVM=RETURN") in new stack
    -- Executing [s@ivr-10:12] ExecIf("SIP/clarknova-********", "1|Background|custom/WiseWelcome") in new stack
    -- Executing [s@ivr-10:13] WaitExten("SIP/clarknova-********", "|") in new stack
    -- Timeout on SIP/clarknova-********, going to 't'
    -- Executing [t@ivr-10:1] Goto("SIP/clarknova-********", "loop|1") in new stack
    -- Goto (ivr-10,loop,1)
    -- Executing [loop@ivr-10:1] Set("SIP/clarknova-********", "LOOPCOUNT=1") in new stack
    -- Executing [loop@ivr-10:2] GotoIf("SIP/clarknova-********", "0?hang|1") in new stack
    -- Executing [loop@ivr-10:3] Goto("SIP/clarknova-********", "ivr-10|s|begin") in new stack
    -- Goto (ivr-10,s,9)
    -- Executing [s@ivr-10:9] Set("SIP/clarknova-********", "TIMEOUT(digit)=3") in new stack
    -- Digit timeout set to 3
    -- Executing [s@ivr-10:10] Set("SIP/clarknova-********", "TIMEOUT(response)=0") in new stack
    -- Response timeout set to 0
    -- Executing [s@ivr-10:11] Set("SIP/clarknova-********", "__IVR_RETVM=RETURN") in new stack
    -- Executing [s@ivr-10:12] ExecIf("SIP/clarknova-********", "1|Background|custom/WiseWelcome") in new stack
    -- Executing [s@ivr-10:13] WaitExten("SIP/clarknova-********", "|") in new stack
    -- Timeout on SIP/clarknova-********, going to 't'
    -- Executing [t@ivr-10:1] Goto("SIP/clarknova-********", "loop|1") in new stack
    -- Goto (ivr-10,loop,1)
    -- Executing [loop@ivr-10:1] Set("SIP/clarknova-********", "LOOPCOUNT=2") in new stack
    -- Executing [loop@ivr-10:2] GotoIf("SIP/clarknova-********", "0?hang|1") in new stack
    -- Executing [loop@ivr-10:3] Goto("SIP/clarknova-********", "ivr-10|s|begin") in new stack
    -- Goto (ivr-10,s,9)
    -- Executing [s@ivr-10:9] Set("SIP/clarknova-********", "TIMEOUT(digit)=3") in new stack
    -- Digit timeout set to 3
    -- Executing [s@ivr-10:10] Set("SIP/clarknova-********", "TIMEOUT(response)=0") in new stack
    -- Response timeout set to 0
    -- Executing [s@ivr-10:11] Set("SIP/clarknova-********", "__IVR_RETVM=RETURN") in new stack
    -- Executing [s@ivr-10:12] ExecIf("SIP/clarknova-********", "1|Background|custom/WiseWelcome") in new stack
    -- Executing [s@ivr-10:13] WaitExten("SIP/clarknova-********", "|") in new stack
    -- Timeout on SIP/clarknova-********, going to 't'
    -- Executing [t@ivr-10:1] Goto("SIP/clarknova-********", "loop|1") in new stack
    -- Goto (ivr-10,loop,1)
    -- Executing [loop@ivr-10:1] Set("SIP/clarknova-********", "LOOPCOUNT=3") in new stack
    -- Executing [loop@ivr-10:2] GotoIf("SIP/clarknova-********", "1?hang|1") in new stack
    -- Goto (ivr-10,hang,1)
    -- Executing [hang@ivr-10:1] Playback("SIP/clarknova-********", "vm-goodbye") in new stack
    -- <SIP/clarknova-********> Playing 'vm-goodbye' (language 'en')
  == Parsing '/etc/asterisk/manager.conf': Found
  == Parsing '/etc/asterisk/manager_additional.conf': Found
  == Parsing '/etc/asterisk/manager_custom.conf': Found
  == Manager 'admin' logged on from 127.0.0.1
    -- Executing [hang@ivr-10:2] Hangup("SIP/clarknova-********", "") in new stack
  == Spawn extension (ivr-10, hang, 2) exited non-zero on 'SIP/clarknova-********'
    -- Executing [h@ivr-10:1] Hangup("SIP/clarknova-********", "") in new stack
  == Spawn extension (ivr-10, h, 1) exited non-zero on 'SIP/clarknova-********'
  == Manager 'admin' logged off from 127.0.0.1
  == Parsing '/etc/asterisk/manager.conf': Found
  == Parsing '/etc/asterisk/manager_additional.conf': Found
  == Parsing '/etc/asterisk/manager_custom.conf': Found
  == Manager 'admin' logged on from 127.0.0.1
  == Parsing '/etc/asterisk/manager.conf': Found
  == Parsing '/etc/asterisk/manager_additional.conf': Found
  == Parsing '/etc/asterisk/manager_custom.conf': Found
  == Manager 'admin' logged on from 127.0.0.1
  == Manager 'admin' logged off from 127.0.0.1
  == Manager 'admin' logged off from 127.0.0.1
zacharias*CLI> set verbose 1
Verbosity was 5 and is now 1

That should simulate an incoming call. If you don’t hear the recordings then it probably means that either the permissions and/or ownership on the recordings (or the directory that contains them) aren’t correct, OR the recordings are in a format that Asterisk doesn’t understand. Recordings must be 16 bit monaural at 8000 kHz. So check the format of your “WiseWelcome” recording (particularly if you did not create it from within FreePBX). And check the permissions and ownership of the “custom” directory - that can also cause problems.

Dialing 7777 from an extension I hear a silent pause of several seconds followed by the asterisk lady saying “this number is not in service…” FreePBX status page shows an active call but 0 internal calls and 0 external calls. The call log shows a call from the extension number to “s”.

My custom directory is owned by asterisk.asterisk and has permissions of 775. All my custom recordings are owned by asterisk.asterisk and have permissions of 644. They were recorded on an extension in trixbox then uploaded to the freepbx box using the System Recordings module. I can play them from the System Recordings page in freepbx, so I don’t think permissions on the sound recordings are the problem.

I wonder if I have permission problems with ivr-related files. After installed freepbx I had to manually change the ownership and permissions of the agi-bin directory from root, as “amportal chown” didn’t do it, so it’s possible I’m still having other issues with file ownership somewhere.

Yes it is. Also for the heck of it re-upload the file using all lower case. You seem to be very knowledgeble with unix but a simple slip up of a upper/lower case letter in the file will screw things up with the exact same results.

It’s a very common thing for windows only users who slapped a distro CD in and 20 minutes later expect to have a perfectly working system (like I said that does not seem to be you). But when uploading from a windows box you can type a recording name using any case you want and windows will find the file, the GUI side will take the name as you typed it but upload the file the way it was actually named causing a issue.

An update:

If I record a sound using FreePBX’s System Recordings module, the wav file goes into the /var/lib/asterisk/sounds/custom folder. Prerecorded sounds available in the same module are in the /var/lib/asterisk/sounds folder. None of these are heard when designated as the announcement for an ivr on an inbound route.

However, I found vm-goodbye.gsm in the directory /usr/share/asterisk/sounds. I can copy any wav file from /var/lib/asterisk/sounds into /usr/share/asterisk/sounds and if it is the designated announcement for an ivr then I hear it when I make a call in.

So the ivr creation page is giving me announcement choices from /var/lib/asterisk/sounds but whatever code is handling sounds when the ivr is actually accessed by a call seems to be looking in /usr/share/asterisk/sounds.

I thought about softlinking one directory to the other, but I’ve had some very traumatic experiences messing with asterisk’s directory structure and frankly I’m quite anxious about breaking the system, as I have many times already.

Any suggestions? Anybody know why the disconnect between these two sounds directories? What’s the recommended fix?

Thanks again.

Look in /etc/asterisk/asterisk.conf - this is what the file looks like in a typical installation (note this is under Elastix, but these paths should be pretty close to universal in a FreePBX system):

[directories]
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /var/lib/asterisk
astagidir => /var/lib/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
astlogdir => /var/log/asterisk
astdatadir => /var/lib/asterisk

[options]
transmit_silence_during_record = yes 

Note particularly the astvarlibdir and astdatadir entries - are these the same on your system? Just a shot in the dark, but I’ll bet it’s a path in a config file that’s pointing to the wrong place.

I assume this conf file is provided by the ubuntu asterisk package.

$ cat /etc/asterisk/asterisk.conf 
[directories]
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /var/lib/asterisk
astagidir => /usr/share/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
astlogdir => /var/log/asterisk

I think it was in this file that I changed [global] to [directories]. It was a suggestion that I read, I think in this forum somewhere.

edit: here’s the link: http://freepbx.org/forum/freepbx/installation/unable-to-connect-to-remote-asterisk-does-var-run-asterisk-ctl-exist-solv. I tried changing it back to global and restarting asterisk but it doesn’t seem to make a difference to anything that I can see.

The following file is provided by the freepbx intsaller, as I understand it.

$ tail -n 10 /etc/amportal.conf 
AMPDBUSER=asteriskuser
AMPDBPASS=amp109
AMPDBNAME=asterisk
ASTETCDIR=/etc/asterisk
ASTMODDIR=/usr/lib/asterisk/modules
ASTVARLIBDIR=/var/lib/asterisk
ASTAGIDIR=/usr/share/asterisk/agi-bin
ASTSPOOLDIR=/var/spool/asterisk
ASTRUNDIR=/var/run/asterisk
ASTLOGDIR=/var/log/asterisk

Somewhere I’m guessing there is a conf file pointing to /usr/share/share/asterisk.

I don’t know for a fact that this is the problem, but I do note you are missing this line:

astdatadir => /var/lib/asterisk

Try adding it and see if it helps.

I added that line and restarted asterisk but the ivr still isn’t finding the recordings.

It turns out /usr/share/asterisk/sounds/custom is just a link to /usr/local/share/asterisk/sounds, so I added a link from there to the directory where my custom sounds are actually being created, and my ivr is in business. I have updated the freepbx ubuntu install wiki accordingly.

ln -s /var/lib/asterisk/sounds/custom /usr/local/share/asterisk/sounds
chown -R asterisk:asterisk /usr/local/share/asterisk/
chmod -R 755 /usr/local/share/asterisk/

Thanks to everyone for your input. I’m still curious as to the origin of this anomaly. I’d be happy to offer my assistance if the maintainers wish to use this information to streamline the ubuntu install process.

Your suggestion also got my system working :slight_smile:

I wanted a low power netbook solution so installed easypeasy which is based on Ubuntu / Debian 8.04

Sure enough I had exactly the same problems as described i.e. Recordings not playing back in an IVR. The symbolic linking in this area is quite a mess and your link failed as /usr/local/share/asterisk/sounds already existed, so a quick

mv /usr/local/share/asterisk/sounds /usr/local/share/asterisk/sounds.old

followed by

ln -s /var/lib/asterisk/sounds/custom /usr/local/share/asterisk/sounds
chown -R asterisk:asterisk /usr/local/share/asterisk/
chmod -R 755 /usr/local/share/asterisk/

Has worked.

If anyone else is interested in getting Asterisk/Freepbx working on a Netbook I have documented everything at

http://msatt.com

in the Voip/Asterisk section.

Mike

I don’t understand how 7777 call can simulate an incoming call with :

grep 7777 *

extensions_additional.conf:exten => 7777,1,Goto(from-pstn,${EXTEN},1)

Is it necessary to have an inbound route maching all (no SDA) to have it working ?

With a old freepbx (amp in fact), i had 7777,1,Goto(from-pstn,s,1) and no route matching all.

I have the issue issue stated here, I create a custom app. to check if the IVR is working fine. If I dialed from internal extension to my custom app. IVR play the sound fine, if I call using a phon the IVR does not play the sound, just the “goodbye” sound. Any suggestion?

I am glad that I discovered this post, since we migrated our frepbx system from an old fedora 6 box to Ubuntu server 10.04 32-bit ivr’s were gone. We don’t have apache running as asterisk or anything and now the system performs as expected. asterisk is installed as it comes on the repositories, but some configuring is needed to get the freepbx-asterisk combination to work. If anybody needs help doing it I can post a step-by-step guide.
cheers
Antonio

Would this have anything to do with the “touch tones” not working when I call the pbx and hear the recording then select 1 and the IVR repeats ?