Incorrect sound files path in Asterisk/FreePBX

I have a problem because Asterisk does not see the IVR recording files. I have debugged the issue and noticed that Asterisk is using an incorrect path for ASTDATADIR, which is set to /usr/share/asterisk. However, FreePBX uses the path /var/lib/asterisk.

I tried changing the ASTDATADIR variable, but it had no effect—Asterisk persistently continues to use /usr/share/asterisk.

sudo asterisk -rx “core show settings” | grep “Data directory”
Data directory: /usr/share/asterisk

What should I do in this situation?

How did you install Asterisk? This isn’t the default.

This will occur if you fail to remove the:

(!)

Beside

[directories](!)

in asterisk.conf, as it means it is a template and not to be treated as a configuration section.

I solved the problem by creating the appropriate symbolic links between /usr/share/asterisk and /var/lib/asterisk . Of course, I also copied the necessary contents of the directories.