How to fix directory path

I have asterisk 11 installed on Centos. Everything was working fine till sunday, sound files, my agi-bin scripts, etc. But on Sunday I added ODBC to support posting CDR into mysql. I finally got the ODBC working , but in the process I had to do a new build. I don’t know what I did wrong, but after the rebuild, Asterisk had the wrong path to the sound files and to agi-bin. Standard call functions (and posting to mysql all seem to work).

It seems that asterisk is looking for agi-bin at </usr/share/asterisk/agi-bin/> but the path is </var/lib/asterisk/agi-bin/>
same with sound files. With the full path, it works. Without the full path it is going to the wrong place.

exten => 200,1,Answer()
; same => n,Playback(hello-world)
 same => n,Playback(/var/lib/asterisk/sounds/en/hello-world)
same => n,Hangup()

the setup in asterisk.conf is what is was before;

  stetcdir => /etc/asterisk
  astmoddir => /usr/lib64/asterisk/modules
 astvarlibdir => /var/lib/asterisk
 astdbdir => /var/lib/asterisk
 astkeydir => /var/lib/asterisk
  astdatadir => /var/lib/asterisk
 astagidir => /var/lib/asterisk/agi-bin
 astspooldir => /var/spool/asterisk
 astrundir => /var/ru/asterisk
 astlogdir => /var/log/asterisk
as tsbindir => /usr/sbin

I supposed I messed something up when I did the rebuild, but I don’t what. So can I fix it without a rebuild? And I have to rebuild it, what do to correct this problem?

I screwed up the post:

Asterisk is looking for agi-bin at /usr/share/asterisk/agi-bin/ but the agi-bin is located at /var/lib/asterisk/agi-bin. Same with the sound files.

Remove the (!) from the end of the “[directories]”. It’s a template right now and not actually being used.

Made change, restarted and reloaded, no change.

stetcdir => /etc/asterisk

I did discover that the agi-bin, sounds, … are installed in two locations. Maybe I should delete the /usr/share/asterisk?

If it is not being used, you can. I also don’t know if it’s just your copy/paste but you are missing the “a” at the start of “astetcdir”. You’ll also want the other paths set. It’s likely that paths were passed to the configure script in the original build which placed things elsewhere, but this time it was left to the defaults which were different.

I was missing the “a” - corrected that.
I deleted /usr/share/asterisk
However it is still looking in the wrong place
– Executing [16462912174@chameleon:8] AGI(“SIP/lesnet_peer-0007b15f”, “”) in new stack
[2017-07-12 06:53:29] WARNING[42366]: res_agi.c:1624 launch_script: Failed to execute ‘/usr/share/asterisk/agi-bin/’: File does not exist.

I don’t know how to manually correct the paths. The asterisk.conf has the correct path, but something somewhere is setting the path wrong.
I have no problem with building it again but I must of done something wrong last time… Is it something I set in the “menue”?
BTW, thanks for your help

The paths can be set using arguments to the “configure” script. I always use the defaults so I don’t know what you’d need to pass, but they would show up in “./configure --help”.

As for not working - you’ll need to provide your precise current asterisk.conf and also ensure that the correct asterisk.conf is being used.

I am still not sure what to do to solve the current problem.

I think everything would work fine if I could get the core to look for files at /var/lib/asterisk instead of /usr/share/asterisk

I looked at configure script, but that will mean a rebuild and I am afraid that will create more issue.

The installation was done some time ago and I see I have three usernames spread across the files: root, asterisk, asteriskpbx. All my current work has been done as root and that is OK.

could this be part of the problem as I do a rebuild?

I really don’t know, your system is in enough of a mess to be uncertain of anything. I can only give the information I’ve given previously. Have to confirm that the asterisk.conf file you expect is being read and go from there.

thanks… I have backed up by current configuration files and I think I will do a complete reinstall.

It is now working. I was planning to remove everthing and start over. But just for grins I checked the installation info and realized I had NOT run make config after the rebuild. I ran it and if cleaned up my problems.
I guess you had been suggesting I look at that area from the beginning. So I am back in business.
Again thanks