On Thu, May 27, 2010 at 1:24 PM, Uriel Rozenbaum
<uriel.rozenbaum(a)gmail.com> wrote:
JR,
Maybe for subsequent routes you'd like to use $oU (original URI Username)
that is the original number you intend to route.
Rgds,
Uriel
On Thu, May 27, 2010 at 1:23 PM, JR Richardson <jmr.richardson(a)gmail.com>
wrote:
>
> On Thu, May 27, 2010 at 10:09 AM, Henning Westerholt
> <henning.westerholt(a)1und1.de> wrote:
> > On Thursday 27 May 2010, JR Richardson wrote:
> >> > i assume according your description that the GW in question don't
> >> > send a
> >> > provisional response. Then the tm module should generate a internal
> >> > 408
> >> > after fr_timer interval which you could then catch in a
> >> > failure_route. Do
> >> > you armed the appropriate failure_route in your cfg?
> >>
> >> Yes, the gateway is totally off-line so no response comes back. I do
> >> have failure_route in the config. This is related to another active
> >> post from me "Carrierroute failover domain not working" so I'm
sure
> >> this is a redundant post, but your input is appreciated.
> >>
> >> The pastebin has my kamailio.cfg, the kamailio debug trace and the
> >> error received by sipp and the ngrep capture.
> >>
> >>
http://pastebin.com/VQziKYjE
> >
> > Hi JR,
> >
> > from the logs:
> >
> > INFO:carrierroute:cr_do_route: rewrite_uri_recursor doesn't complete,
> > uri 65,
> > carrier 1, domain 2
> >
> > this means that there was an error during the invocation of the cr_route
> > in
> > the failure_route[2]. Can you check if you've a rule with domain 2 in
> > your
> > carrierroute table?
> >
> > And you probably also want to use revert_uri() and append_branch(); in
> > the
> > failure_route before respectivly after the new cr_route, otherwise
> > you'll
> > probably run in to problems as well. I just noticed that there is an
> > error in
> > the first example in the cr docs, i'll fix it now. The second example
> > uses
> > this two commands.
> >
> > Regards,
> >
> > Henning
> >
> Ok, so I think we are on to something, in the first transaction the
> uri was 3465@ which matched the database entry 34 in carrier 1 domain
> 1, but I also had strip_prefix-2 in there as well, so when the call
> goes to the failure route the uri changes to 65@, which did not have a
> match in carrier 1 domain 2.
>
> So to test, I took the prefix matching and the strip_prefix out and
> simplified the database entry to this:
>
> carrierroute table:
> carrier 1, domain 1, host A
> carrier 1, domain 1, host B
> carrier 1, domain 2, host C
> carrier 1, domain 2, host D
>
> carrierfailureroute table:
> carrier 1, domain 1, host A, next domain 2
> carrier 1, domain 1, host B, next domain 2
> carrier 1, domain 2, host C, next domain 1
> carrier 1, domain 2, host D, next domain 1
>
> So now I see a call come in to kamailio and if host A & B are
> off-line, I see in the debug the failure_route try to send the call to
> host C & D, but I still have an error because I don't have a proper
> branch route setup, and this is confusing, I don't understand what
> that means? Here is the error:
>
> The uri is 3477@, call come in and hits the route[2], then goes to
> failure_route.
>
> May 27 11:04:04 [25716] INFO:carrierroute:cr_do_route: uri 3477 was
> rewritten to sip:3477@10.10.14.104, carrier 1, domain 2
> May 27 11:04:04 [25716] ERROR:tm:t_forward_nonack: no branch for
> forwarding
> May 27 11:04:04 [25716] ERROR:tm:w_t_relay: t_forward_nonack failed
> May 27 11:04:04 [25716] ERROR:tm:t_forward_nonack: no branch for
> forwarding
> May 27 11:04:04 [25716] ERROR:tm:w_t_relay: t_forward_nonack failed
>
> Here is the config snip:
>
> route[2] {
> if(!cr_route("1", "1", "$rU", "$rU",
"call_id")){
> sl_send_reply("403", "Not allowed");
> } else {
> t_on_failure("2");
> t_relay();
> }
> }
>
> failure_route[2] {
> revert_uri();
> if (t_check_status("404|408|5[0-9][0-9]")) {
> if(!cr_route("1", "2", "$rU",
"$rU", "call_id")){
> t_reply("403", "Not allowed");
> } else {
> t_relay();
> }
> }
> }
>
> So I guess I'm stuck on the error "ERROR:tm:t_forward_nonack: no
> branch for forwarding". I'm not sure how to setup a branch route from
> the failure route.
I read about append_branch() and added it to my failure route. Well,
that allowed the route to branch and forward the calls to the
failureroute gateways listed in the database. But now I have an issue
with re-transmits in the failure route, it's like the failure route is
sending 2 invited to the next_domain gateways. I really don't
understand what I'm doing with the failure route and append_branch,
here is a snip of my failure_route:
route[2] {
if(!cr_route("1", "1", "$rU", "$rU",
"call_id")){
sl_send_reply("403", "Not allowed");
} else {
t_on_failure("2");
t_relay();
}
}
failure_route[2] {
revert_uri();
if (t_check_status("404|408|5[0-9][0-9]")) {
if(!cr_route("1", "2", "$rU",
"$rU", "call_id")){
t_reply("403", "Not allowed");
} else {
append_branch();
t_relay();
}
}
}
Any guidance please?
Thanks.
JR
--
JR Richardson
Engineering for the Masses