[Serusers] sl module functions in failure route

Martin Hoffmann hn at nvnc.de
Wed Jul 11 21:17:02 CEST 2007


Jiri Kuthan wrote:
> At 20:12 11/07/2007, JF wrote:
> >So, the following snippet doesn't make sense in a failure route?
> >I may try to call t_relay inside a failure route, and, if it fails,
> >send a stateless reply back...
> >
> >       if (!t_relay()) {
> >               sl_send_reply("500","Error relaying");
> >               exit;
> >       };
> >
> 
> This piece of config makes sense, but it does not include failure_route
> as you had asked before. From within failure_route, call t_reply to
> complete transactino processing, don't call sl_send_reply.

Wait. Does t_reply() skip branch picking? If not, your t_reply("500",
"Whatever") will most likely not get picked.

What you need to remember in a failure route is that you already have a
reply from older branches. If nothing came from downstream, SER
fakes a 408. This means that you actually don't need to do the
sl_send_reply() anyways. Just break out of the failure route and
whatever reply lead to the call of the failure route will be send back
upstream just fine. Which most likely is what you want anyways, if you
think about it.

Regards,
Martin



More information about the sr-users mailing list