<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix"><tt>Hi Mike,<br>
<br>
Simply place before the "if" an xlog to print the $var(FROMIP)
to see if you get there and if the variable contains the IP you
expected.<br>
<br>
Regards,<br>
</tt>
<pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
On 05.06.2014 12:55, Mike Claudi Pedersen wrote:<br>
</div>
<blockquote
cite="mid:CADats6EcM46Tz3WQOF1RwPCr7r2shZc0rHKONmKZNONYzQ703g@mail.gmail.com"
type="cite">
<div dir="ltr"><br clear="all">
<div>Hi guys</div>
<div><br>
</div>
<div>im currently testing my setup, ive made a rule:</div>
<div><br>
</div>
<div>
<div>if ($var(FROMIP) == "xxx.xxx.xxx.201" || $var(FROMIP) ==
"xxx.xxx.xxx.86" || $var(FROMIP) == "xxx.xxx.xxx.13")</div>
<div> {</div>
<div> xlog("L_INFO","\n IP OK \n");</div>
<div> if (!lookup("location","m")) {</div>
<div> switch ($retcode)</div>
<div> {</div>
<div> case -1:</div>
<div> route(2);</div>
<div> case -3:</div>
<div> t_newtran();</div>
<div> t_reply("404",
"Not Found");</div>
<div> exit;</div>
<div> case -2:</div>
<div>
sl_send_reply("405", "Method Not Allowed");</div>
<div> exit;</div>
<div> }</div>
<div> }</div>
<div><br>
</div>
<div><br>
</div>
<div> # when routing via usrloc, log the missed calls
also</div>
<div> setflag(2);</div>
<div><br>
</div>
<div> route(1);</div>
<div> }</div>
</div>
<div><br>
</div>
<div>but for some reason this rule only works when using
xxx.xxx.xxx.86 or xxx.xxx.xxx.13, whenenver a call originates
from xxx.xxx.xxx.201 it never gets into the location lookup it
just goes directly to route(1) loops around a couple of times
and then changes src ip. </div>
<div><br>
</div>
<div>i suspect that it goes into the loose_route part of the
default config. but im not sure why or how ?</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>