<div dir="ltr">can you connect to the database from outside freeswitch? Using the isql command?<br>Try that first<br><br>Plus:<br> run <span style="font-family: courier new,monospace;">odbcinst -j</span> on my system, it shows me 3 files:<br>
<span style="font-family: courier new,monospace;">/usr/local/etc/odbc.ini</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">/usr/local/etc/odbcinst.ini</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">/root/.odbc.ini</span><br><br>When all these files are identical, i can successfully esatcblish the connection through my JS script<br>
<br>Please go through: <a href="http://www.unixodbc.org/odbcinst.html">http://www.unixodbc.org/odbcinst.html</a> <br>-- <br>Regards,<br>Gayatri Kulkarni<br><br><div class="gmail_quote">On Mon, Oct 20, 2008 at 12:28 PM, Baskar <span dir="ltr">&lt;<a href="mailto:yudha2008@gmail.com">yudha2008@gmail.com</a>&gt;</span> 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 dir="ltr">Hi,<br><br>When i load the mod_spidermonkey command i get all mod_spidermonkey loaded successfully<div class="Ih2E3d">
<br><br><a href="mailto:freeswitch@hp30094686650.optimus.co.in" target="_blank">freeswitch@hp30094686650.optimus.co.in</a>&gt;<b> load mod_spidermonkey</b><br></div>
2008-10-20 12:29:46 [CONSOLE] mod_spidermonkey.c:944 sm_load_file() Successfully Loaded [/usr/local/freeswitch/mod/mod_spidermonkey_teletone.so]<br>2008-10-20 12:29:46 [CONSOLE] mod_spidermonkey.c:944 sm_load_file() Successfully Loaded [/usr/local/freeswitch/mod/mod_spidermonkey_core_db.so]<br>

2008-10-20 12:29:46 [CONSOLE] mod_spidermonkey.c:944 sm_load_file() Successfully Loaded [/usr/local/freeswitch/mod/mod_spidermonkey_socket.so]<br>2008-10-20 12:29:46 [CONSOLE] mod_spidermonkey.c:944 sm_load_file() Successfully Loaded [/usr/local/freeswitch/mod/mod_spidermonkey_odbc.so]<br>

2008-10-20 12:29:46 [CONSOLE] switch_loadable_module.c:789 switch_loadable_module_load_file() Successfully Loaded [mod_spidermonkey]<br>2008-10-20 12:29:46 [NOTICE] switch_loadable_module.c:238 switch_loadable_module_process() Adding Application &#39;javascript&#39;<br>

2008-10-20 12:29:46 [NOTICE] switch_loadable_module.c:258 switch_loadable_module_process() Adding API Function &#39;jsrun&#39;<br>2008-10-20 12:29:46 [NOTICE] switch_loadable_module.c:258 switch_loadable_module_process() Adding API Function &#39;jsapi&#39;<br>

API CALL [load(mod_spidermonkey)] output:<br>+OK<br><br>
when i try to run a sample odbc code from freeswitch console like<div class="Ih2E3d"><br>
<a href="mailto:freeswitch@hp30094686650.optimus.co.in" target="_blank">freeswitch@hp30094686650.optimus.co.in</a>&gt;<b> jsrun odbc.js</b><br>
</div><a href="mailto:freeswitch@hp30094686650.optimus.co.in" target="_blank">freeswitch@hp30094686650.optimus.co.in</a>&gt; API CALL [jsrun(odbc.js)] output:<br>
OK<br>
<br>
2008-10-20 12:29:50 [ERR] switch_odbc.c:160
switch_odbc_handle_connect() STATE: IM002 CODE 0 ERROR:
[unixODBC][Driver Manager]Data source name not found, and no default
driver specified<br>
<br>
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:235 odbc_exec() Database is not connected!<br>
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:235 odbc_exec() Database is not connected!<br>
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:235 odbc_exec() Database is not connected!<br>
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:235 odbc_exec() Database is not connected!<br>
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:235 odbc_exec() Database is not connected!<br>
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:235 odbc_exec() Database is not connected!<br>
2008-10-20 12:29:50 [NOTICE] odbc.js:1 console_log() ==============================<br>
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:235 odbc_exec() Database is not connected!<br>
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:266 odbc_num_rows() Database is not connected!<br>
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:314 odbc_next_row() Database is not connected!<br>
2008-10-20 12:29:50 [NOTICE] odbc.js:1 console_log() ==============================<br><br><b>code is:</b><br>
use(&quot;ODBC&quot;);<br><br>var people = {};<br>people[&quot;authur&quot;] = 30;<br>people[&quot;ford&quot;] = 42;<br>people[&quot;trillian&quot;] = 29;<br>people[&quot;zaphod&quot;] = 304;<br>people[&quot;marvin&quot;] = 1000001;<br>

<br><br>db = new ODBC(&quot;freeswitch&quot;, &quot;optimus&quot;, &quot;optimus&quot;);<br>db.connect();<br><br>db.exec(&quot;create table demo (name varchar(255), age varchar(80));&quot;);<br><br>for (var i in people) {<br>

&nbsp;&nbsp;&nbsp; sql = &quot;insert into demo values(&#39;&quot; + i + &quot;&#39;, &quot; + people[i] + &quot;);&quot;;<br>&nbsp;&nbsp;&nbsp; console_log(&quot;debug&quot;, sql + &quot;\n&quot;);<br>&nbsp;&nbsp;&nbsp; db.exec(sql);<br>}<br><br>sql = &quot;select * from demo;&quot;;<br>

var line = &quot;==============================\n&quot;;<br><br>console_log(&quot;notice&quot;, line);<br><br>db.exec(sql);<br><br>console_log(&quot;debug&quot;, &quot;row count: &quot; + db.numRows() + &quot;\n&quot;);<br>

<br>while(db.nextRow()) {<br>&nbsp;&nbsp;&nbsp; var row = db.getData();<br><br>&nbsp;&nbsp;&nbsp; for (var i in row) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console_log(&quot;debug&quot;, &quot;[&quot; + i + &quot;] = [&quot; + row[i] + &quot;]\n&quot;);<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; console_log(&quot;debug&quot;, &quot;\n&quot;);<br>

}<br><br>console_log(&quot;notice&quot;, line);<br><br><div>what should i specify in DSN.here i gave freeswitch which is a database<br>
name.please assist me to solve this problem<br></div><br>-- <br>Warm Regards,<br>N.Baskar<br><br>
</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><br clear="all"><br><br>
</div>