Now I want to add src and dst to my own table and I wrote a PHP script for that, so I need to run a script after every call hang up independently which extension is executed.
What should I do?
I have tried h extension but it dose not work when I directly call to an agent(for example 200).
Macros have been removed in the latest version of Asterisk and their demise was first announced around Asterisk 1.6, so you should not be using a macro.
Also people here will have no idea what your AGI scripts do.
Using ARI for this would be an off label use. The intended use of ARI is custom dialplan applications.
Most people wanting to run something on hangup want to access information from the channel, or from open CDRs, but the channel hangup and CDR finalisation would proceed in parallel with the AMI and ARI events.
I was using medicine as a metaphor. Off label there means you are using a medicine for a purpose for which it isn’t licensed. I generalised that to a purpose for which it wasn’t designed.