What is equivalent function to “mv” command in php for Asterisk Spool directory usage?

Home » Asterisk Users » What is equivalent function to “mv” command in php for Asterisk Spool directory usage?
Asterisk Users 4 Comments

Hi Everyone,

I understand that there are a few warnings about using “cp” to move .call
files to /var/spool/asterisk/outgoing as they might acted upon before copy
is done. So, using PHP, What is the equivalent of “mv” command? Would it be
rename() in php or is there a better method?

Thanks,

4 thoughts on - What is equivalent function to “mv” command in php for Asterisk Spool directory usage?

  • PERL has a move() command; I wouldn’t expect less out of PHP.

    _____

    href=”mailto:asterisk-users-bounces@lists.digium.com”>asterisk-users-bounces@lists.digium.com
    [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Bruce B
    Sent: Tuesday, December 21, 2010 2:20 PM
    for Asterisk Spool directory usage?

    Hi Everyone,

    I understand that there are a few warnings about using “cp” to move .call
    files to /var/spool/asterisk/outgoing as they might acted upon before copy
    is done. So, using PHP, What is the equivalent of “mv” command? Would it be
    rename() in php or is there a better method?

    Thanks,

  • I have been using:
    exec (‘mv *.call /var/spool/asterisk/outgoing’)

    and for a long time it has been working just fine for me on more than one
    websites. Just make sure the folder where you create the call files has
    correct permissions and ownerships so that the file is successfully moved by
    the apache user to its destination.

    Zeeshan A Zakaria

  • Not really an Asterisk question…

    +1

    This will create a new process — a relatively expensive activity.

    Also, this assumes the path to mv is in the PATH environment variable
    which it usually is, but if not can lead to a lot of confusion.