Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] ODBC through JS

Goto page Previous  1, 2
 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
xtpl.gayatri at gmail.com
Guest





PostPosted: Fri Oct 10, 2008 7:11 am    Post subject: [Freeswitch-users] ODBC through JS Reply with quote

latest version of odbc.ini:

[ODBC Data Sources]PostgreSQL = PostgreSQL Database Driver [PostgreSQL]Description = PostgreSQL Database Driver Driver = /usr/local/lib/libodbcpsql.soTrace = Yes TraceFile = sql.logDatabase = postgres Servername = 58.68.117.43UserName = <username> Password = <password>Port = 5432 Protocol = 6.4ReadOnly = No RowVersioning = NoShowSystemTables = No ShowOidColumn = NoFakeOidIndex = No ConnSettings =[Default] Driver = /usr/local/lib/libodbcpsql.so[ODBC] Trace = 1TraceFile = /var/log/odbctrace.out Driver = /usr/local/lib/libodbcpsql.so
On Fri, Oct 10, 2008 at 5:28 PM, Gayatri Kulkarni <xtpl.gayatri@gmail.com (xtpl.gayatri@gmail.com)> wrote:
Quote:
either value for DSN name gives the same result Sad


On Fri, Oct 10, 2008 at 4:27 PM, Jonas Gauffin <jonas.gauffin@gmail.com (jonas.gauffin@gmail.com)> wrote:
Quote:
your DSN name is "postgres" and not "PostgreSQL"


On Fri, Oct 10, 2008 at 12:34 PM, Gayatri Kulkarni <xtpl.gayatri@gmail.com (xtpl.gayatri@gmail.com)> wrote:
Quote:
Guys please help me on this
I am still getting that error

freeswitch@fedora> 2008-10-07 17:27:24 [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

I can connect to the database successfully using isql -v commandI can't figure out whats going on Here's my script:

use("ODBC");

var DSN="PostgreSQL";
var DB_USER="<username>";
var DB_PASS="<password>";

var db = new ODBC(DSN, DB_USER, DB_PASS);
//console_log("notice",DB.path+"\n");
if(db.connect()){
console_log("notice","Connected to DB");
}
else{
console_log("notice","Still probs");
}

Here's the output:
freeswitch@fedora> 2008-10-10 15:41:32 [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

2008-10-10 15:41:32 [NOTICE] testdb.js:1 console_log() Still probs

Please Help me Regards,Gayatri Kulkarni
On Tue, Oct 7, 2008 at 5:37 PM, Gayatri Kulkarni <xtpl.gayatri@gmail.com (xtpl.gayatri@gmail.com)> wrote:
Quote:
Guys,
I am now having this problem:
when i run my script i get this error -

freeswitch@fedora> 2008-10-07 17:27:24 [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
my ../etc/odbc.ini looks like this:[postgres]Driver = PostgreSQL SERVER = localhostPORT = 5432 DATABASE = postgresUserName = <username> Password = <password>
and ../etc/odbcinst.ini:
[ODBC] Trace = yesTraceFile = /tmp/trace.log [PostgreSQL]Description = PostgreSQL driver Driver = /usr/local/lib/libodbpsql.soSetup = /usr/local/lib/libodbpsqlS.so UsageCount = 1000000
--
Regards,
Gayatri Kulkarni


On Tue, Oct 7, 2008 at 11:32 AM, Brian West <brian@freeswitch.org (brian@freeswitch.org)> wrote:


Quote:

thats because you don't load it in modules.conf.xml you load it in conf/autoload_configs/spidermonkey.conf.xml

/b

On Oct 7, 2008, at 12:52 AM, Gayatri Kulkarni wrote:

Quote:
Still the same Sad
It builds installs the shard library at {prefix}/freeswitch/lib directory
while all the modules .so files are in {prefix}/freeswitch/mod directory
If i copy the shared library to the mod directory, i get an error saying Invalid ELF Header !!

--
Regards,
Gayatri Kulkarni








_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org









--
Regards,
Gayatri Kulkarni


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org







_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org




--
Regards,
Gayatri Kulkarni






--
Regards,
Gayatri Kulkarni
Back to top
xtpl.gayatri at gmail.com
Guest





PostPosted: Fri Oct 10, 2008 7:16 am    Post subject: [Freeswitch-users] ODBC through JS Reply with quote

either value for DSN name gives the same result Sad

On Fri, Oct 10, 2008 at 4:27 PM, Jonas Gauffin <jonas.gauffin@gmail.com (jonas.gauffin@gmail.com)> wrote:
Quote:
your DSN name is "postgres" and not "PostgreSQL"


On Fri, Oct 10, 2008 at 12:34 PM, Gayatri Kulkarni <xtpl.gayatri@gmail.com (xtpl.gayatri@gmail.com)> wrote:
Quote:
Guys please help me on this
I am still getting that error

freeswitch@fedora> 2008-10-07 17:27:24 [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

I can connect to the database successfully using isql -v commandI can't figure out whats going on Here's my script:

use("ODBC");

var DSN="PostgreSQL";
var DB_USER="<username>";
var DB_PASS="<password>";

var db = new ODBC(DSN, DB_USER, DB_PASS);
//console_log("notice",DB.path+"\n");
if(db.connect()){
console_log("notice","Connected to DB");
}
else{
console_log("notice","Still probs");
}

Here's the output:
freeswitch@fedora> 2008-10-10 15:41:32 [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

2008-10-10 15:41:32 [NOTICE] testdb.js:1 console_log() Still probs

Please Help me Regards,Gayatri Kulkarni
On Tue, Oct 7, 2008 at 5:37 PM, Gayatri Kulkarni <xtpl.gayatri@gmail.com (xtpl.gayatri@gmail.com)> wrote:
Quote:
Guys,
I am now having this problem:
when i run my script i get this error -

freeswitch@fedora> 2008-10-07 17:27:24 [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
my ../etc/odbc.ini looks like this:[postgres]Driver = PostgreSQL SERVER = localhostPORT = 5432 DATABASE = postgresUserName = <username> Password = <password>
and ../etc/odbcinst.ini:
[ODBC] Trace = yesTraceFile = /tmp/trace.log [PostgreSQL]Description = PostgreSQL driver Driver = /usr/local/lib/libodbpsql.soSetup = /usr/local/lib/libodbpsqlS.so UsageCount = 1000000
--
Regards,
Gayatri Kulkarni


On Tue, Oct 7, 2008 at 11:32 AM, Brian West <brian@freeswitch.org (brian@freeswitch.org)> wrote:


Quote:

thats because you don't load it in modules.conf.xml you load it in conf/autoload_configs/spidermonkey.conf.xml

/b

On Oct 7, 2008, at 12:52 AM, Gayatri Kulkarni wrote:

Quote:
Still the same Sad
It builds installs the shard library at {prefix}/freeswitch/lib directory
while all the modules .so files are in {prefix}/freeswitch/mod directory
If i copy the shared library to the mod directory, i get an error saying Invalid ELF Header !!

--
Regards,
Gayatri Kulkarni








_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org









--
Regards,
Gayatri Kulkarni


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org







_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org




--
Regards,
Gayatri Kulkarni
Back to top
xtpl.gayatri at gmail.com
Guest





PostPosted: Mon Oct 13, 2008 1:08 am    Post subject: [Freeswitch-users] ODBC through JS Reply with quote

Like we have to add odbc-dsn as a parm name in the voicemail.xml for voice mail,
do we ave to do add it somewhere for running it in javascript too?

like i said before, i can successfully connect with same username, password, DSN through isql utility
why does fs not find the DSN name?


--
Regards,
Gayatri Kulkarni
Back to top
yudha2008 at gmail.com
Guest





PostPosted: Fri Oct 17, 2008 3:53 am    Post subject: [Freeswitch-users] ODBC through JS Reply with quote

Hi,

I have read the above mail list but i cant able to clear this ODBC error.

while installing the unixodbc i deed not get any error but when i load the mod_spidermonkey_obdc i get these errors

freeswitch@hp30094686650.optimus.co.in (freeswitch@hp30094686650.optimus.co.in)> load mod_spidermonkey_odbc
2008-10-17 14:18:00 [CRIT] switch_loadable_module.c:767 switch_loadable_module_load_file() Error Loading module /usr/local/freeswitch/mod/mod_spidermonkey_odbc.so
**Cannot locate symbol 'switch_module_load' please make sure this is a valid module.**
API CALL [¶]ad(mod_spidermonkey_odbc)] output:
-ERR [Ä[]Ã

when i run the jsrun odbc.js i get this errors

freeswitch@hp30094686650.optimus.co.in (freeswitch@hp30094686650.optimus.co.in)> jsrun odbc.js
API CALL [jsrun(odbc.js)] output:
OK

freeswitch@hp30094686650.optimus.co.in (freeswitch@hp30094686650.optimus.co.in)> 2008-10-17 14:18:03 [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

2008-10-17 14:18:03 [ERR] mod_spidermonkey_odbc.c:235 odbc_exec() Database is not connected!
2008-10-17 14:18:03 [ERR] mod_spidermonkey_odbc.c:314 odbc_next_row() Database is not connected!

How can i clear this error help me to solve this problem....

--
Warm Regards,
N.Baskar
Back to top
brian at freeswitch.org
Guest





PostPosted: Fri Oct 17, 2008 3:58 am    Post subject: [Freeswitch-users] ODBC through JS Reply with quote

mod_spidermonkey_odbc is loaded thru spidermonkey.conf.xml and not modules.conf.xml as its a sub module of mod_spidermonkey.

/b

On Oct 17, 2008, at 1:47 AM, Baskar wrote:
Quote:
Hi,

I have read the above mail list but i cant able to clear this ODBC error.

while installing the unixodbc i deed not get any error but when i load the mod_spidermonkey_obdc i get these errors

freeswitch@hp30094686650.optimus.co.in (freeswitch@hp30094686650.optimus.co.in)> load mod_spidermonkey_odbc
2008-10-17 14:18:00 [CRIT] switch_loadable_module.c:767 switch_loadable_module_load_file() Error Loading module /usr/local/freeswitch/mod/mod_spidermonkey_odbc.so
**Cannot locate symbol 'switch_module_load' please make sure this is a valid module.**
API CALL [¶]ad(mod_spidermonkey_odbc)] output:
-ERR [Ä[]Ã

when i run the jsrun odbc.js i get this errors

freeswitch@hp30094686650.optimus.co.in (freeswitch@hp30094686650.optimus.co.in)> jsrun odbc.js
API CALL [jsrun(odbc.js)] output:
OK
Back to top
yudha2008 at gmail.com
Guest





PostPosted: Fri Oct 17, 2008 4:38 am    Post subject: [Freeswitch-users] ODBC through JS Reply with quote

Hi,

I did that too but still same error

please correct me where i am wrong


On Fri, Oct 17, 2008 at 2:20 PM, Brian West <brian@freeswitch.org (brian@freeswitch.org)> wrote:
Quote:
mod_spidermonkey_odbc is loaded thru spidermonkey.conf.xml and not modules.conf.xml as its a sub module of mod_spidermonkey.

/b

On Oct 17, 2008, at 1:47 AM, Baskar wrote:

Quote:
Hi,

I have read the above mail list but i cant able to clear this ODBC error.

while installing the unixodbc i deed not get any error but when i load the mod_spidermonkey_obdc i get these errors

freeswitch@hp30094686650.optimus.co.in (freeswitch@hp30094686650.optimus.co.in)> load mod_spidermonkey_odbc
2008-10-17 14:18:00 [CRIT] switch_loadable_module.c:767 switch_loadable_module_load_file() Error Loading module /usr/local/freeswitch/mod/mod_spidermonkey_odbc.so
**Cannot locate symbol 'switch_module_load' please make sure this is a valid module.**
API CALL [¶]ad(mod_spidermonkey_odbc)] output:
-ERR [Ä[]Ã

when i run the jsrun odbc.js i get this errors

freeswitch@hp30094686650.optimus.co.in (freeswitch@hp30094686650.optimus.co.in)> jsrun odbc.js
API CALL [jsrun(odbc.js)] output:
OK






_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org




--
Warm Regards,
N.Baskar
Back to top
brian at freeswitch.org
Guest





PostPosted: Fri Oct 17, 2008 7:25 am    Post subject: [Freeswitch-users] ODBC through JS Reply with quote

at the cli its "smload mod_spidermonkey_odbc"

/b

On Oct 17, 2008, at 2:30 AM, Baskar wrote:

Quote:
load mod_spidermonkey_odbc


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
mike at jerris.com
Guest





PostPosted: Fri Oct 17, 2008 10:56 am    Post subject: [Freeswitch-users] ODBC through JS Reply with quote

this error means you still have it in modules.conf.xml. Remove it.
On Oct 17, 2008, at 5:30 AM, Baskar wrote:
Quote:
Hi,

I did that too but still same error

please correct me where i am wrong


On Fri, Oct 17, 2008 at 2:20 PM, Brian West <brian@freeswitch.org (brian@freeswitch.org)> wrote:
Quote:
mod_spidermonkey_odbc is loaded thru spidermonkey.conf.xml and not modules.conf.xml as its a sub module of mod_spidermonkey.

/b

On Oct 17, 2008, at 1:47 AM, Baskar wrote:

Quote:
Hi,

I have read the above mail list but i cant able to clear this ODBC error.

while installing the unixodbc i deed not get any error but when i load the mod_spidermonkey_obdc i get these errors

freeswitch@hp30094686650.optimus.co.in (freeswitch@hp30094686650.optimus.co.in)> load mod_spidermonkey_odbc
2008-10-17 14:18:00 [CRIT] switch_loadable_module.c:767 switch_loadable_module_load_file() Error Loading module /usr/local/freeswitch/mod/mod_spidermonkey_odbc.so
**Cannot locate symbol 'switch_module_load' please make sure this is a valid module.**
API CALL [¶]ad(mod_spidermonkey_odbc)] output:
-ERR [Ä[]Ã

when i run the jsrun odbc.js i get this errors

freeswitch@hp30094686650.optimus.co.in (freeswitch@hp30094686650.optimus.co.in)> jsrun odbc.js
API CALL [jsrun(odbc.js)] output:
OK






Back to top
yudha2008 at gmail.com
Guest





PostPosted: Mon Oct 20, 2008 2:06 am    Post subject: [Freeswitch-users] ODBC through JS Reply with quote

Hi,

When i load the mod_spidermonkey command i get all mod_spidermonkey loaded successfully

freeswitch@hp30094686650.optimus.co.in (freeswitch@hp30094686650.optimus.co.in)> load mod_spidermonkey
2008-10-20 12:29:46 [CONSOLE] mod_spidermonkey.c:944 sm_load_file() Successfully Loaded [/usr/local/freeswitch/mod/mod_spidermonkey_teletone.so]
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]
2008-10-20 12:29:46 [CONSOLE] mod_spidermonkey.c:944 sm_load_file() Successfully Loaded [/usr/local/freeswitch/mod/mod_spidermonkey_socket.so]
2008-10-20 12:29:46 [CONSOLE] mod_spidermonkey.c:944 sm_load_file() Successfully Loaded [/usr/local/freeswitch/mod/mod_spidermonkey_odbc.so]
2008-10-20 12:29:46 [CONSOLE] switch_loadable_module.c:789 switch_loadable_module_load_file() Successfully Loaded [mod_spidermonkey]
2008-10-20 12:29:46 [NOTICE] switch_loadable_module.c:238 switch_loadable_module_process() Adding Application 'javascript'
2008-10-20 12:29:46 [NOTICE] switch_loadable_module.c:258 switch_loadable_module_process() Adding API Function 'jsrun'
2008-10-20 12:29:46 [NOTICE] switch_loadable_module.c:258 switch_loadable_module_process() Adding API Function 'jsapi'
API CALL [load(mod_spidermonkey)] output:
+OK

when i try to run a sample odbc code from freeswitch console like
freeswitch@hp30094686650.optimus.co.in (freeswitch@hp30094686650.optimus.co.in)> jsrun odbc.js
freeswitch@hp30094686650.optimus.co.in (freeswitch@hp30094686650.optimus.co.in)> API CALL [jsrun(odbc.js)] output:
OK

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

2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:235 odbc_exec() Database is not connected!
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:235 odbc_exec() Database is not connected!
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:235 odbc_exec() Database is not connected!
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:235 odbc_exec() Database is not connected!
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:235 odbc_exec() Database is not connected!
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:235 odbc_exec() Database is not connected!
2008-10-20 12:29:50 [NOTICE] odbc.js:1 console_log() ==============================
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:235 odbc_exec() Database is not connected!
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:266 odbc_num_rows() Database is not connected!
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:314 odbc_next_row() Database is not connected!
2008-10-20 12:29:50 [NOTICE] odbc.js:1 console_log() ==============================

code is:
use("ODBC");

var people = {};
people["authur"] = 30;
people["ford"] = 42;
people["trillian"] = 29;
people["zaphod"] = 304;
people["marvin"] = 1000001;


db = new ODBC("freeswitch", "optimus", "optimus");
db.connect();

db.exec("create table demo (name varchar(255), age varchar(80));");

for (var i in people) {
sql = "insert into demo values('" + i + "', " + people[i] + ");";
console_log("debug", sql + "\n");
db.exec(sql);
}

sql = "select * from demo;";
var line = "==============================\n";

console_log("notice", line);

db.exec(sql);

console_log("debug", "row count: " + db.numRows() + "\n");

while(db.nextRow()) {
var row = db.getData();

for (var i in row) {
console_log("debug", "[" + i + "] = [" + row[i] + "]\n");
}

console_log("debug", "\n");
}

console_log("notice", line);

what should i specify in DSN.here i gave freeswitch which is a database
name.please assist me to solve this problem


--
Warm Regards,
N.Baskar
Back to top
xtpl.gayatri at gmail.com
Guest





PostPosted: Mon Oct 20, 2008 4:53 am    Post subject: [Freeswitch-users] ODBC through JS Reply with quote

can you connect to the database from outside freeswitch? Using the isql command?
Try that first

Plus:
run odbcinst -j on my system, it shows me 3 files:
/usr/local/etc/odbc.ini /usr/local/etc/odbcinst.ini/root/.odbc.ini

When all these files are identical, i can successfully esatcblish the connection through my JS script

Please go through: http://www.unixodbc.org/odbcinst.html
--
Regards,
Gayatri Kulkarni

On Mon, Oct 20, 2008 at 12:28 PM, Baskar <yudha2008@gmail.com (yudha2008@gmail.com)> wrote:
Quote:
Hi,

When i load the mod_spidermonkey command i get all mod_spidermonkey loaded successfully

freeswitch@hp30094686650.optimus.co.in (freeswitch@hp30094686650.optimus.co.in)> load mod_spidermonkey

2008-10-20 12:29:46 [CONSOLE] mod_spidermonkey.c:944 sm_load_file() Successfully Loaded [/usr/local/freeswitch/mod/mod_spidermonkey_teletone.so]
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]
2008-10-20 12:29:46 [CONSOLE] mod_spidermonkey.c:944 sm_load_file() Successfully Loaded [/usr/local/freeswitch/mod/mod_spidermonkey_socket.so]
2008-10-20 12:29:46 [CONSOLE] mod_spidermonkey.c:944 sm_load_file() Successfully Loaded [/usr/local/freeswitch/mod/mod_spidermonkey_odbc.so]
2008-10-20 12:29:46 [CONSOLE] switch_loadable_module.c:789 switch_loadable_module_load_file() Successfully Loaded [mod_spidermonkey]
2008-10-20 12:29:46 [NOTICE] switch_loadable_module.c:238 switch_loadable_module_process() Adding Application 'javascript'
2008-10-20 12:29:46 [NOTICE] switch_loadable_module.c:258 switch_loadable_module_process() Adding API Function 'jsrun'
2008-10-20 12:29:46 [NOTICE] switch_loadable_module.c:258 switch_loadable_module_process() Adding API Function 'jsapi'
API CALL [load(mod_spidermonkey)] output:
+OK

when i try to run a sample odbc code from freeswitch console like
freeswitch@hp30094686650.optimus.co.in (freeswitch@hp30094686650.optimus.co.in)> jsrun odbc.js

freeswitch@hp30094686650.optimus.co.in (freeswitch@hp30094686650.optimus.co.in)> API CALL [jsrun(odbc.js)] output:
OK

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

2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:235 odbc_exec() Database is not connected!
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:235 odbc_exec() Database is not connected!
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:235 odbc_exec() Database is not connected!
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:235 odbc_exec() Database is not connected!
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:235 odbc_exec() Database is not connected!
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:235 odbc_exec() Database is not connected!
2008-10-20 12:29:50 [NOTICE] odbc.js:1 console_log() ==============================
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:235 odbc_exec() Database is not connected!
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:266 odbc_num_rows() Database is not connected!
2008-10-20 12:29:50 [ERR] mod_spidermonkey_odbc.c:314 odbc_next_row() Database is not connected!
2008-10-20 12:29:50 [NOTICE] odbc.js:1 console_log() ==============================

code is:
use("ODBC");

var people = {};
people["authur"] = 30;
people["ford"] = 42;
people["trillian"] = 29;
people["zaphod"] = 304;
people["marvin"] = 1000001;


db = new ODBC("freeswitch", "optimus", "optimus");
db.connect();

db.exec("create table demo (name varchar(255), age varchar(80));");

for (var i in people) {
sql = "insert into demo values('" + i + "', " + people[i] + ");";
console_log("debug", sql + "\n");
db.exec(sql);
}

sql = "select * from demo;";
var line = "==============================\n";

console_log("notice", line);

db.exec(sql);

console_log("debug", "row count: " + db.numRows() + "\n");

while(db.nextRow()) {
var row = db.getData();

for (var i in row) {
console_log("debug", "[" + i + "] = [" + row[i] + "]\n");
}

console_log("debug", "\n");
}

console_log("notice", line);

what should i specify in DSN.here i gave freeswitch which is a database
name.please assist me to solve this problem


--
Warm Regards,
N.Baskar



_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

Back to top
yudha2008 at gmail.com
Guest





PostPosted: Mon Oct 20, 2008 5:35 am    Post subject: [Freeswitch-users] ODBC through JS Reply with quote

Hi,

Using isql i get these error
[root@hp30094686650 ~]# isql ODBC
[ISQL]ERROR: Could not SQLConnect


when i run odbcinst -j on my system, it shows me also 3 files

[root@hp30094686650 ~]# odbcinst -j
unixODBC 2.2.12
DRIVERS............: /usr/local/etc/odbcinst.ini
SYSTEM DATA SOURCES: /usr/local/etc/odbc.ini
USER DATA SOURCES..: /root/.odbc.ini



/usr/local/etc/.odbc.ini
[ODBC]
Description = mysql
Trace = Off
TraceFile = stderr
Driver = mysql
SERVER = 172.20.176.32
USER = optimus
PASSWORD = optimus
PORT = 3306
DATABASE = freeswitch


/usr/local/etc/odbcinst.ini

[mysql]
Description = MYSQL driver
Driver = /usr/local/lib/libmyodbc3.so
Setup = /usr/local/lib/libodbcmyS.so

CPTimeout =
CPReuse =
FileUsage = 1

I what to connect to mysql please correct me where i am worng
--
Warm Regards,
N.Baskar
Back to top
freeswitch-users at li...
Guest





PostPosted: Mon Oct 20, 2008 8:23 am    Post subject: [Freeswitch-users] ODBC through JS Reply with quote

On 10/20/2008 5:25 AM, Baskar wrote:
Quote:

* /usr/local/etc/.odbc.ini*

/usr/local/etc/odbc.ini not .odbc.ini

Quote:
--
Warm Regards,
N.Baskar


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
xtpl.gayatri at gmail.com
Guest





PostPosted: Mon Oct 20, 2008 8:32 am    Post subject: [Freeswitch-users] ODBC through JS Reply with quote

First:
Syntax for isql: isql <DSN> <username> <password>

Next:
Make sure your /usr/local/etc/odbcinst.ini matches /root/.odbc.ini

Create a database in the DSN which you can test on

Sample odbc ini:[ODBC Data Sources]MySQL = MySQL Database Driver [MySQL]Description = MySQL Database Driver Driver = /usr/local/lib/<name-of-your-lib-odbc.so>Trace = Yes TraceFile = sql.logDatabase = <database name> Servername = <IP of server on which DB is installed>UserName = <username> Password = <password>Port = <port no for mysql> Protocol = 6.4ReadOnly = No RowVersioning = NoShowSystemTables = No ShowOidColumn = NoFakeOidIndex = No ConnSettings =[Default] Driver = /usr/local/lib/<name-of-your-lib-odbc.so>[ODBC] Trace = 1TraceFile = /var/log/odbctrace.out Driver = /usr/local/lib/<name-of-your-lib-odbc.so>
Follow steps given on: http://www.unixodbc.org/odbcinst.html ---
Quote:
odbcinst -i -d -f template_fileodbcinst -i -s -f template_file
They install the drivers you list in the ini files
I doubt there will be anything left to do after that!
Hope this helps

--
Regards,
Gayatri Kulkarni

On Mon, Oct 20, 2008 at 3:55 PM, Baskar <yudha2008@gmail.com (yudha2008@gmail.com)> wrote:
Quote:
Hi,

Using isql i get these error
[root@hp30094686650 ~]# isql ODBC
[ISQL]ERROR: Could not SQLConnect


when i run odbcinst -j on my system, it shows me also 3 files

[root@hp30094686650 ~]# odbcinst -j
unixODBC 2.2.12
DRIVERS............: /usr/local/etc/odbcinst.ini
SYSTEM DATA SOURCES: /usr/local/etc/odbc.ini
USER DATA SOURCES..: /root/.odbc.ini



/usr/local/etc/.odbc.ini
[ODBC]
Description = mysql
Trace = Off
TraceFile = stderr
Driver = mysql
SERVER = 172.20.176.32
USER = optimus
PASSWORD = optimus
PORT = 3306
DATABASE = freeswitch


/usr/local/etc/odbcinst.ini


[mysql]
Description = MYSQL driver
Driver = /usr/local/lib/libmyodbc3.so
Setup = /usr/local/lib/libodbcmyS.so

CPTimeout =
CPReuse =
FileUsage = 1

I what to connect to mysql please correct me where i am worng
--
Warm Regards,
N.Baskar



_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services