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

Bogdan-Andrei Iancu bogdan at voice-system.ro
Wed Aug 24 19:49:20 CEST 2005


Hi Kanakatti,

IMHO , the first approach should be faster and saver.

why faster? instead of applying  re over the entire message (as search 
does), you will limit to the hdr body. Parsing to extract the hdr is 
also more faster (and usualy means just walking over the hdr list, since 
the msg may be already parsed).

why saver? re to match exactly the hdr and the check the body, excepting 
that are complex and slow, may fail and do wrong matching - the internal 
hdr parser cannot fail and always identify precisely the hdr.

regards,
bogdan


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
>  
>





More information about the Users mailing list