[OpenSER-Users] Is possible to use two "branch_route[ ]" for	same	branch?
    Andreas Granig 
    agranig at sipwise.com
       
    Wed Oct 17 14:24:46 CEST 2007
    
    
  
You want to avoid to copy&paste redundant code in your branch-route, 
right? So the following snipped should do the same as if you were able 
to execute branch_route[1] after branch_route[3]:
route
{
   if(/* initial invite */)
     t_on_branch("3");
   else
     t_on_branch("1");
   // ...
}
// your branch-route helper
route[20]
{
   // some code executed by both branch routes
}
// broute for common requests
branch_route[1]
{
   route(20);
}
// broute for initial invites
branch_route[3]
{
   // some branch-specific stuff here, then:
   route(20);
}
Iñaki Baz Castillo wrote:
> El Wednesday 17 October 2007 13:28:55 Andreas Granig escribió:
>> Hi,
>>
>> You may also create a route[] for the common code and call that route
>> from your branch routes.
> 
> I thougt that but have a doubt: if I call a "route(1)" from "branch_route[3]", 
> what is processed in "route[1]"? all the branch together of each one?
> 
> So, if I do:
> 
> 
> route {
>    ...
>    t_on_branch("1");
>    t_relay;
> }
> 
> branch_route[1] {
>   if (is_method("INVITE") )
>      route(3);
>   ...
>   ...   
> }
> 
> route[3] {
>    ...
>    operate_in_separate_branch here ¿?¿?¿?
>    o in all branches together ?¿?¿?¿
> }
> 
> 
> What is processed in route[3] ?
> 
> 
> 
> Thanks.
> 
> 
> 
    
    
More information about the Users
mailing list