<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>Hi Prasad,<br>
<br>
your problem is the way you do the test over the $avp(i:1)
variable - the avp_db_query() function populates the value as
string, so you should test is as string and not as integer .<br>
<br>
Try:<br>
if ($avp(i:1)=="1")<br>
instead of<br>
if(avp_check("$avp(i:1)", "eq/1/i"))<br>
</tt><tt><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>
<br>
On 06/19/2012 01:16 PM, prasad kelkar wrote:
<blockquote
cite="mid:CAFDmxH3RzHcnajg4VsnjNLMyUSM72k8KdYrHsBbLZFc2REFn3A@mail.gmail.com"
type="cite">hello,<br>
I tried following in route script.<br>
<br>
route{<br>
<br>
if (is_method("INVITET"))<br>
{<br>
avp_db_query("select count from load_count where
dest='1'","$avp(i:1)");<br>
# avp_db_query("select count from load_count where
dest='2'","$avp(i:2)");<br>
<br>
if(avp_check("$avp(i:1)", "eq/1/i"))<br>
{<br>
avp_db_query("update load_count set count='0' where
dest='1';");<br>
<br>
forward("<a moz-do-not-send="true"
href="http://172.29.9.140:5060">172.29.9.140:5060</a>");<br>
#forward();<br>
exit();<br>
}<br>
else<br>
{ avp_db_query("update load_count set count='1' where
dest='1';");<br>
<br>
# forward();<br>
forward("<a moz-do-not-send="true"
href="http://172.29.9.136:5060">172.29.9.136:5060</a>");<br>
exit;<br>
}<br>
}<br>
} <br>
<br>
only else part is working. All calls are forwarded to 136 only.<br>
I think it is not modifying database or its not persistent.<br>
Please tell if that update query is correct and anything else i
have to do to make db persistent?<br>
thank you<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
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>
</body>
</html>