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(&quot;alias_db&quot;, &quot;append_branches&quot;, 1)<br>
..............<br>
alias_db_lookup(&quot;dbaliases&quot;);<br>
...............<br>
        if($avp(s:dest)==&quot;usrloc&quot;){<br>
            route(3);<br>
        }<br>
...........<br>
<br>
<br>
<br>
route[1] {<br>
<br>
        # for INVITEs enable some additional helper routes<br>
        if (subst_uri(&#39;/(sip:.*);nat=yes/\1/&#39;)){<br>
            setbflag(6);<br>
        };<br>
        if(isflagset(5)||isbflagset(6)){<br>
            route(6);<br>
        };<br>
        if(isflagset(5)){<br>
            search_append(&#39;Contact:.*sip:[^&gt;[:cntrl:]]*&#39;, &#39;;nat=yes&#39;);<br>
        };<br>
<br>
        if (is_method(&quot;INVITE&quot;)) {<br>
                t_on_branch(&quot;2&quot;);<br>
                t_on_failure(&quot;4&quot;);<br>
                t_on_reply(&quot;2&quot;);<br>
                t_on_failure(&quot;1&quot;);<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(&quot;location&quot;, &quot;m&quot;);<br>
        t_on_reply(&quot;2&quot;);<br>
        t_on_failure(&quot;1&quot;);<br>
        xlog(&quot;DIALING!&quot;);<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(&quot;!!!!!!!!!!!!!&quot;);<br>
        cd_lookup(&quot;closeddial&quot;, &quot;GroupA&quot;);<br>
    };<br>
<br>
    xlog(&quot;BRANCH=$branch&quot;);<br>
    if(!lookup(&quot;location&quot;, &quot;m&quot;)){<br>
        switch($retcode){<br>
            case -1:<br>
            case -3:<br>
                t_newtran();<br>
                t_reply(&quot;404&quot;, &quot;Contact Not Found&quot;);<br>
                exit;<br>
            case -2:<br>
                sl_send_reply(&quot;405&quot;, &quot;Method Not Allowed&quot;);<br>
                exit;<br>
        }<br>
    }<br>
<br>
    setflag(2);<br>
    xlog(&quot;!!!!!!!!!!!!!!!!ROUTE 3 LOGIC!!!!!!!!!!!!&quot;);<br>
    route(1);<br>
    xlog(&quot;AFTER ROUTE 3 LOGIC&quot;);<br>
}<br>
<br>
<br>
route[4]{<br>
    rewritehostport(&quot;89.107.120.237&quot;);<br>
    route(1);<br>
}<br>
<br>
<br>
branch_route[2] {<br>
        xlog(&quot;new branch at $ru\n&quot;);<br>
}<br>
<br>
<br>
onreply_route[2] {<br>
        xlog(&quot;incoming reply\n&quot;);<br>
<br>
        if ((isflagset(5) || isbflagset(6)) &amp;&amp; status=~&quot;(183)|(2[0-9][0-9])&quot;){<br>
            force_rtp_proxy();<br>
            append_hf(&quot;P-hint: onreply_route|force_rtp_proxy \r\n&quot;);<br>
        }<br>
        if(isbflagset(6)){<br>
            search_append(&#39;Contact:.*sip:[^&gt;[:cntrl:]]*&#39;, &#39;;nat=yes&#39;);<br>
            append_hf(&quot;P-hint: Onreply-route - fixcontact \r\n&quot;);<br>
            fix_nated_contact();<br>
            }<br>
            exit;<br>
}<br>
<br>
<br>
I can`t find errors. Please, help.<br>