I am trying to find the right place in FreePBX dialplans to insert a call to an AGI script to send the caller id name to MQTT. I’m using this to announce callers on Alex and Google Home, but right now where I have the script called [from-pstn-custom] the caller id lookups (superfecta etc.) have not yet been performed.
I’ve been tracing down the incoming dialplan execution trying to find a custom hook context I could use to execute the script but there doesn’t seem to be a consistent place to do it for all inbound external calls. I can do it for selected destination end points (like ring groups) but I’d rather have the script called independent of the inbound route selected.
Set your Inbound Route to point to a Custom Destination, with Return set to Yes and Destination set to the original target. The target of the Custom Destination is custom dial plan that calls your AGI then returns.
This will be cumbersome if you have many Inbound Routes with different targets.