<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">Inaki,<br><br>I am doing updates with avp_db_query, so there is no avp I can check the value of .<br>As
I said in a subsequent post, I wrote a simple server that listened on
port 3306, like mysql does, and pointed OpenSER at it. The avp_db_query
commands() basically blocked forever and openser seemed to completely
lose all ability to process new calls. That's really bad.<br><br>Doug.<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Iñaki Baz Castillo &lt;ibc@aliax.net&gt;<br>To: users@lists.openser.org<br>Sent: Monday, January 14, 2008 1:46:00 PM<br>Subject: Re: [OpenSER-Users] avp_db_query() timeout<br><br>
El Lunes, 14 de Enero de 2008, Douglas Garstang escribió:<br>&gt; I haven't had much luck getting replies to my questions lately,
 hopefully<br>&gt; I'll have more luck with this one.<br>&gt;<br>&gt; avp_db_query().... does it have a timeout? What is it? Can I set it?<br>&gt;<br>&gt; If I use it, and there is a MySQL database problem, I don't want<br>&gt; avp_db_query() to wait forever trying to connect to MySQL. If it
 can't<br>&gt; connect after a few seconds, I'd like it to just give up. I have
 multiple<br>&gt; calls to avp_db_query() in a typical call flow. It would be even
 better if<br>&gt; I could set a flag on the first timeout and not try again during that
 call.<br>&gt;<br>&gt; Can that be done?<br><br>Hi, by the test I've done:<br><br>&nbsp; avp_db_query("SQL_QUERY", "$avp(s:result)");<br>&nbsp; xlog("L_INFO", "retcode = $rc \n");<br><br>Cases:<br><br>- If query doesn't return a row/value then $avp(s:result)=null and
 $rc=(-1).<br><br>- If query returns a row/value the $avp(s_result) stores that value and
 $rc=1.<br><br>- If there is a syntax error in query then $avp(s:result)=null and
 $rc=(-1).<br><br>- If MySQL is not running&nbsp; then $avp(s:result)=null and $rc=(-1).<br><br><br>I don't know what occurs if MySQL is running but because overload or
 any other <br>reason it doesn't reply, but AFAIK the "avp_db_query" uses the same
 code of <br>other OpenSer functions to access DB, so I'm sure it has a correct
 behaviour <br>in case of failure..<br><br>BTW you can "play" with the $rc code after "avp_db_query".<br><br><br><br><br><br>-- <br>Iñaki Baz Castillo<br><br>_______________________________________________<br>Users mailing list<br><a ymailto="mailto:Users@lists.openser.org" href="mailto:Users@lists.openser.org">Users@lists.openser.org</a><br><a href="http://lists.openser.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser.org/cgi-bin/mailman/listinfo/users</a><br></div><br></div></div><br>

      <hr size=1>Never miss a thing.  <a href="http://us.rd.yahoo.com/evt=51438/*http://www.yahoo..com/r/hs"> Make Yahoo your homepage.</a>

</body></html>