[SR-Users] Multiple parallel branches, one invalid

Nathan Ward kamailio-sr-users at daork.net
Fri Mar 10 03:16:55 CET 2017


Hi,

I have a scenario I’m not sure of the best way to solve.

I use alias_db and have multiple destinations for a single number, and have append_branches set to 1.
I then use lookup_branches to get details from the location table for each branch.
I then do t_load_contacts and t_next_contacts, then t_relay to parallel fork the calls to the destination, and all the phones ring at once.

This all works great if all the destinations from the dbaliases table are online.

However, if one of them is offline, lookup_branches says "Not found in usrloc”. This branch is still there, and the call is attempted. In my environment, this then does a DNS lookup, can’t resolve the domain, and the branch fails. This is the first branch that is tried, and when this branch has an error like this, it causes t_relay() to fail - I check for the output of t_relay() and reply with an error - per the default config that Kamailio ships with.

I guess what I need to figure out, is if there’s a way to have t_relay fail only if all branches fail? Or, is there a more elegant way to handle this?

I should add, I only allow a single registration per subscriber - so, lookup_branches only returns one branch per alias from alias_db_lookup.

--
Nathan Ward




More information about the sr-users mailing list