[OpenSIPS-Users] TEXTOPS module

Bogdan-Andrei Iancu bogdan at voice-system.ro
Mon Dec 20 14:07:14 CET 2010

Hello Denis,

So far there is no good arguments for such a function, but there are a 
lot of performance penalties while using such a function.

Basically, to apply the change to a message, opensips/kamilio has to 1) 
take the received buffer and the changes and to generate a new buffer 
with the whole message (including the changes) and to 2) take the newly 
generate buffer and to parse it as a SIP content in order to be able to 
use internally it.
Bottom line, each time you use such a function you double the processing 
effort for parsing and generating SIP messages. And if you check the 
code profiling we did (see 
http://www.opensips.org/Resources/TestsProfiling), these operations are 
~50% from the total CPU usage (cumulate the PARSE and BUILD times).

Now, in most of the cases (99% of the case) you do not really need to 
apply changes in realtime - there are a lot of simple tricks to avoid 
it. If you describe the problem you have, I can help you in putting some 
extra logic in the script to avoid the need to apply changes.

Using a smart approach is more efficient than a brute force approach - 
the idea is that you are aware of the changes you do in script and you 
remember (in script) these changes, so you can take them into account in 
your later processing even if they are not actually applied on the SIPS 


Denis Putyato wrote:
> Hello!
> In kamailio project there is a function |msg_apply_changes() ||in 
> textops module for applying changes (for example add or subst some 
> header field) in SIP messages. Is there some way on opensips for doing 
> such operation? Now I need make signaling “loop” for change header 
> fields which I, for example, add during call process.|
> | |
> |Opensips 1.6.3|
> | |
> |Thank you || |
> ------------------------------------------------------------------------
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Bogdan-Andrei Iancu
OpenSIPS Event - expo, conf, social, bootcamp
2 - 4 February 2011, ITExpo, Miami,  USA

More information about the Users mailing list