I need to send specific P-Access-Network-Info SIP Header in INVITE on outgoing calls for my voip carrier to handle emergency numbers.
Each extension will use the same outgoing route with a carrier class SIP Trunk.
To handle the emergency numbers routing related to the extension geographical location, I need for each extension to send in INVITE the P-Access-Network-Info Header with a specific code for each extension.
Adding this in a custom outbound context should be relatively simple, but you’re going to have some fun getting the two variables filled in.
Spit-balling here: Set up the two variables in the Asterisk ASTDB associated with the extensions. This way, they are persistent across reboots. From there, you can use a “DBGET” to snag them, fill them in, and send them out in a header like the ones described in Hooking for fun and income
You should be able to get the environment built in a couple of lines in a custom context, then use the data items in your addsipheader() (name changed to protect the lazy) function on the way out to the trunk.
After you get that done, I’d suggest submitting a Feature Request so that people that need that stuff can use it and maybe we can get someone to build an extension to the Extensions module that allows that data to be set from the GUI.
Even though they are my corporate overlord, I never shill for Sangoma. In spite of that, yeah - you fund the work and they make it available to the world would be awesome.