<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"><<a href="mailto:yudha2008@gmail.com">yudha2008@gmail.com</a>></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>><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 'javascript'<br>
2008-10-20 12:29:46 [NOTICE] switch_loadable_module.c:258 switch_loadable_module_process() Adding API Function 'jsrun'<br>2008-10-20 12:29:46 [NOTICE] switch_loadable_module.c:258 switch_loadable_module_process() Adding API Function 'jsapi'<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>><b> jsrun odbc.js</b><br>
</div><a href="mailto:freeswitch@hp30094686650.optimus.co.in" target="_blank">freeswitch@hp30094686650.optimus.co.in</a>> 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("ODBC");<br><br>var people = {};<br>people["authur"] = 30;<br>people["ford"] = 42;<br>people["trillian"] = 29;<br>people["zaphod"] = 304;<br>people["marvin"] = 1000001;<br>
<br><br>db = new ODBC("freeswitch", "optimus", "optimus");<br>db.connect();<br><br>db.exec("create table demo (name varchar(255), age varchar(80));");<br><br>for (var i in people) {<br>
sql = "insert into demo values('" + i + "', " + people[i] + ");";<br> console_log("debug", sql + "\n");<br> db.exec(sql);<br>}<br><br>sql = "select * from demo;";<br>
var line = "==============================\n";<br><br>console_log("notice", line);<br><br>db.exec(sql);<br><br>console_log("debug", "row count: " + db.numRows() + "\n");<br>
<br>while(db.nextRow()) {<br> var row = db.getData();<br><br> for (var i in row) {<br> console_log("debug", "[" + i + "] = [" + row[i] + "]\n");<br> }<br><br> console_log("debug", "\n");<br>
}<br><br>console_log("notice", 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>