[Freeswitch-users] Freeswitch crashes randomly while executing a javascript with odbc calls.

B Karthik carthick84 at gmail.com
Tue Jan 22 05:35:38 PST 2008


Hi,

I configured freeswitch to execute this script whenever a call is made from
one number to another.

function init() {
 use("ODBC");
 var db = new ODBC("test", "testuser", "testpwd");
 var path = "test.mp3";
 if(db.connect()) {
  var tn =  session.getVariable("destination_number");
  var sql = "select path from sounds where tn = " +tn;
  db.exec(sql);
    if(db.nextRow()) {
       data = db.getData();
       console_log("**********Playing back " + data["path"] + "**********");
       path = data["path"];
    }
 }
 else {
  console_log("Connection to database failed!");
 }
 db = null;
 bridgeCall(path);
}
init();

This script executes fine when the call is initiated for the first time. For
subsequent calls, the script may execute or freeswitch might crash with a
segmentation fault. It usually crashes when the second call is made but it
is not always the same.

The last three lines output in the console before crashing is -

2008-01-22 07:22:45 [DEBUG] mod_spidermonkey.c:3202 js_api_use() Loading
ODBC
2008-01-22 07:22:45 [DEBUG] switch_odbc.c:145 switch_odbc_handle_connect()
Connecting test
Segmentation fault (core dumped)
________________________________

OS: RHEL 4.
Freeswitch Version: Latest svn checkout (22nd jan 2008 11 AM)

Kindly help me in resolving this issue.

Thanks in Advance,

B Karthik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20080122/71a274f0/attachment-0002.html 


More information about the FreeSWITCH-users mailing list