Re: [OpenSIPS-Users] textops module replace functions don't work

2018-02-28 Thread Bogdan-Andrei Iancu

Hi Yuval,

First, please subscribe to the list in order to be able to properly post 
messages here.


Secondly, on your issue - before the replace function do you perform any 
other changes over the body ?


Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Summit 2018
  http://www.opensips.org/events/Summit-2018Amsterdam

On 02/26/2018 06:45 PM, Dinari, Yuval wrote:

Hi,
I tried all of them, not just those two but also replace_all(), 
replace_body_all(), replace_body_atonce(), subst(), and subst_body().

Thanks

On Mon, Feb 26, 2018 at 5:54 PM, Bogdan-Andrei Iancu 
> wrote:


Hi,

Have you used replace() or replace_body() ?

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   http://www.opensips-solutions.com 
OpenSIPS Summit 2018
   http://www.opensips.org/events/Summit-2018Amsterdam


On 02/26/2018 12:31 PM, Dinari, Yuval via Users wrote:

Hi,
I tried using textops module functions to replace a part of the
message body, but the body remains unchanged. A search() with the
regex to be replaced succeeds.
I tried all replacement functions (replace*, subst, subst_body).
I see that the body is unchanged by printing $rb, and also
ngreping the SDP that opensips sends out to rtpengine via
rtpengine_offer().
opensips version - 2.2.5
Thanks


___
Users mailing list
Users@lists.opensips.org 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users






___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] textops module replace functions don't work

2018-02-27 Thread Dinari, Yuval via Users
Hi,
I tried all of them, not just those two but also replace_all(),
replace_body_all(), replace_body_atonce(), subst(), and subst_body().
Thanks

On Mon, Feb 26, 2018 at 5:54 PM, Bogdan-Andrei Iancu 
wrote:

> Hi,
>
> Have you used replace() or replace_body() ?
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>   http://www.opensips-solutions.com
> OpenSIPS Summit 2018
>   http://www.opensips.org/events/Summit-2018Amsterdam
>
> On 02/26/2018 12:31 PM, Dinari, Yuval via Users wrote:
>
> Hi,
> I tried using textops module functions to replace a part of the message
> body, but the body remains unchanged. A search() with the regex to be
> replaced succeeds.
> I tried all replacement functions (replace*, subst, subst_body).
> I see that the body is unchanged by printing $rb, and also ngreping the
> SDP that opensips sends out to rtpengine via rtpengine_offer().
> opensips version - 2.2.5
> Thanks
>
>
> ___
> Users mailing 
> listUsers@lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] textops module replace functions don't work

2018-02-26 Thread Bogdan-Andrei Iancu

Hi,

Have you used replace() or replace_body() ?

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Summit 2018
  http://www.opensips.org/events/Summit-2018Amsterdam

On 02/26/2018 12:31 PM, Dinari, Yuval via Users wrote:

Hi,
I tried using textops module functions to replace a part of the 
message body, but the body remains unchanged. A search() with the 
regex to be replaced succeeds.

I tried all replacement functions (replace*, subst, subst_body).
I see that the body is unchanged by printing $rb, and also ngreping 
the SDP that opensips sends out to rtpengine via rtpengine_offer().

opensips version - 2.2.5
Thanks


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Textops Module Integration with presence. Changes not visible-- replace_body_all

2013-02-14 Thread Muhammad Shahzad
First your opensips configuration indicates you are using a very old
version of opensips (1.6.x perhaps). There are many major changes in
textops modules in newer version which fix tons of problems.

Secondly i doubt if you will be able to see changes through ngrep. This
tool will show you the original message received on ethernet interface,
before it is handed over to opensips for processing. And since your
opensips is the end-point from where the message is not routed any further
(to another server), so changes you do will be invisible to ngrep.

Thank you.


On Thu, Feb 14, 2013 at 12:25 PM, garima sharma
garima.sharm...@gmail.comwrote:

 Hi

 I am trying to use textops modules with standalone presence server. The
 opensips server starts without error but the replace_body change done in
 is_method(PUBLISH) is not reflected during testing.

 The changes in PUBLISH messages seen in ngrep is not changed. kindly help

 #
 # $Id$
 #
 # simple quick-start config script - Stand-alone presence server
 #

 # --- global configuration parameters 

 debug=3 # debug level (cmd line: -dd)
 fork=yes
 log_stderror=no # (cmd line: -E)
 children=4

 listen=udp:192.168.1.100:5065
 port=5065

 #dns=no
 #rev_dns=no

 # -- module loading --

 #set module path
 mpath=/usr/lib/opensips/modules/

 loadmodule db_mysql.so
 loadmodule sl.so
 loadmodule signaling.so
 loadmodule maxfwd.so
 loadmodule textops.so
 loadmodule tm.so
 loadmodule rr.so
 loadmodule exec.so
 loadmodule presence.so
 loadmodule presence_xml.so
 loadmodule avpops.so
 loadmodule mi_fifo.so
 loadmodule usrloc.so
 loadmodule pua.so
 loadmodule pua_usrloc.so
 loadmodule registrar.so



 # - setting module-specific parameters ---
  modparam(usrloc, db_mode, 2)
 modparam(usrloc, db_url, mysql://opensips:opensipsrw@localhost
 /opensips)

 # -- presence params --
 modparam(presence|presence_xml, db_url,
 mysql://opensips:opensipsrw@localhost/opensips)

 modparam(presence_xml, force_active, 1)

 modparam(presence, server_address, sip:192.168.1.100:5065)

 modparam(mi_fifo, fifo_name, /tmp/opensips_fifo)


 modparam(pua, db_url, mysql://opensips:opensipsrw@localhost
 /opensips)
 modparam(pua_usrloc, default_domain, 192.168.1.100)
 modparam(pua_usrloc, presence_server, sip:192.168.1.100:5065)

 # - request routing logic ---

 # main routing logic

 route{
 # initial sanity checks -- messages with
 # max_forwards==0, or excessively long requests
 if (!mf_process_maxfwd_header(10)) {
 sl_send_reply(483,Too Many Hops);
 exit;
 };


  if (!is_method(SUBSCRIBE|PUBLISH)) {
 sl_send_reply(488, Not Acceptable Here);
 exit;
 }



* if ((is_method(PUBLISH))  ($fU==bob)) {

 replace_body_all(closed, open);
 }*



 # presence handling
 if (! t_newtran())
 {
 sl_reply_error();
 exit;
  };

 if(is_method(PUBLISH))
 {

 handle_publish();

 }

 else
 if( is_method(SUBSCRIBE))
 {

 handle_subscribe();

 };

 exit;
 }


 --
 Thanks and Regards
 Garima Sharma
 ___
 Users mailing list
 Users@lists.opensips.org
 http://lists.opensips.org/cgi-bin/mailman/listinfo/users




-- 
Muhammad Shahzad
---
CISCO Rich Media Communication Specialist (CRMCS)
CISCO Certified Network Associate (CCNA)
Cell: +49 176 99 83 10 85
MSN: shari_78...@hotmail.com
Email: shaherya...@googlemail.com
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] TEXTOPS module

2010-12-21 Thread Denis Putyato
Thank you Bogdan, that is working

-Original Message-
From: users-boun...@lists.opensips.org 
[mailto:users-boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu
Sent: Monday, December 20, 2010 5:27 PM
To: OpenSIPS users mailling list
Subject: Re: [OpenSIPS-Users] TEXTOPS module

Hi Denis,

the best way to do it is via branch_route 
(http://www.opensips.org/Resources/DocsCoreRoutes16#toc2) . Whatever 
changes you do there will be applied only for that particular branch and 
not for all branches. When you do changes in the request route, the 
changes will be applied to all future branches !

So, do something like this:

- in request route (first time) put the RPID, PAI and FROM (new vals ) 
in 2 different AVPS (according to the first selected GW)
- arm a branch route and failure route
- do t_relay() - this will trigger the branch route and you can do the 
changes to the messages ( as you do it now)
- if you end up in failure route - set new values for the 3 AVPs, 
reflecting the new destination
- do t_relay() - triggers branch route, etc..

Regards,
Bogdan


Denis Putyato wrote:
 Thank you Bogdan for your answer. Now I understood that apply changes is a 
 bad idea.
 But during process a call I have to make some changes to INVITE message. 
 For example,
 I need to add Remote-Party-ID (RPI) and/or P-Asserted-ID (PAI) and make 
 uac_replace_from(). If I make it for the first time everything fine. 
 But if I need then change these fields (via subst or uac_replace_from() 
 again)(for example, some gateways fails and cannot accepts call, I use 
 use_next_gw() of d_routing module and MUST change callerid information) then 
 my tests show that during, for example, second time call of 
 uac_replace_from() there are two uri in From: header field (as you understand 
 that is wrong), or if I make subst() of RPI or PAI then second header RPI and 
 PAI appear in addition of first headers which I added (or subst) before. 


 And to avoid this I make signaling loop. New INVITE process as a new message 
 with modified early headers, so I can change it again.   

 -Original Message-
 From: users-boun...@lists.opensips.org 
 [mailto:users-boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu
 Sent: Monday, December 20, 2010 4:07 PM
 To: OpenSIPS users mailling list
 Subject: Re: [OpenSIPS-Users] TEXTOPS module

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

 Regards,
 Bogdan

 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@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
www.voice-system.ro


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] TEXTOPS module

2010-12-20 Thread Bogdan-Andrei Iancu

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


Regards,
Bogdan

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@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
www.voice-system.ro


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] TEXTOPS module

2010-12-20 Thread Denis Putyato
Thank you Bogdan for your answer. Now I understood that apply changes is a bad 
idea.
But during process a call I have to make some changes to INVITE message. 
For example,
I need to add Remote-Party-ID (RPI) and/or P-Asserted-ID (PAI) and make 
uac_replace_from(). If I make it for the first time everything fine. 
But if I need then change these fields (via subst or uac_replace_from() 
again)(for example, some gateways fails and cannot accepts call, I use 
use_next_gw() of d_routing module and MUST change callerid information) then my 
tests show that during, for example, second time call of uac_replace_from() 
there are two uri in From: header field (as you understand that is wrong), or 
if I make subst() of RPI or PAI then second header RPI and PAI appear in 
addition of first headers which I added (or subst) before. 

And to avoid this I make signaling loop. New INVITE process as a new message 
with modified early headers, so I can change it again.   

-Original Message-
From: users-boun...@lists.opensips.org 
[mailto:users-boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu
Sent: Monday, December 20, 2010 4:07 PM
To: OpenSIPS users mailling list
Subject: Re: [OpenSIPS-Users] TEXTOPS module

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

Regards,
Bogdan

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@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
www.voice-system.ro


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] TEXTOPS module

2010-12-20 Thread Stanisław Pitucha
On 20/12/10 13:51, Denis Putyato wrote:
 Thank you Bogdan for your answer. Now I understood that apply changes is a 
 bad idea.
 But during process a call I have to make some changes to INVITE message. 
 For example,
 I need to add Remote-Party-ID (RPI) and/or P-Asserted-ID (PAI) and make 
 uac_replace_from(). If I make it for the first time everything fine. 
 But if I need then change these fields (via subst or uac_replace_from() 
 again)(for example, some gateways fails and cannot accepts call, I use 
 use_next_gw() of d_routing module and MUST change callerid information) then 
 my tests show that during, for example, second time call of 
 uac_replace_from() there are two uri in From: header field (as you understand 
 that is wrong), or if I make subst() of RPI or PAI then second header RPI and 
 PAI appear in addition of first headers which I added (or subst) before. 
 
 And to avoid this I make signaling loop. New INVITE process as a new message 
 with modified early headers, so I can change it again.   

I'm not 100% sure if that will work in your case (never used uac), but
you may be able to do all this by starting transaction early. If you
force t_newtran() early in the script (you probably should anyways), any
modification done to the message after that point should not be present
in the failure route.

So do t_newtran(), get the first gateway, modify as needed - if you
fail, just reapply the changes as if you were working on the original
message.

Unless someone shouts now that it doesn't interact properly with uac
that is ;)

Regards,
Stan

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] TEXTOPS module

2010-12-20 Thread Denis Putyato
Hello Stan 
I will try to do what you say.


-Original Message-
From: users-boun...@lists.opensips.org 
[mailto:users-boun...@lists.opensips.org] On Behalf Of Stanislaw Pitucha
Sent: Monday, December 20, 2010 5:10 PM
To: users@lists.opensips.org
Subject: Re: [OpenSIPS-Users] TEXTOPS module

On 20/12/10 13:51, Denis Putyato wrote:
 Thank you Bogdan for your answer. Now I understood that apply changes is a 
 bad idea.
 But during process a call I have to make some changes to INVITE message. 
 For example,
 I need to add Remote-Party-ID (RPI) and/or P-Asserted-ID (PAI) and make 
 uac_replace_from(). If I make it for the first time everything fine. 
 But if I need then change these fields (via subst or uac_replace_from() 
 again)(for example, some gateways fails and cannot accepts call, I use 
 use_next_gw() of d_routing module and MUST change callerid information) then 
 my tests show that during, for example, second time call of 
 uac_replace_from() there are two uri in From: header field (as you understand 
 that is wrong), or if I make subst() of RPI or PAI then second header RPI and 
 PAI appear in addition of first headers which I added (or subst) before. 

 
 And to avoid this I make signaling loop. New INVITE process as a new message 
 with modified early headers, so I can change it again.   

I'm not 100% sure if that will work in your case (never used uac), but
you may be able to do all this by starting transaction early. If you
force t_newtran() early in the script (you probably should anyways), any
modification done to the message after that point should not be present
in the failure route.

So do t_newtran(), get the first gateway, modify as needed - if you
fail, just reapply the changes as if you were working on the original
message.

Unless someone shouts now that it doesn't interact properly with uac
that is ;)

Regards,
Stan

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] TEXTOPS module

2010-12-20 Thread Bogdan-Andrei Iancu

Hi Denis,

the best way to do it is via branch_route 
(http://www.opensips.org/Resources/DocsCoreRoutes16#toc2) . Whatever 
changes you do there will be applied only for that particular branch and 
not for all branches. When you do changes in the request route, the 
changes will be applied to all future branches !


So, do something like this:

- in request route (first time) put the RPID, PAI and FROM (new vals ) 
in 2 different AVPS (according to the first selected GW)

- arm a branch route and failure route
- do t_relay() - this will trigger the branch route and you can do the 
changes to the messages ( as you do it now)
- if you end up in failure route - set new values for the 3 AVPs, 
reflecting the new destination

- do t_relay() - triggers branch route, etc..

Regards,
Bogdan


Denis Putyato wrote:

Thank you Bogdan for your answer. Now I understood that apply changes is a bad 
idea.
But during process a call I have to make some changes to INVITE message. 
For example,
I need to add Remote-Party-ID (RPI) and/or P-Asserted-ID (PAI) and make uac_replace_from(). If I make it for the first time everything fine. 
But if I need then change these fields (via subst or uac_replace_from() again)(for example, some gateways fails and cannot accepts call, I use use_next_gw() of d_routing module and MUST change callerid information) then my tests show that during, for example, second time call of uac_replace_from() there are two uri in From: header field (as you understand that is wrong), or if I make subst() of RPI or PAI then second header RPI and PAI appear in addition of first headers which I added (or subst) before. 

And to avoid this I make signaling loop. New INVITE process as a new message with modified early headers, so I can change it again.   


-Original Message-
From: users-boun...@lists.opensips.org 
[mailto:users-boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu
Sent: Monday, December 20, 2010 4:07 PM
To: OpenSIPS users mailling list
Subject: Re: [OpenSIPS-Users] TEXTOPS module

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


Regards,
Bogdan

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@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
www.voice-system.ro


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] TEXTOPS module

2010-12-20 Thread Denis Putyato
Thank you Bogdan I will try and let you know

-Original Message-
From: users-boun...@lists.opensips.org 
[mailto:users-boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu
Sent: Monday, December 20, 2010 5:27 PM
To: OpenSIPS users mailling list
Subject: Re: [OpenSIPS-Users] TEXTOPS module

Hi Denis,

the best way to do it is via branch_route 
(http://www.opensips.org/Resources/DocsCoreRoutes16#toc2) . Whatever 
changes you do there will be applied only for that particular branch and 
not for all branches. When you do changes in the request route, the 
changes will be applied to all future branches !

So, do something like this:

- in request route (first time) put the RPID, PAI and FROM (new vals ) 
in 2 different AVPS (according to the first selected GW)
- arm a branch route and failure route
- do t_relay() - this will trigger the branch route and you can do the 
changes to the messages ( as you do it now)
- if you end up in failure route - set new values for the 3 AVPs, 
reflecting the new destination
- do t_relay() - triggers branch route, etc..

Regards,
Bogdan


Denis Putyato wrote:
 Thank you Bogdan for your answer. Now I understood that apply changes is a 
 bad idea.
 But during process a call I have to make some changes to INVITE message. 
 For example,
 I need to add Remote-Party-ID (RPI) and/or P-Asserted-ID (PAI) and make 
 uac_replace_from(). If I make it for the first time everything fine. 
 But if I need then change these fields (via subst or uac_replace_from() 
 again)(for example, some gateways fails and cannot accepts call, I use 
 use_next_gw() of d_routing module and MUST change callerid information) then 
 my tests show that during, for example, second time call of 
 uac_replace_from() there are two uri in From: header field (as you understand 
 that is wrong), or if I make subst() of RPI or PAI then second header RPI and 
 PAI appear in addition of first headers which I added (or subst) before. 


 And to avoid this I make signaling loop. New INVITE process as a new message 
 with modified early headers, so I can change it again.   

 -Original Message-
 From: users-boun...@lists.opensips.org 
 [mailto:users-boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu
 Sent: Monday, December 20, 2010 4:07 PM
 To: OpenSIPS users mailling list
 Subject: Re: [OpenSIPS-Users] TEXTOPS module

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

 Regards,
 Bogdan

 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@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
www.voice-system.ro


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users