I`m trying next routing logic:<br>
for alias 1009 i have two subscribers 1000 and 1001<br>
<br>
When I try dialing from 1002 to 1009 ring only one phone(first element from table dbalias). <br>
Config blocks:<br>
<br>
..............<br>
modparam("alias_db", "append_branches", 1)<br>
..............<br>
alias_db_lookup("dbaliases");<br>
...............<br>
if($avp(s:dest)=="usrloc"){<br>
route(3);<br>
}<br>
...........<br>
<br>
<br>
<br>
route[1] {<br>
<br>
# for INVITEs enable some additional helper routes<br>
if (subst_uri('/(sip:.*);nat=yes/\1/')){<br>
setbflag(6);<br>
};<br>
if(isflagset(5)||isbflagset(6)){<br>
route(6);<br>
};<br>
if(isflagset(5)){<br>
search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');<br>
};<br>
<br>
if (is_method("INVITE")) {<br>
t_on_branch("2");<br>
t_on_failure("4");<br>
t_on_reply("2");<br>
t_on_failure("1");<br>
<br>
<br>
}<br>
<br>
<br>
if (!t_relay()) {<br>
sl_reply_error();<br>
};<br>
exit;<br>
}<br>
<br>
failure_route[4]{<br>
serialize_branches(1);<br>
if(next_branches()){<br>
#lookup("location", "m");<br>
t_on_reply("2");<br>
t_on_failure("1");<br>
xlog("DIALING!");<br>
t_relay();<br>
}<br>
}<br>
<br>
<br>
route[3]{<br>
if($(rU{s.len}) == 3)<br>
{<br>
# Group is searched on database, by using<br>
# From username.<br>
xlog("!!!!!!!!!!!!!");<br>
cd_lookup("closeddial", "GroupA");<br>
};<br>
<br>
xlog("BRANCH=$branch");<br>
if(!lookup("location", "m")){<br>
switch($retcode){<br>
case -1:<br>
case -3:<br>
t_newtran();<br>
t_reply("404", "Contact Not Found");<br>
exit;<br>
case -2:<br>
sl_send_reply("405", "Method Not Allowed");<br>
exit;<br>
}<br>
}<br>
<br>
setflag(2);<br>
xlog("!!!!!!!!!!!!!!!!ROUTE 3 LOGIC!!!!!!!!!!!!");<br>
route(1);<br>
xlog("AFTER ROUTE 3 LOGIC");<br>
}<br>
<br>
<br>
route[4]{<br>
rewritehostport("89.107.120.237");<br>
route(1);<br>
}<br>
<br>
<br>
branch_route[2] {<br>
xlog("new branch at $ru\n");<br>
}<br>
<br>
<br>
onreply_route[2] {<br>
xlog("incoming reply\n");<br>
<br>
if ((isflagset(5) || isbflagset(6)) && status=~"(183)|(2[0-9][0-9])"){<br>
force_rtp_proxy();<br>
append_hf("P-hint: onreply_route|force_rtp_proxy \r\n");<br>
}<br>
if(isbflagset(6)){<br>
search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');<br>
append_hf("P-hint: Onreply-route - fixcontact \r\n");<br>
fix_nated_contact();<br>
}<br>
exit;<br>
}<br>
<br>
<br>
I can`t find errors. Please, help.<br>