[SR-Users] how to route to new URI on failure

x-kamailio at sidell.org x-kamailio at sidell.org
Sun Feb 27 03:57:09 CET 2011


I'm trying to route failed calls to a voicemail URI. The failure route
couldn't be simpler:

failure_route[FAIL_ONE] {

   if (t_is_canceled()) {
      exit;
   }

   if( t_check_status("486|408") {
      append_branch( "sip:foo at 2.2.2.2");
      t_relay();
   }
}


But, it doesn't work. For example, let's say the initial INVITE
resolves to a local device "me at 1.1.1.1". This works fine, and the
phone rings. After a timeout, the failure_route executes. The branch
"foo at 2.2.2.2" gets appended, and kamailio sends a new INVITE, but
instead of determining the correct proxy for the new address, it sends
the INVITE, with the new URI, to the device that original received the
INVITE, "me at 1.1.1.1". Obviously, this doesn't work.

I've been able to force kamailio to route the call correctly by
modifying failure_route[ to use t_relay_to_udp() as follows:

failure_route[FAIL_ONE] {

   if (t_is_canceled()) {
      exit;
   }

   if( t_check_status("486|408") {
      append_branch( "sip:foo at 2.2.2.2");
      t_relay_to_udp( "2.2.2.2", "5060");
   }
}

But, it seems like kamailio should figure what where to send the new
INVITE itself. What am I doing wrong?

-- 
Mark Sidell
Partner
Forte, Inc.
919-942-7068
fax 919-969-2844
www.forteinc.com



More information about the sr-users mailing list