How to run the script after the call ends?

I have a script that is run on Advanced Settings - Post Call Recording Script

/usr/bin/php /var/lib/asterisk/bin/run.php ^{ARG3}

^{ARG3} - this is an internal number (extensions)

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.

1 Like

i did it like in your example in the file /etc/asterisk/extensions_custom.conf

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

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

also in the log it is never mentioned


it works for me

1 Like

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