[Serusers] failure_route vs. onreply

Jan Janak jan at iptel.org
Wed Apr 20 16:16:55 CEST 2005


They are quite different. onreply_route is executed for each branch. If your 
proxy server forks an INVITE to 3 destinations in parallel then onreply_route 
will be executed 3 times -- for each branch. onreply_route sections
process replies (all operations within them will modify replies).

After receiving final replies from all the branches, the proxy server
decides which of them it should forward upstream. If the selected
message is a negative final reply (3xx, 4xx, 5xx, 6xx) then it executes
the failure_route section before forwarding it upstream.

But -- the failure_route section does not work with the reply being
forwarded upstream, but with the original request ! (in this case the
original INVITE). That's quite important.

There are two reasons why it is this way:
  1) The most common operation performed in failure_route sections is serial
     forking (you take the original message and forward it somewhere
     else) -- and for that you need the original request. You may also
     want to change the reply being forwarded upstream and for this the
     original request will be needed as well.

  2) (implementation related) -- it is likely that the reply was
     received by process A, but will be forwarded upstream by process B
     (where B is the process which received the reply from the last
     unfinished branch). To make it possible, the message is stored in
     shared memory and most functions that can be called from the script
     cannot handle it.

             +-----+ (2) 301
   301   (1) |     |<--------
   <---------| SER | (2) 486
	     |     |<--------
             +-----+
	     
   (1) -- failure_route gets called here
   (2) -- onreply_route gets called here
   
   Jan.

On 20-04 07:31, Matt Schulte wrote:
> Ok, are these the same thing? I remember reading that onreply was
> renamed to failure due to confusion? Now I'm confused again ;-) 
> 
> 	Matt
> 
> _______________________________________________
> Serusers mailing list
> serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers




More information about the sr-users mailing list