[Users] Faster to do avp_printf();avp_check OR search()?

Kanakatti Mahesh Subramanya mahesh at aptela.com
Thu Aug 25 16:44:10 CEST 2005

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)


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mahesh.vcf
Type: text/x-vcard
Size: 332 bytes
Desc: not available
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20050825/2d13b090/attachment.vcf>

More information about the sr-users mailing list