[OpenSIPS-Users] Notify Message

Dave Singer dave.singer at wideideas.com
Tue Feb 8 20:04:20 CET 2011


Kyle,

use t_replicate("sip:<second server>");
Look at the tm module docs for a more complete picture.
Then modify the message. One branch will go out with the message the
way it was before the t_replicate and one will have the changes after
the t_replicate.
If you need more replicated destinations, use append_branch same as
t_replicate with the final dest using the t_replicate cmd. For this
you might also need to move the message modifications to a branch
route because somethings can only be changed once like
uac_replace_from.

Dave

On Tue, Feb 8, 2011 at 9:45 AM, Kyle Haefner <Kyle.Haefner at colostate.edu> wrote:
> Hi Users!
>
> I have a *simple* scenario that I just can't seem to
> accomplish...famous last words right?  Ok here goes...
>
>
> I receive a NOTIFY message that I want to forward to two destinations,
> one destination I want to forward the message and modify the body, the
> other destination I just want to forward the message.  Here is what I
> have so far it works for the modified message:
>
>
> if (method=="NOTIFY"){
>
> xlog("\n\n************************SIP NOTIFY
> *********************\n\n
>
> if(subst_body('/(Message-Account:.*)(sip:)([125][0-9][0-9][0-9][0-9])(@.*)$/\1\297049\3\4/')){
>                                                sl_send_reply("200", "OK");
>                                                t_relay("tcp:192.168.0.3");
>                                        };
>                                       ");
>                                        exit;
>
>                        }
>
> My initial attempt, doesn't work 192.168.0.3 always gives me a 500 error:
>
> if (method=="NOTIFY"){
>
> xlog("\n\n************************FORWARD ORIGINAL SIP NOTIFY
> *********************\n\n
>                                      sl_send_reply("200", "OK");
>                                      t_relay("tcp:192.168.0.2");
>
>
>
> xlog("\n\n************************FORWARD MODIFIED SIP NOTIFY
> *********************\n\n
>
> if(subst_body('/(Message-Account:.*)(sip:)([125][0-9][0-9][0-9][0-9])(@.*)$/\1\297049\3\4/')){
>                                                sl_send_reply("200", "OK");
>                                                t_relay("tcp:192.168.0.3");
>                                        };
>                                       ");
>                                        exit;
>
>                        }
>
>
>
> It seems that I should use append_branch for this, but then how do I
> modify the body of only one of the branches, and what is the best way
> to call t_relay?
> I'd appreciate it if someone could point me in the right direction!
>
> Regards,
>
> Kyle
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>



More information about the Users mailing list