I been using Asterisk for years and have always maintained sip.conf/extensions.conf manual.
I have installed and setup FreePBX for a small company in the last week. Everything is working fine…EXCEPT.
We have an AGI/Php script we need to execute when someone places an outbound call.
The script queries a remote database of the number being called and returns a ten digit number. This number is set as the outbound caller id. (There is a lookup of number being called…then referenced to zip code…then to regional number associated). This part works fine.
The PROBLEM —
I can’t figure out how to include or trigger that special context on OUTBOUND calls.
We send number to be called and it returns the number we need to set as the outbound caller id.
How do I execute this on all outbound calls?
Outbound calls to ten(10) digits numbers,
If it was an incoming AGI/Script…I would do the same thing…then map a Custom Destination to the custom context then set the inbound route to the custom destination.
This being outbound…I can’t find a way to include…or use it.
please advise.
I’m not understanding how to edit an existing context to include my context…
That really is my question… I also didn’t know what context I should be including mine to.
How do I add “Include => set-outbound-callerid” to the existing macro-dialout-trunk-predial-hook ?
In other words, put your custom dial plan into extensions_custom.conf, but name the context macro-dialout-trunk-predial-hook, instead of set-outbound-callerid.
Great… that is working… The DB is query for the number being called… and we are getting the regional office number.
I have that number being returned as AGI variable.
How do I set this variable to the outbound caller id ?
I would use SET in my dial plan, but I’m not sure with all the extras macros / etc that are running.