[OpenSIPS-Users] Notify Message
    Kyle Haefner 
    Kyle.Haefner at colostate.edu
       
    Tue Feb  8 18:45:37 CET 2011
    
    
  
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
    
    
More information about the Users
mailing list