On Friday 17 April 2009, Carlos A. Alvarez wrote:
perhaps you forgot to enable record-routing, so
kamailio is removed from
the path?
No I do use record-route, like I said, it only failes after a re-write.
Only happens
when I strip a number or rewrite the prefix. All other cr
calls are processed fine. Now if I add the prefix to the table this works
fine... For example, I dial prefix 54011 to select carrier A, carrier A
wants to see only CC NXXX XXXX from me, so I strip 5 digits to send the
number, than I see this condition. If I add the CC prefix to the table,
then CR module does a second look up and correctly routes the call.
Ok, but normally it should work just fine with only one lookup.
Dial 54011 53 2339 2339 sent to carrier A 53 2339
2339... you can
imagine how my tables are going to look if I have to add to routes per
carrier... at least for those carriers that are not assigning me a
prefix. Routing login is below.
route [11]{
xlog("L_INFO", "INFO: entering carrierroute routine\n");
cr_user_carrier("$fd", "$fd", "$avp(s:carrier)");
$avp(s:domain)=$fd;
setflag(16);
Ok.
if
(!cr_route("$avp(s:carrier)", "$avp(s:domain)", "$rU",
"$rU",
"call_id", "$avp(s:host)")) {
sl_send_reply("480", "Temporarily
Unavailable");
setflag(2);
exit;
}
if (cr_route("$avp(s:carrier)", "$avp(s:domain)",
"$rU", "$rU",
"call_id", "$avp(s:host)")) {
xlog("L_INFO","Carrier found!!
(\"$avp(s:carrier)\",
\"$avp(s:domain)\", \"$rU\", \"$rU\",
\"$avp(s:host)\");\n");
force_rtp_proxy("o");
Why do you use the routing function two times? I can't imagine a good
reason for this. If you want to log the success, just do this after the
first cr_route. And also move all your logic in the second if case after
the first one. If the lookup in the first cr_route fails then your routing
tables are not correct.
I am only following the few examples that I can find. The message is
missing something, the second route is the failure route. But in your
reply it seems to be truncated. I wish there was a few implementation
examples that we could follow, I really like the carrierroute vs lcr.
Hm, then the example you've found is wrong. I guess you already read the
README and found the examples. There are some other examples in the test/
directory in the source tree. Take a look to test/26.cfg, which shows a
normal routing with failure_route. The 26.sh shows the DB setup for this
case.
Back to your config: you've two cr_route calls in them, in route[11]. Another
one is in the failure_route[11]. You need to remove one of the cr_route calls
in route[11], double rewrite is not valid.
Cheers,
Henning