please tell me how to make this script run after the end of the call through the dialplan with the required argument (^{ARG3)
I want to get away from the dependence of the script on the call recording
See the section " How do I perform a custom action on hangup?" Note that you will need to ref the channel variable as ${xxxx} and not as ^{xxx}, that style is unique to the post call recording script.
i did it like in your example in the file /etc/asterisk/extensions_custom.conf
[macro-dialout-one-predial-hook]
exten => s,1,Noop(Entering user defined context macro-dialout-one-predial-hook in extensions_custom.conf)
exten => s,n,Set(CHANNEL(hangup_handler_push)=lgaetz-do-this-on-hangup,s,1)
exten => s,n,MacroExit
[lgaetz-do-this-on-hangup]
exten => s,1,Noop(Entering user defined context lgaetz-do-this-on-hangup in extensions_custom.conf)
exten => s,n,System(/usr/bin/php -f /var/lib/asterisk/bin/test.php ${CALLERID(num)})
exten => s,n,Return
but it doesn’t work in any way
in the log file I see the following message:
[2021-02-16 22:45:39] WARNING[4807] pbx.c: Unable to register extension 's' priority 1 in 'macro-dialout-one-predial-hook', already in use
[2021-02-16 22:45:39] WARNING[4807] pbx_config.c: Unable to register extension at line 320 of extensions.conf