<div dir="ltr"><div>Thank you very much, I did it this way, and it worked perfect!!!</div><div><br></div><div>if (is_subscriber("$ru", "subscriber", "2")) {</div><div>Â Â Â ...</div><div>Â Â Â logic</div><div>Â Â Â ...</div><div>}</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-06-13 3:05 GMT-06:00 Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div 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><div><div class="h5">
<br>
<div>On 10/06/16 03:39, pablo rosales wrote:<br>
</div>
</div></div><blockquote type="cite"><div><div class="h5">
<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 style="white-space:pre-wrap"> </span># round
robin dispatching on gateways group '1'</div>
<div><span style="white-space:pre-wrap"> </span>if(!ds_select_dst("1",
"4"))</div>
<div><span style="white-space:pre-wrap"> </span>{</div>
<div><span style="white-space:pre-wrap"> </span>send_reply("404",
"No destination");</div>
<div><span style="white-space:pre-wrap"> </span>exit;</div>
<div><span style="white-space:pre-wrap"> </span>}</div>
<div>###<span style="white-space:pre-wrap"> </span>xlog("L_DBG",
"--- SCRIPT: going to <$ru> via <$du>\n");</div>
<div><span style="white-space:pre-wrap"> </span>xlog(" ---
DISPATCH: going to <$ru> via <$du>n");</div>
<div><span style="white-space:pre-wrap"> </span>t_on_failure("RTF_DISPATCH");</div>
<div><span style="white-space:pre-wrap"> </span>return;</div>
<div>}</div>
<div><br>
</div>
<div>## Sample failure route</div>
<div>failure_route[RTF_DISPATCH] {</div>
<div><span style="white-space:pre-wrap"> </span>xlog(" ---
DISPATCH: Starts RTF_DISPATCH \n");</div>
<div><span style="white-space:pre-wrap"> </span>if
(t_is_canceled()) {</div>
<div><span style="white-space:pre-wrap"> </span></div>
<div><span style="white-space:pre-wrap"> </span>exit;</div>
<div><span style="white-space:pre-wrap"> </span>}</div>
<div><span style="white-space:pre-wrap"> </span># next DST -
only for 500 or local timeout</div>
<div><span style="white-space:pre-wrap"> </span>if
(t_check_status("500")</div>
<div><span style="white-space:pre-wrap"> </span>or
(t_branch_timeout() and !t_branch_replied()))</div>
<div><span style="white-space:pre-wrap"> </span>{</div>
<div><span style="white-space:pre-wrap"> </span></div>
<div><span style="white-space:pre-wrap"> </span>if(ds_next_dst())</div>
<div><span style="white-space:pre-wrap"> </span>{</div>
<div><span style="white-space:pre-wrap"> </span></div>
<div><span style="white-space:pre-wrap"> </span>t_on_failure("RTF_DISPATCH");</div>
<div><span style="white-space:pre-wrap"> </span></div>
<div><span style="white-space:pre-wrap"> </span>route(RELAY);</div>
<div><span style="white-space:pre-wrap"> </span></div>
<div><span style="white-space:pre-wrap"> </span>exit;</div>
<div><span style="white-space:pre-wrap"> </span>}<span style="white-space:pre-wrap"> </span></div>
<div><span style="white-space:pre-wrap"> </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></fieldset>
<br>
</div></div><pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><span class="HOEnZb"><font color="#888888">
</font></span></pre><span class="HOEnZb"><font color="#888888">
</font></span></blockquote><span class="HOEnZb"><font color="#888888">
<br>
<pre cols="72">--
Daniel-Constantin Mierla
<a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a> - <a href="http://www.kamailio.org" target="_blank">http://www.kamailio.org</a>
<a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a></pre>
</font></span></div>
<br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div>