<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hello,</p>
    <p>you have to show the request_route block with the part where the
      route(DISPATCH) is executed. You can use is_subscriber() to see if
      the target number is a local subscriber and route via location.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 10/06/16 03:39, pablo rosales wrote:<br>
    </div>
    <blockquote
cite="mid:CAPgewid22iaQUoUkmLzAZ=orHOS3QvtTpSHoYEacTCZSGGrZ3Q@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>Hi everyone! I am a newbie with Kamailio.</div>
        <div><br>
        </div>
        <div>I'm trying to connect a kamailio server to an asterisk
          gateway. We are using basic Kamailio 4.4.x configuration file
          with mysql and rtpproxy</div>
        <div><br>
        </div>
        <div>we are having same issues with dispatcher module. we can
          not call between local subscribers.</div>
        <div><br>
        </div>
        <div>Basically, If I call to a local subscriber, the module
          always execute the route(DISPATCHER) code on the routing
          block, trying to send the call to my  gateway, but if I try to
          call to an external number, it works perfect. All calls are
          being send to my gateway.</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Here is my dispatcher code:</div>
        <div># Dispatch requests</div>
        <div>route[DISPATCH] {</div>
        <div><span class="" style="white-space:pre">    </span># round
          robin dispatching on gateways group '1'</div>
        <div><span class="" style="white-space:pre">    </span>if(!ds_select_dst("1",
          "4"))</div>
        <div><span class="" style="white-space:pre">    </span>{</div>
        <div><span class="" style="white-space:pre">            </span>send_reply("404",
          "No destination");</div>
        <div><span class="" style="white-space:pre">            </span>exit;</div>
        <div><span class="" style="white-space:pre">    </span>}</div>
        <div>###<span class="" style="white-space:pre"> </span>xlog("L_DBG",
          "--- SCRIPT: going to <$ru> via <$du>\n");</div>
        <div><span class="" style="white-space:pre">    </span>xlog(" ---
          DISPATCH: going to <$ru> via <$du>n");</div>
        <div><span class="" style="white-space:pre">    </span>t_on_failure("RTF_DISPATCH");</div>
        <div><span class="" style="white-space:pre">    </span>return;</div>
        <div>}</div>
        <div><br>
        </div>
        <div>## Sample failure route</div>
        <div>failure_route[RTF_DISPATCH] {</div>
        <div><span class="" style="white-space:pre">    </span>xlog(" ---
          DISPATCH: Starts RTF_DISPATCH \n");</div>
        <div><span class="" style="white-space:pre">    </span>if
          (t_is_canceled()) {</div>
        <div><span class="" style="white-space:pre">            </span></div>
        <div><span class="" style="white-space:pre">            </span>exit;</div>
        <div><span class="" style="white-space:pre">    </span>}</div>
        <div><span class="" style="white-space:pre">    </span># next DST -
          only for 500 or local timeout</div>
        <div><span class="" style="white-space:pre">    </span>if
          (t_check_status("500")</div>
        <div><span class="" style="white-space:pre">                    </span>or
          (t_branch_timeout() and !t_branch_replied()))</div>
        <div><span class="" style="white-space:pre">    </span>{</div>
        <div><span class="" style="white-space:pre">            </span></div>
        <div><span class="" style="white-space:pre">            </span>if(ds_next_dst())</div>
        <div><span class="" style="white-space:pre">            </span>{</div>
        <div><span class="" style="white-space:pre">                    </span></div>
        <div><span class="" style="white-space:pre">                    </span>t_on_failure("RTF_DISPATCH");</div>
        <div><span class="" style="white-space:pre">                    </span></div>
        <div><span class="" style="white-space:pre">                    </span>route(RELAY);</div>
        <div><span class="" style="white-space:pre">                    </span></div>
        <div><span class="" style="white-space:pre">                    </span>exit;</div>
        <div><span class="" style="white-space:pre">            </span>}<span class="" style="white-space:pre"> </span></div>
        <div><span class="" style="white-space:pre">    </span>}</div>
        <div>}</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Can anybody help to see what I am doing wrong??</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a> - <a class="moz-txt-link-freetext" href="http://www.kamailio.org">http://www.kamailio.org</a>
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a></pre>
  </body>
</html>