ohh. yes ofcourse. didnt think of that.<br><br>How about adding driver mapping into the odbcfile.<br><br>for example:<br><br>&lt;section name=&quot;odbc&quot;&gt;<br>&nbsp; &lt;connection_check driver=&quot;default&quot;&gt;SELECT 1&lt;/connection_check&gt;<br>
&nbsp; &lt;connection_check driver=&quot;fb64&quot;&gt;SELECT FIRST 1 * FROM RDB$RELATIONS&lt;/connection_check&gt;<br>&nbsp; &lt;connection_check driver=&quot;firebird&quot;&gt;SELECT FIRST 1 * FROM RDB$RELATIONS&lt;/connection_check&gt;<br>

&lt;/section&gt;<br><br><div class="gmail_quote">On Wed, Feb 20, 2008 at 4:54 PM, Michael Jerris &lt;<a href="mailto:mike@jerris.com">mike@jerris.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="">This check would have to be specific to each odbc connection, not global to the switch, as you could be using different types of databases for different connections. &nbsp;I still lean towards a better way of auto-detecting (probably in addition to a configurable option) if it is at all possible.<div>
<br></div><div><div><br></div><div>Mike</div><div><div></div><div class="Wj3C7c"><div><br><div><div>On Feb 20, 2008, at 9:57 AM, Jonas Gauffin wrote:</div><br><blockquote type="cite">Ok. I&#39;ve done a patch and will upload it if the following config is ok by Anthony.<br>
<br>(Either create odbc.conf.xml in autoload_configs or add it directly to freeswitch.xml)<br><br>&nbsp; &lt;section name=&quot;odbc&quot; description=&quot;odbc general options&quot;&gt;<br> &nbsp;&nbsp;&nbsp; &lt;connection_check&gt;SELECT 1&lt;/connection_check&gt;<br>
&nbsp; &lt;/section&gt;<br><br>My patch will load that string when a new connection is created.<br><br><div class="gmail_quote">On Wed, Feb 20, 2008 at 3:40 PM,  &lt;<a href="mailto:freeswitch@dalethatcher.com" target="_blank">freeswitch@dalethatcher.com</a>&gt; wrote:<br>
 <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Could I suggest the &#39;db check&#39; query be configurable? &nbsp;Oracle is another<br> database which doesn&#39;t work with the &#39;select 1&#39; and needs &#39;select 1 from<br>
 dual&#39;. &nbsp;Then you can have the default as &#39;select 1&#39; and let the end user<br> fiddle with the config for their own particular broken DB.<br> <br> Adding in special code to handle every database out there is going to be<br>
 a big headache for you. &nbsp;If it isn&#39;t already.<br> <br> thanks,<br> <br> - Dale<br> <div><div></div><div><br> On Wed, Feb 20, 2008 at 06:08:08AM -0800, Anthony Minessale wrote:<br> &gt; Many databases break silently or the connection drops<br>
 &gt; without any way to know for sure w/o trying to use it.<br> &gt;<br> &gt; I choose to ensure in the core that the data is connected.<br> &gt; executing &quot;select 1&quot; is a small price to pay to make sure<br> &gt; that the database is connected considering the importance<br>
 &gt; of persistent connectivity in the sip, jingle and call<br> &gt; limit databases as well as the javascript that rely on it.<br> &gt;<br> &gt; All of those applications to make the safe<br> &gt; assumption that the core will keep the db connected and<br>
 &gt; to change that would be drastic behavior change and<br> &gt; destabilize the code on the eve of our release.<br> &gt;<br> &gt; Therefore i guess we should focus on better heuristics<br> &gt; to detect firebird, preferably based on the driver name<br>
 &gt; and not by doing a 2nd sql stmt every time.<br> &gt;<br> &gt;<br> &gt;<br> &gt; Anthony Minessale II<br> &gt;<br> &gt; FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>
 &gt; ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br> &gt;<br> &gt; AIM: anthm<br> &gt; <a href="mailto:MSN:anthony_minessale@hotmail.com" target="_blank">MSN:anthony_minessale@hotmail.com</a><br>
 &gt; GTALK/JABBER/PAYPAL:<a href="mailto:anthony.minessale@gmail.com" target="_blank">anthony.minessale@gmail.com</a><br> &gt; IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br> &gt;<br>
 &gt; FreeSWITCH Developer Conference<br> &gt; <a href="mailto:sip:888@conference.freeswitch.org" target="_blank">sip:888@conference.freeswitch.org</a><br> &gt; <a href="http://iax:guest@conference.freeswitch.org/888" target="_blank">iax:guest@conference.freeswitch.org/888</a><br>
 &gt; <a href="mailto:googletalk:conf+888@conference.freeswitch.org" target="_blank">googletalk:conf+888@conference.freeswitch.org</a><br> &gt; pstn:213-799-1400<br> &gt;<br> &gt;<br> &gt; ----- Original Message ----<br> &gt; From: David Revill &lt;<a href="mailto:davidrevill@datarun.co.uk" target="_blank">davidrevill@datarun.co.uk</a>&gt;<br>
 &gt; To: <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br> &gt; Sent: Tuesday, February 19, 2008 4:37:28 PM<br> &gt; Subject: Re: [Freeswitch-users] Spidermonkey ODBC<br>
 &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> </div></div>&gt; DIV {<br> &gt; MARGIN:0px;}<br> <div><div></div><div>&gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; Unfortunately, there isn&#39;t a universal ansi sql<br> &gt; stmt that will do it as the only statements which can be guaranteed to follow<br>
 &gt; the ansi standard are the simple select, update and delete statements which rely<br> &gt; on knowing some table name .<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; I think we are trying to solve a problem which need<br>
 &gt; not exist. The Javascript application should handle the idle timeout. It<br> &gt; should close the connection if it will not be using it for a while,<br> &gt; and,if it needs to, can do what db_is_up is attempting to do in the<br>
 &gt; application code. Testing for connection before every query seems an<br> &gt; unneccessary overhead.<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; ----- Original Message -----<br> &gt;<br> &gt; &nbsp; From:<br> &gt; &nbsp; Anthony<br>
 &gt; &nbsp; Minessale<br> &gt;<br> &gt; &nbsp; To: <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br> &gt;<br> &gt;<br> &gt; &nbsp; Sent: Tuesday, February 19, 2008 6:38<br>
 &gt; &nbsp; PM<br> &gt;<br> &gt; &nbsp; Subject: Re: [Freeswitch-users]<br> &gt; &nbsp; Spidermonkey ODBC<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; is<br> &gt; &nbsp; there some universal ansi sql stmt that is small and harmless<br> &gt; but is<br>
 &gt; &nbsp; supported by everything? to replace &quot;select 1&quot;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; Anthony Minessale II<br> &gt;<br> &gt; FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>
 &gt; ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br> &gt;<br> &gt; AIM:<br> &gt; &nbsp; anthm<br> &gt; <a href="mailto:MSN:anthony_minessale@hotmail.com" target="_blank">MSN:anthony_minessale@hotmail.com</a><br>
 &gt; GTALK/JABBER/PAYPAL:<a href="mailto:anthony.minessale@gmail.com" target="_blank">anthony.minessale@gmail.com</a><br> &gt; IRC:<br> &gt; &nbsp; <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br>
 &gt;<br> &gt;<br> &gt; FreeSWITCH Developer<br> &gt; &nbsp; Conference<br> &gt; <a href="mailto:sip:888@conference.freeswitch.org" target="_blank">sip:888@conference.freeswitch.org</a><br> &gt; <a href="http://iax:guest@conference.freeswitch.org/888" target="_blank">iax:guest@conference.freeswitch.org/888</a><br>
 &gt; <a href="mailto:googletalk:conf+888@conference.freeswitch.org" target="_blank">googletalk:conf+888@conference.freeswitch.org</a><br> &gt; pstn:213-799-1400<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; -----<br> &gt; &nbsp; Original Message ----<br>
 &gt; From: David Revill<br> &gt; &nbsp; &lt;<a href="mailto:davidrevill@datarun.co.uk" target="_blank">davidrevill@datarun.co.uk</a>&gt;<br> &gt; To:<br> &gt; &nbsp; <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br>
 &gt; Sent: Tuesday, February 19, 2008<br> &gt; &nbsp; 6:56:31 AM<br> &gt; Subject: Re: [Freeswitch-users] Spidermonkey ODBC<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; One way to detect firebird would be to put the<br> &gt; &nbsp; &#39;Select first 1 &nbsp;* from RDB$relations&#39; into switch_odbc_handle_connect.<br>
 &gt; &nbsp; If it succeeds then it is Firebird. A better query might be &#39;select * from<br> &gt; &nbsp; rdb$database&#39; as the system table rdb$database only ever has 1<br> &gt; &nbsp; record.<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; -----<br>
 &gt; &nbsp; &nbsp; Original Message -----<br> &gt;<br> &gt; &nbsp; &nbsp; From:<br> &gt; &nbsp; &nbsp; Jonas<br> &gt; &nbsp; &nbsp; Gauffin<br> &gt;<br> &gt; &nbsp; &nbsp; To:<br> &gt; &nbsp; &nbsp; <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br>
 &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; Sent:<br> &gt; &nbsp; &nbsp; Tuesday, February 19, 2008 12:18 PM<br> &gt;<br> &gt; &nbsp; &nbsp; Subject:<br> &gt; &nbsp; &nbsp; Re: [Freeswitch-users] Spidermonkey ODBC<br> &gt;<br> &gt;<br> &gt;<br> &gt; I&#39;&#39;ve only tested it with firebird on windows. As you said,<br>
 &gt; &nbsp; &nbsp; your driver name doesnt match any of the names I used to detect if it&#39;s<br> &gt; &nbsp; &nbsp; firebird.<br> &gt;<br> &gt; The problem is that most databases supports &quot;SELECT 1&quot; as a<br> &gt; &nbsp; &nbsp; query. It will always be successful if the the connection is up. However,<br>
 &gt; &nbsp; &nbsp; firebird did not support &quot;SELECT 1&quot; and therefore i did query the system<br> &gt; &nbsp; &nbsp; database instead.<br> &gt;<br> &gt; If the firebird check fails, it will try to invoke<br> &gt; &nbsp; &nbsp; &quot;SELECT 1&quot;, and on firebird that query will fail. And the failure is<br>
 &gt; &nbsp; &nbsp; interpreted as the connection is down, and therefore it tries to<br> &gt; &nbsp; &nbsp; reconnect.<br> &gt;<br> &gt; That&#39;s probably why you get that error. If you have any<br> &gt; &nbsp; &nbsp; other idea on how I can detect if it&#39;s a firebird db, please let me know and<br>
 &gt; &nbsp; &nbsp; i&#39;ll fix the odbc code.<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; On Feb 19, 2008 1:05 PM, David Revill &lt;<a href="mailto:davidrevill@datarun.co.uk" target="_blank">davidrevill@datarun.co.uk</a>&gt;<br> &gt; &nbsp; &nbsp; wrote:<br>
 &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; That&#39;s a fair point, but db_is_up is only<br> &gt; &nbsp; &nbsp; &nbsp; called in 2 places and the attempted re-connect could be done if the<br> &gt; &nbsp; &nbsp; &nbsp; exec&#39;d query fails. That way it would not be dependant on the name of the<br>
 &gt; &nbsp; &nbsp; &nbsp; driver.<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; In my application, the database was queried<br> &gt; &nbsp; &nbsp; &nbsp; at the beginning of the script and the connection closed. It was<br> &gt; &nbsp; &nbsp; &nbsp; explicitly re-connected at the end to post data, so the connection timeout<br>
 &gt; &nbsp; &nbsp; &nbsp; was not an issue.<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; -----<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; Original Message -----<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; From:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; Jonas Gauffin<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; To:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br>
 &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; Sent:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; Tuesday, February 19, 2008 10:35 AM<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; Subject:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; Re: [Freeswitch-users] Spidermonkey ODBC<br>
 &gt;<br> &gt;<br> &gt;<br> &gt; I did that code a couple of months ago.<br> &gt; The function<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; was added since connections are closed if they are idle too long, and<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; they were not reconnected again if that happened.<br>
 &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; On Feb 19, 2008 11:22 AM, David Revill &lt;<a href="mailto:davidrevill@datarun.co.uk" target="_blank">davidrevill@datarun.co.uk</a>&gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; wrote:<br> &gt;<br> &gt;<br>
 &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; The problem is in switch_odbc.c function<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db_is_up. It assumes that the variable is_firebird is true, but the<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setting of this variable assumes that the Firebird driver name has<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#39;FIREBIRD&#39;, &#39;FB64&#39; or &#39;FB32&#39; in it.<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I commented out &nbsp;the code in<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db_is_up and just returned a true value, as on closer inspection<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; could not see the point of this function.<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; David Revill<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -----<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Original Message -----<br> &gt;<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; From:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; David Revill<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; To:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br>
 &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sent:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Tuesday, February 19, 2008 8:58 AM<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Subject:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Re: [Freeswitch-users] Spidermonkey ODBC<br>
 &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I spotted this error a few months ago,<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; and to my shame did not let everyone know. &nbsp;I have since<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; archived the project so cannot point you to the actual code.<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; However, the problem is &nbsp;that it assumes the name of the<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Firebird Driver (FB64?) &nbsp;to set a boolean, so that it handle<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; the connection test differently.<br> &gt;<br>
 &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; When looking at the actual code, I<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; actually felt that the connection test was redundant, as all it did<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; was a select from a system table. This meant it was doing two<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; queries for everyone required. (One to see if it could do a query,<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; and then one to do it). I therefore commented the connection test<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; function out.<br> &gt;<br> &gt;<br>
 &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; regards<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; David Revill<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -----<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Original Message -----<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; From:<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Steven Brown<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; To:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br> &gt;<br> &gt;<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sent:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Monday, February 18, 2008 11:34 PM<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Subject:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [Freeswitch-users] Spidermonkey ODBC<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Hi,<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I&#39;m experimenting with<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; spidermonkey for JavaScript call control, the basics seem<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fine and I&#39;m now trying to connect to an existing Firebird<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; database, the Firebird odbc lib is installed ok as is unixODBC and<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I can confirm this and access the db no problem with isql,<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; something strange happens though when I connect in spidermonkey,<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; basically the odbc connection is made successfully, but then as<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; soon as I call either exec or query the odbc connection starts to<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; drop and re-connect continuously,<br>
 &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; the isql output is below<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; isql -v<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; test<br> &gt; +---------------------------------------+<br>
 &gt; |<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Connected!<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br> &gt; |<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br> &gt; |<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sql-statement<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br> &gt; | help<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [tablename]<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br> &gt; |<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; quit<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br> &gt; |<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br> &gt; +---------------------------------------+<br> &gt; SQL&gt; select<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; first 1 * from<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pool_phones<br> &gt; +---------------------+------------+<br> &gt; |<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GSMNO<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | ORGNO<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br> &gt; +---------------------+------------+<br>
 &gt; |<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0712345678 &nbsp; &nbsp; &nbsp; &nbsp; |<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br> &gt; +---------------------+------------+<br> &gt; SQLRowCount returns<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1<br> &gt; 1 rows fetched<br>
 &gt; SQL&gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; however the following test code<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; calling the same query<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; use(&quot;ODBC&quot;);<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var db = new<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ODBC(&quot;test&quot;,&quot;SYSDBA&quot;,&quot;masterkey&quot;);<br> &gt; db.connect();<br> &gt; db.query(&quot;select<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; first 1 * &nbsp;from pool_phones&quot;);<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db.nextRow();<br>
 &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; row =<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db.getData();<br> &gt; console_log(&quot;INFO&quot;,&quot;HELLO &quot; + &nbsp;row[&quot;GSMNO&quot;]<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+ &quot;\n&quot;);<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit();<br>
 &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; gives the following output and then<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; just loops disconnecting and reconnecting until I shutdown<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; freeswitch<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2008-02-18 23:26:03 [DEBUG]<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; switch_core_state_machine.c:144 switch_core_standard_on_execute()<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:sofia/default/1000@192.168.0.7" target="_blank">sofia/default/1000@192.168.0.7</a>:5060 Execute<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; javascript(/usr/scripts/test1.js)<br> &gt; 2008-02-18 23:26:03 [DEBUG]<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mod_spidermonkey.c:3150 js_api_use() Loading ODBC<br> &gt; 2008-02-18<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 23:26:03 [DEBUG] switch_odbc.c:145 switch_odbc_handle_connect()<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Connecting test<br> &gt; 2008-02-18 23:26:03 [DEBUG] switch_odbc.c:174<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; switch_odbc_handle_connect() Connected to [test]<br> &gt; 2008-02-18<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 23:26:03 [DEBUG] switch_odbc.c:95 switch_odbc_handle_disconnect()<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Disconnected 0 from [test]<br> &gt; 2008-02-18 23:26:03 [DEBUG]<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; switch_odbc.c:142 switch_odbc_handle_connect() Re-connecting<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; test<br> &gt; 2008-02-18 23:26:03 [DEBUG] switch_odbc.c:145<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; switch_odbc_handle_connect() Connecting test<br> &gt; 2008-02-18<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 23:26:03 [DEBUG] switch_odbc.c:174 switch_odbc_handle_connect()<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Connected to [test]<br> &gt; 2008-02-18 23:26:03 [CRIT]<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; switch_odbc.c:234 db_is_up() The sql server is not responding for<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DSN test []<br> &gt; 2008-02-18 23:26:03 [INFO] switch_odbc.c:239<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db_is_up() The connection has been re-established<br>
 &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ...<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Any ideas much appreciated<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Thanks<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Steve<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br>
 &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; _______________________________________________<br> &gt; Freeswitch-users<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mailing list<br> &gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">Freeswitch-users@lists.freeswitch.org</a><br> &gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
 &gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br> &gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
 &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; _______________________________________________<br> &gt; Freeswitch-users<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mailing list<br> &gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">Freeswitch-users@lists.freeswitch.org</a><br>
 &gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br> &gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
 &gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; _______________________________________________<br> &gt; Freeswitch-users<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mailing list<br>
 &gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">Freeswitch-users@lists.freeswitch.org</a><br> &gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
 &gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br> &gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
 &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; _______________________________________________<br> &gt; Freeswitch-users<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; mailing list<br> &gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">Freeswitch-users@lists.freeswitch.org</a><br>
 &gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br> &gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
 &gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br> &gt;<br> &gt;<br> &gt;<br> &gt; _______________________________________________<br> &gt; Freeswitch-users<br> &gt; &nbsp; &nbsp; &nbsp; mailing list<br>
 &gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">Freeswitch-users@lists.freeswitch.org</a><br> &gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
 &gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br> &gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
 &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; _______________________________________________<br> &gt; Freeswitch-users<br> &gt; &nbsp; &nbsp; mailing list<br> &gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">Freeswitch-users@lists.freeswitch.org</a><br>
 &gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br> &gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
 &gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br> &gt;<br> &gt;<br> &gt;<br> &gt; -----Inline Attachment<br> &gt; &nbsp; Follows-----<br> &gt;<br> &gt; _______________________________________________<br>
 &gt; Freeswitch-users<br> &gt; &nbsp; mailing list<br> &gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">Freeswitch-users@lists.freeswitch.org</a><br> &gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
 &gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br> &gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
 &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try<br> &gt; &nbsp; it now.<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; _______________________________________________<br>
 &gt; Freeswitch-users<br> &gt; &nbsp; mailing<br> &gt; &nbsp; list<br> &gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">Freeswitch-users@lists.freeswitch.org</a><br> &gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
 &gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br> &gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
 &gt;<br> &gt;<br> &gt; -----Inline Attachment Follows-----<br> &gt;<br> &gt; _______________________________________________<br> &gt; Freeswitch-users<br> &gt; mailing<br> &gt; list<br> &gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">Freeswitch-users@lists.freeswitch.org</a><br>
 &gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br> &gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
 &gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; ____________________________________________________________________________________<br>
 &gt; Looking for last minute shopping deals?<br> </div></div>&gt; Find them fast with Yahoo! Search. &nbsp;<a href="http://tools.search.yahoo.com/newsearch/category.php?category=shopping" target="_blank">http://tools.search.yahoo.com/newsearch/category.php?category=shopping</a><br>
 <div><div></div><div>&gt; _______________________________________________<br> &gt; Freeswitch-users mailing list<br> &gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">Freeswitch-users@lists.freeswitch.org</a><br>
 &gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br> &gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
 &gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br> <br> <br> _______________________________________________<br> Freeswitch-users mailing list<br> <a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">Freeswitch-users@lists.freeswitch.org</a><br>
 <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
 <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br> </div></div></blockquote></div><br> _______________________________________________<br>Freeswitch-users mailing list<br><a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">Freeswitch-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br></div></div></div></div></div><br>_______________________________________________<br>
Freeswitch-users mailing list<br>
<a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br>