So I set up an AGI to recreate my CID number, but ran into another problem:
Is there any chance to get a custom header with info of the dialed number into a pagegroup?
I managed to change [autoanswer] by coping it into extensions_override_freepbx.conf:
I thought this would be a good place, beause it deals already with headers, but there I cannot get the original called number by originator of the call.
Do you also have a little advice for this problem?
You can do this without modifying existing dialplan. Set it up as
Misc Application → Custom Destination (Return) → Page Group
For the custom Destination, write your own block of dialplan like:
exten => s,1,Noop(Entering user defined context custom-page-headers in extensions_custom.conf)
exten => s,n,DumpChan
exten => s,n,Return()
The DumpChan will give you a list of call details and defined variables at the asterisk console you can reference, one of them will be the dialed digits. Define the headers in this block with Gosub func-set-sipheader, but don’t run the func-apply-sipheaders, that will be done for you later in the call.
So now is when I admit that I’ve never attempted to add custom SIP headers to a paging call before. It appears that somewhere late in the call flow, the SIPHEADERS hash gets reset, probably to accommodate the auto answer feature. I think you’ll have to go back to your initial plan, but this time remove the gosub to func-set-sipheaders.