[asterisk-users] Custom PHP for Call Files

er ic email.eherr9633 at gmail.com
Sun Dec 27 21:14:23 CST 2015


I am hoping to get some help here with building custom PHP to manage a
'wake up call' system.

I have the script where the user can set the schedule for an extension wake
up call.

It appears to write to the /var/spool/asterisk/outgoing/ directory.

My two issues:

1 - when the files do get moved over to outgoing/ directory via a cron job,
the permissions show "-rw-r--r-- 1 apache apache 100 Jan  1  2016
5680a312a28b2.call" and the calls get sent when the date comes to pass. But
my question is, if I mv 3 files from my php script,  'll
/var/spool/asterisk/outgoing/' shows 'total 12' when there are only three
files in the directory. What does total mean? Is my perl script doing
something that I am not aware of and really there are 12 files overlapped
or something funky?

--- cron job perl script
my @list = glob("/tmp/*.call");
for( 0 .. $#list )
{
        system "mv $list[$_] /var/spool/asterisk/outgoing/";
}
-------------------------------

2 - I would like to view and delete call files but as it currently stands,
php gets a permission denied.
obviously php is running as apache and the outgoing/ directory is
asterisk:asterisk but the call files are apache:apache. My question is,
what is the best way, without risking security, to allow php to list and
delete the files? I know my scripts themselves work because when I chown
apache:apache /var/spool/asterisk/outgoing the script works. I have seen
front ends work with all the same permissions on outgoing/ and the files
but I dont know how they are able to read/delete the files for monitor/
which is the same as the outgoing/ directory.

Thanks for your help in advance all!
--Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20151227/e943597b/attachment.html>


More information about the asterisk-users mailing list