[Asterisk-Users] Overwriting SIP headers
Evan Borgström
evan.borgstrom at ca.mci.com
Wed May 17 08:08:59 MST 2006
I'm wondering if anyone has a solution to this before I begin looking
at making some changes to the SIP channel. Basically when calling
SIPAddHeader() twice from the Dialplan or an AGI script with the same
header name it adds duplicate headers instead of overwriting the
existing one.
Here's a practical situation where this applies. A call is to be
terminated via SIP and we have two possible routes to terminate the call
and the first requires a static value in the P-Asserted-Identity header
and the second requires a variable value in the same header. We do all
of our setup and then call SIPAddHeader to add our P-Asserted-Identity
with the static value and call Dial(). An error occurs so we wish to
fall back to the second provider, more setup work is done and
SIPAddHeader is called to add the new value the second provider wants
but when Dial is called this time instead of only the new value being
sent both values are sent and the request contains two
P-Asserted-Identity headers which causes problems with the second provider.
So, does anyone have a creative solution to this? I've already tried to
loop through the SIPADDHEADER0X variables and unset the previous values
(well set them to "") but it didn't help and unfortunately AGI doesn't
provide a way to delete variables.
Thanks,
-Evan
More information about the asterisk-users
mailing list