Monday, 27 October 2014

Accessing the full P-Asserted-Identity header from FreeSWITCH

I hope this can save the reader some time.
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.

4 comments:

Hi,Is 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.