[SR-Users] Kamailio- Redirect message 300 with LCR reroute
Juha Heinanen
jh at tutpro.com
Fri Nov 22 03:57:54 CET 2013
willf1976 writes:
> So I take it then that the method described in this thread will work for
> making fall back routes for lcr that will run in the order of their
> priority, instead of in reverse order as some folks were saying in the
> thread?
read what lcr readme tells about priority. if it does not work as
described, file a bug report.
> I also am planning on switching to using append_branch instead of
> km_append_branch -- I thought I would mention this in case there was some
> reason that km_append_branch is being used instead. So in the end my script
> would look something much like this:
>
> if (is_method("INVITE"))
>
> {
>
> if (!load_gws(1, $rU, $fu)) {
>
> sl_send_reply("502", "Unable to load gateways");
>
> exit;}
>
>
>
> if(!next_gw()){
>
> sl_send_reply("503", "Unable To find a gateway");
>
> exit;}
>
>
>
> while(next_gw()){
>
> append_branch(); }
>
>
>
> sl_send_reply("302","Moved temporary");
>
>
> exit;
>
> }
you should call append_branch() after next_gw(). also, the above calls
next_gw() twice. at some point you should call t_relay() to send the
message.
-- juha
More information about the sr-users
mailing list