modify branch

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

modify branch

Alex R.S.M
Hi,

I am trying to make some changes in the header of the branch.  The first "if condition" made the change. But, the second "if condition" does not.
It seems the uri value is not being changed by append_branch function.

 if (is_method("INVITE"))
{
     ....
      seturi("sip:[hidden email]:5060;transport=UDP");
      if ( uri=~"sip:.+@x.x.x.x*" )
      {
           // make some changes
      }

      append_branch("sip:[hidden email]:5060");
      if ( uri=~"sip:.+@y.y.y.y.*" )
      {
         // make some changes to the branch
      }
      ....

What's the best way to make changes on diff branches?

Thanks,
Alex

Get 5 GB of storage with Windows Live Hotmail. Sign up today.
_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: modify branch

Bogdan-Andrei Iancu
Hi Alex,

After the append_branch(), the current branch (RURI) is moved from
message ruri in an internal branch table. To access back the added
branch, use $br
(http://www.opensips.org/pmwiki.php?n=Resources.DocsCoreVar#toc11).

Regards,
Bogdan

Alex R.S.M wrote:

> Hi,
>
> I am trying to make some changes in the header of the branch.  The
> first "if condition" made the change. But, the second "if condition"
> does not.
> It seems the uri value is not being changed by append_branch function.
>
>  if (is_method("INVITE"))
> {
>      ....
>       seturi("sip:[hidden email]:5060;transport=UDP");
>       if ( uri=~"sip:.+@x.x.x.x*" )
>       {
>            // make some changes
>       }
>
>       append_branch("sip:[hidden email]:5060");
>       if ( uri=~"sip:.+@y.y.y.y.*" )
>       {
>          // make some changes to the branch
>       }
>       ....
>
> What's the best way to make changes on diff branches?
>
> Thanks,
> Alex
> ------------------------------------------------------------------------
> Get 5 GB of storage with Windows Live Hotmail. Sign up today.
> <http://windowslive.com/Explore/Hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_5gb_112008>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>  


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users