Hi, I have been testing an idea where a gateway failure will not rely on invite timeouts before a call is tried on another gateway.
The idea is that the gateways register with a user i.e. vgw1 this appears in usrloc, before I try to route that call to the gateway I lookup the user in usrloc, if it is not there I start a failure route. In the route statement I have the following:
if (uri=~"^sip:20[0-9]@10.96.1.48") { route(2); break; };
route[2] { #route to E2 PBX log(1,"IM AT ROUTE 2"); lookup("vgw1"); # no registered contact sl_send_reply("404", "Not Found"); #}; forward( 10.96.1.168, 5060 ); # break; # }
t_on_failure("1"); if (!t_relay()) { sl_reply_error(); break; };
}
However the test number I dial is 201, running ser in debug I see that the lookup is for 201 not vgw1.
Is there a way to lookup a name in usrloc as part of the route?
TIA
Regards, Steven Godfrey Network Development Manager Phone 01423 850007 steven.godfrey@intechnology.co.uk ============================================== InTechnology plc - Secure Offsite Data Head Office: Nidderdale House, Beckwith Knowle, Harrogate, HG3 1SA. Main: 01423 850000 Fax: 01423 858855 www.intechnology.co.uk
________________________________________________________________________ This message has been checked for all known viruses by the CitC Virus Scanning Service powered by SkyLabs. For further information visit http://www.citc.it
___
On 15-04 17:54, steve wrote:
Hi, I have been testing an idea where a gateway failure will not rely on invite timeouts before a call is tried on another gateway.
The idea is that the gateways register with a user i.e. vgw1 this appears in usrloc, before I try to route that call to the gateway I lookup the user in usrloc, if it is not there I start a failure route.
In the route statement I have the following:
if (uri=~"^sip:20[0-9]@10.96.1.48") { route(2); break; };
route[2] { #route to E2 PBX log(1,"IM AT ROUTE 2"); lookup("vgw1"); # no registered contact
The parameter of lookup function is the name of the table to search in, not the username to be looked up.
If you want to lookup a specific username then you have to put it into the Request-URI of the message:
setuser("vgw1");
then do the lookup to verify that the gateway is up and running and after that call revert_uri() to recall the called number.
Jan.