If you need to read the entire content of the P-Asserted-Identity header of an incoming INVITE, be aware that you should change the sofia profile by adding a param like:
param name="p-asserted-id-parse" value="verbatim"
FreeSWITCH will populate the variable accordingly and make it available with commands like (e.g. with lua):
PAID = session:getVariable("sip_P-Asserted-Identity")
If you don't add this parameter, you'll get the default behaviour, which is just filling the variable with the P-Asserted-Identity URI username part.
Possible value are: "default", "user-only", "user-domain", "verbatim", which I think are self-explanatory.
A recent reference here.
Hi,
ReplyDeleteIs there a way to modify the value of P-Asserted-Identity before it is send to the provider? If I use {sip_cid_type=pid}sofia/gateway/MyProvider/$1, it gets the value in From header.
The provider wants to see a specific number in PAI and I cannot figure how to do it with FS.
This comment has been removed by the author.
DeleteThis comment has been removed by the author.
DeleteHi Drago,
Deleteyes, there is a way. With a classical XML dialplan you could try something like this:
< action application="set" data="sip_h_P-Asserted-Identity=sip:the_user@the_domain"/ >
Of course you can "build" the final P-Asserted-Identity SIP URI using variables, like:
< action application="set" data="sip_h_P-Asserted-Identity=sip:${PAI_user}@${PAI_domain}"/ >
It's easy to do the same with other approaches, like e.g. using Lua and setting that variable to the value you want, before the bridge instruction.
I hope this helps (and works, depending on your specific set up).
Giacomo