[Users] Editing headers

Bogdan-Andrei Iancu bogdan at voice-system.ro
Wed Sep 7 17:06:09 CEST 2005


in this case, try a subst:
   
subst('/^(P-Asserted-Identity):(.*)$/\1:<sip:\2 at sip.domian.com>/i')

haven't tried it, so it might need some tunnings.

regards,
bogdan


Martin Kjeldsen wrote:

> Yeah, I see that it's not the best and most secure way.
> But the trouble is that I would like to use the functions you are 
> suggesting but the 0.9.5 version doesn't support the avp_printf() 
> function and hence I'm still unable to use the avp functions to enter 
> combined data in the headers!
>
> Or am I mistaken?
>
> Regards
> Martin
>
>
> Bogdan-Andrei Iancu wrote:
>
>> Hi Martin,
>>
>> maybe that's the easiest way as number of cfg line, but is a totaly 
>> unsecure (second search may hit different parts of the message) and 
>> slow (as regexps):
>>
>> you may also try:
>>    avp_write("$hdr[P-Asserted-Identity]","i:10"); #get body
>>    avp_printf("i:10","<sip:$avp(i:10)@sip.domian.com>"); # compose 
>> new body
>>    remove_hf("P-Asserted-Identity"); #remove org. hdr
>>    avp_pushto("$P-Asserted-Identity/request","i:10"); # set new hdr
>>
>> regards,
>> bogdan
>>
>> Martin Kjeldsen wrote:
>>
>>> Hi
>>>
>>> Can I use Textops, to alter headers in a invite message?
>>> This is what I'm trying to do!
>>>
>>>        search_append("P-Asserted-Identity: ", "<sip:");
>>>        search_append(" [0-9]\{8\}", "@sip.domian.com>");
>>>
>>> Is this at all possible or should I try some other way?
>>> The data I want to add to the header is static.
>>>
>>> I'm using OpenSER 0.9.5
>>>
>>> Thanks in advance
>>>
>>> Martin
>>>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at openser.org
>>> http://openser.org/cgi-bin/mailman/listinfo/users
>>>
>>
>
>





More information about the sr-users mailing list