[OpenSIPS-Users] variable "counter" parameter to diversion Header

Mickael HUBERT mickael at winlux.fr
Fri May 3 10:58:56 CEST 2013


some details:

remove_hf delete all Diversion header, how can I delete or rewrite good 
header ?

Le 03/05/2013 10:48, Mickael HUBERT a écrit :
> Hi,
> I have coded with while for treat all diversion headers.
>
> Ex:
> ....
> /while ($var(i) < $(hdrcnt(Diversion)))//
> //{//
> //if(!$(hdr(Diversion)[$var(i)]{param.value,counter}{s.int}) || 
> !$(hdr(Diversion)[$var(i)]{param.value,privacy}) || 
> !$(hdr(Diversion)[$var(i)]{param.value,reason}))//
> //    {//
> //        ..../
>
> after all these treatments, I can not replace the good diversion 
> header, if I have multiple diversion.
>
> Ex:
> If I have:
>
> /Diversion: <sip:******@hexanet.fr>; reason="user-busy"; 
> privacy="full" ;counter=3//
> //Diversion: <sip:******@hexanet.fr>; reason="user-busy"; privacy="off"/
>
> and if I use:
> remove_hf("Diversion"), to rewrite the second diversion header. 
> Opensips delete the first diversion header.
>
> How can I rewrite the good diversion header, here the second ?
>
> thanks
>
> Le 02/05/2013 19:21, Saúl Ibarra Corretgé a écrit :
>> On May 2, 2013, at 4:20 PM, Mickael HUBERT wrote:
>>
>>> Thank you very much, it's perfect ;)
>>>
>>> but, if I have many Diversion header in the same INVITE ? This command works ?
>>>
>> You can index the call to hdr(Diversion), IIRC there is an example in the transformations page showing how to iterate through a list of headers with the same name.
>>
>> --
>> Saúl Ibarra Corretgé
>> AG Projects
>>
>>
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20130503/59f8933d/attachment.htm>


More information about the Users mailing list