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

Răzvan Crainea razvan at opensips.org
Fri May 3 13:23:37 CEST 2013


Hi, Mickael!

remove_hf() removes all headers, so it should remove both first and the 
second one. Then you can simply add a new header(using append_hf() 
function[1]) with the desired information.

[1] http://www.opensips.org/html/docs/modules/1.9.x/sipmsgops.html#id249181

Best regards,

Razvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 05/03/2013 10:58 AM, Mickael HUBERT wrote:
> 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
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>



More information about the Users mailing list