<div>Good question.  This configuration is to route certain DID&#39;s over to specific application servers and the rest of the calls process through to the load balancer for general traffic.</div>
<div> </div>
<div>For instance, I want fax DID&#39;s to route over to a specific fax server, so I have to distinguish which DID&#39;s are for fax calls.  I load the fax DID&#39;s into the database and point them over the fax server.</div>

<div> </div>
<div>JR<br><br></div>
<div class="gmail_quote">On Wed, Nov 18, 2009 at 4:21 PM, Alex Balashov <span dir="ltr">&lt;<a href="mailto:abalashov@evaristesys.com">abalashov@evaristesys.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">This is curious logic.  This code causes the call to roll to another branch (via dispatcher) if the user part of the RURI cannot be found in the &#39;dbaliases&#39; table -- are you sure this is what you want?  One would think if the number is not in the aliases table, it cannot be to any server?  Or am I misunderstanding?<br>
<br>JR Richardson wrote:<br><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im">Thanks for your quick replys.<br> Here is the syntax that is working for me:<br> route{<br>       # initial sanity checks -- messages with<br>       # max_forwards==0, or excessively long requests<br>       if (!mf_process_maxfwd_header(&quot;10&quot;)) {<br>
               sl_send_reply(&quot;483&quot;,&quot;Too Many Hops&quot;);<br>               exit;<br>       };<br>       if (msg:len &gt;=  2048 ) {<br>               sl_send_reply(&quot;513&quot;, &quot;Message too big&quot;);<br>
               exit;<br>       };<br><br>       if(alias_db_lookup(&quot;dbaliases&quot;)) {<br>       t_relay();<br>         }else{<br>         ds_select_dst(&quot;1&quot;, &quot;4&quot;);<br>       t_on_failure(&quot;1&quot;);<br>
       t_relay();<br>       }<br>}<br><br>failure_route[1] {<br>       ds_next_dst();<br>       forward();<br>       }<br><br></div>
<div>
<div></div>
<div class="h5">On Wed, Nov 18, 2009 at 3:45 PM, Alex Balashov &lt;<a href="mailto:abalashov@evaristesys.com" target="_blank">abalashov@evaristesys.com</a> &lt;mailto:<a href="mailto:abalashov@evaristesys.com" target="_blank">abalashov@evaristesys.com</a>&gt;&gt; wrote:<br>
<br>   JR,<br><br>   Like many lookup functions, the alias_db_lookup() function has a<br>   return value.  You should check it for a negative result before<br>   proceeding further in the script:<br><br>   Example:<br><br>
     if(!alias_db_lookup(&quot;dbaliases&quot;)) {<br>             sl_send_reply(&quot;404&quot;, &quot;Not Found&quot;);<br>             exit;<br>     }<br><br>   Error handling in general is a must.<br><br>   -- Alex<br>
<br>   JR Richardson wrote:<br><br>       Hi All,<br>        I have a real simple load balancer proxy setup using the<br>       dispatcher module, works great.  I want to do an alias lookup<br>       before I send the calls through to the dispatcher, but I can&#39;t<br>
       seem to find a good example of how that should be setup in the<br>       config script.  I&#39;ve tried different things, the<br>       aliase_db_lookup is working but if a user is not in the<br>       database, the call loops and does not continue on to the<br>
       dispatcher.  Here is my current route script (this does not work):<br>        route{<br>              # initial sanity checks -- messages with<br>              # max_forwards==0, or excessively long requests                             if (!mf_process_maxfwd_header(&quot;10&quot;)) {<br>
                      sl_send_reply(&quot;483&quot;,&quot;Too Many Hops&quot;);<br>                      exit;<br>              };<br>              if (msg:len &gt;=  2048 ) {<br>                      sl_send_reply(&quot;513&quot;, &quot;Message too big&quot;);<br>
                      exit;<br>              };<br><br>              alias_db_lookup(&quot;dbaliases&quot;);<br>              t_on_failure(&quot;1&quot;);<br>              t_relay();<br>                ds_select_dst(&quot;1&quot;, &quot;4&quot;);<br>
              t_on_failure(&quot;1&quot;);<br>              t_relay();<br>       }<br><br>       failure_route[1] {<br>              ds_next_dst();<br>              forward();<br>              }<br>       I think there should be an &#39;if&#39; &#39;then&#39; or &#39;if&#39; &#39;else&#39; separating<br>
       the alias_db_lookup and the ds_select functions, but I&#39;m not<br>       sure of the syntax and where the curly brackets need to be.<br>        Thanks.<br>        JR<br>       --        JR Richardson<br>       Engineering for the Masses<br>
<br><br>       ------------------------------------------------------------------------<br><br>       _______________________________________________<br>       Kamailio (OpenSER) - Users mailing list<br></div></div>       <a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a> &lt;mailto:<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a>&gt; 
<div class="im"><br>       <a href="http://lists.kamailio.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.kamailio.org/cgi-bin/mailman/listinfo/users</a><br>       <a href="http://lists.openser-project.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser-project.org/cgi-bin/mailman/listinfo/users</a><br>
<br><br><br>   --    Alex Balashov - Principal<br>   Evariste Systems<br>   Web     : <a href="http://www.evaristesys.com/" target="_blank">http://www.evaristesys.com/</a><br>   Tel     : (+1) (678) 954-0670<br>   Direct  : (+1) (678) 954-0671<br>
<br><br>-- <br>JR Richardson<br>Engineering for the Masses<br><br><br>------------------------------------------------------------------------<br><br>_______________________________________________<br>Kamailio (OpenSER) - Users mailing list<br>
<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a><br><a href="http://lists.kamailio.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.kamailio.org/cgi-bin/mailman/listinfo/users</a><br>
<a href="http://lists.openser-project.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser-project.org/cgi-bin/mailman/listinfo/users</a><br></div></blockquote>
<div>
<div></div>
<div class="h5"><br><br>-- <br>Alex Balashov - Principal<br>Evariste Systems<br>Web     : <a href="http://www.evaristesys.com/" target="_blank">http://www.evaristesys.com/</a><br>Tel     : (+1) (678) 954-0670<br>Direct  : (+1) (678) 954-0671<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>JR Richardson<br>Engineering for the Masses<br>