Answer the question
In order to leave comments, you need to log in
How to understand where the php script is executed?
In the extensions.conf of the Asterisk configuration file, we call:
exten => h,1,Agi(update.php,${trunk},${CDR(billsec)})
file_put_contents('/var/lib/asterisk/agi-bin/log.txt', exec('pwd'));
/var/lib/asterisk/agi-bin
/tmp
Answer the question
In order to leave comments, you need to log in
The full path to the current file or directory can be obtained using magic constants __FILE__
/ __DIR__
php.net/manual/en/language.constants.predefined.php
Use the realpath function to expand symbolic links and get the absolute path to a file.
php.net/manual/en/function.realpath.php
read the asterisk documentation.
Why don't you like the absolute path?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question