Callfile: Legendary utime

Colleagues, please tell me the answer to my question!
This is probably a millionth question on this topic, but I have not found an answer in the form of a clear explanation with the recommendations.

I have a running web server (nginx), it runs a script on php, and that one creates call-files.
For simple integration - probably a completely standard solution.

Permissions of directorys /var/spool/asterisk/tmp, /var/spool/asterisk/outgoingare changed so that other users can write to them.
After creating the call-file, it is set mask 0777.

However - the famous line always appears.

[Oct 20 09:11:01] WARNING[100973]: pbx_spool.c:350 void safe_append(struct outgoing *, time_t, char *): Unable to set utime on /var/spool/asterisk/outgoing/ Operation not permitted

At the same time, a task normally performed.

Why asterisk can’t a make utime and why does he need it at all?


Make sure that, if Asterisk isn’t running as root, the file is owned by the user under which Asterisk is running.

Disable SELINUX or tag the file properly.

Asterisk uses utime to reschedule the job after a failure:

Don’t set execute bits on files that don’t need them.

        struct utimbuf tbuf = { .actime = now, .modtime = now + o->retrytime };
        /* Update the file time */
        if (utime(o->fn, &tbuf)) {
                ast_log(LOG_WARNING, "Unable to set utime on %s: %s\n", o->fn, strerror(errno));

The modified time seems to be used to contain the time for the next attempt.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.