[asterisk-dev] reset/remove SipAddHeader() headers

Klaus Darilion klaus.mailinglists at pernau.at
Wed Jan 14 07:50:04 CST 2009


Hi!

As far as I saw in chan_sip (at least 1.4.22) once SIP headers are added 
with SipAddHeader() there is no way to remove them, which is bad if the 
request is rerouted to another SIp destination, e.g:

user      Asterisk      GW1        GW2
---INVITE-->
          add certain
          header for GW1:
          SipAddHeader(..)

               ---INVITE--->
               (contains additional
               header)


               <--500-------

          reroute request
          to a different GW


              ----------INVITE-------->
              this request also contains
              the added SIP header

Headers added with SipAddHeader are added to the incoming channel as 
global channel variables SIPADDHEADER01, SIPADDHEADER02, ....

Then on outgoing requests chan_sip will traverse the channel variables 
for SIPADDHEADERxx and add them.

Thus, it would be useful to reset the channel variables somehow, e.g. 
with an application SipAddHeaderReset();

I could not find any existing solution, thus what do you think about 
this new application?

thanks
klaus



More information about the asterisk-dev mailing list