[Users] Faster to do avp_printf();avp_check OR search()?
Bogdan-Andrei Iancu
bogdan at voice-system.ro
Thu Aug 25 16:50:17 CEST 2005
Hi Kanakatti,
for extracting an hdr into an AVP, you can use avp_write() instead of
avp_printf() - it's faster since it's not so complex ;)
regards,
bogdan
Kanakatti Mahesh Subramanya wrote:
> True. and agreed.
>
> I was actually trying to be more general, i.e., if I wanted to do some
> processing on the contents of a specific header, would it be more
> efficient to extract that header using avp_printf(), and then search
> within it, as compared to just searching on the whole message
>
> The answer, as it turns out, is that yes it is probably faster
> (limited to walking through and extracting just the header), and safer
> (less chance of matching against something else altogether)
>
> thanx
>
> Daniel-Constantin Mierla wrote:
>
>> If you want just to check if there is a Refer-To header, you can use
>> the function is_present_hf() from textops module. This is the fastest
>> way to check if a header exists.
>>
>> Daniel
>>
>>
>> On 08/24/05 16:12, Kanakatti M. Subramanya wrote:
>>
>>> e.g., if I want to do something if there is a Refer-To header in the
>>> message,
>>> am I better off doing
>>> avp_printf("$someAvp", "$rt");
>>> avp_check("$rt", "re/.../i");
>>>
>>> or
>>>
>>> search("/.../");
>>> Just want ot know whether to get started rewriting all the
>>> "search()" strings i have in my ser.cfg....
>>>
>>> cheers
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at openser.org
>>> http://openser.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>_______________________________________________
>Users mailing list
>Users at openser.org
>http://openser.org/cgi-bin/mailman/listinfo/users
>
>
More information about the Users
mailing list