By “reload” I mean change any setting in FreePBX that causes the “click here to reload” banner to appear, and click on the banner. After that, dialparties.agi is no longer executable.
Here is /var/lib/asterisk/agi-bin before reloading:
-rwxrwxr-x 1 asterisk asterisk 1742 Sep 30 16:09 agi-test.agi
-rwxr-xr-x 1 asterisk asterisk 1872 Feb 22 16:04 checksound.agi
-rwxr-xr-x 1 asterisk asterisk 30970 Feb 22 16:04 dialparties.agi
-rwxr-xr-x 1 asterisk asterisk 13305 Feb 22 16:04 directory
-rwxr-xr-x 1 asterisk asterisk 4435 Feb 22 16:04 directory.agi
-rwxr-xr-x 1 asterisk asterisk 12903 Feb 22 16:04 directory.lib.php
-rwxrwxr-x 1 asterisk asterisk 86431 Sep 30 16:09 eagi-sphinx-test
-rwxrwxr-x 1 asterisk asterisk 143755 Sep 30 16:09 eagi-test
-rwxr-xr-x 1 asterisk asterisk 5638 Feb 22 16:04 enumlookup.agi
-rwxr-xr-x 1 asterisk asterisk 1613 Feb 22 16:04 fixlocalprefix
-rwxrwxr-x 1 asterisk asterisk 14530 Sep 30 16:09 jukebox.agi
-rwxr-xr-x 1 asterisk asterisk 2003 Feb 22 16:04 list-item-remove.php
-rwxr-xr-x 1 asterisk asterisk 10262 Feb 22 16:04 pbdirectory
-rwxrwxr-x 1 asterisk asterisk 26904 Feb 22 15:41 phpagi-asmanager.php
-rwxrwxr-x 1 asterisk asterisk 65906 Feb 22 15:41 phpagi.php
-rwxr-xr-x 1 asterisk asterisk 3710 Feb 22 16:04 queue_devstate.agi
-rwxr-xr-x 1 asterisk asterisk 21117 Feb 22 16:04 sql.php
-rwxr-xr-x 1 asterisk asterisk 18005 Feb 22 16:04 user_login_out.agi
Now, I change a setting in FreePBX and click on “Apply Configuration Changes”, then “Continue with reload”.
Now, here it is:
-rwxrwxr-x 1 asterisk asterisk 1742 Sep 30 16:09 agi-test.agi
-rwxr-xr-- 1 asterisk asterisk 1872 Feb 23 17:42 checksound.agi
-rwxr-xr-- 1 asterisk asterisk 30970 Feb 23 17:42 dialparties.agi
-rwxr-xr-- 1 asterisk asterisk 13305 Feb 23 17:42 directory
-rwxr-xr-- 1 asterisk asterisk 4435 Feb 23 17:42 directory.agi
-rwxr-xr-- 1 asterisk asterisk 12903 Feb 23 17:42 directory.lib.php
-rwxrwxr-x 1 asterisk asterisk 86431 Sep 30 16:09 eagi-sphinx-test
-rwxrwxr-x 1 asterisk asterisk 143755 Sep 30 16:09 eagi-test
-rwxr-xr-- 1 asterisk asterisk 5638 Feb 23 17:42 enumlookup.agi
-rwxr-xr-- 1 asterisk asterisk 1613 Feb 23 17:42 fixlocalprefix
-rwxrwxr-x 1 asterisk asterisk 14530 Sep 30 16:09 jukebox.agi
-rwxr-xr-- 1 asterisk asterisk 2003 Feb 23 17:42 list-item-remove.php
-rwxr-xr-- 1 asterisk asterisk 10262 Feb 23 17:42 pbdirectory
-rwxrwxr-x 1 asterisk asterisk 26904 Feb 22 15:41 phpagi-asmanager.php
-rwxrwxr-x 1 asterisk asterisk 65906 Feb 22 15:41 phpagi.php
-rwxr-xr-- 1 asterisk asterisk 3710 Feb 23 17:42 queue_devstate.agi
-rwxr-xr-- 1 asterisk asterisk 21117 Feb 23 17:42 sql.php
-rwxr-xr-- 1 asterisk asterisk 18005 Feb 23 17:42 user_login_out.agi
Please give full details of what you do. I see that the first reporter use Elastix, there might be some script added there that do something that FreePBX does not.
I can’t believe that this problem is so rare. Every time I reload, the permissions get reset (execute gets removed) on dialparties.agi. Does this really not happen to anyone else?
Since Asterisk itself is running as root, setting the agi-bin files to root:root also fixes the problem. Are there any FreePBX ramifications for doing this?
I understand that it would be better to run Asterisk as a non-root user. However, it doesn’t seem like this is the normal configuration.
i have the same issue. started yesterday. only affects ring groups with permission denied when a ring group is called and the call goes to final destination
use chmod 777 dialparties.agi which fixes and after a reload it reverts
I have the same issue. A reload changes the permissions in the /var/lib/asterisk/agi-bin/ directory to 754. I started looking into do_reload, which is the function that executes when you do a reload in freepbx and then found two places where a chmod to 754 occurs in retrieve-conf, but its only supposed to affect the modules directory, also function err_copy does a chmod to 754. Still don’t know why its being applied to my agi directory. Help please.