Hi,<br><br>I configured freeswitch to execute this script whenever a call is made from one number to another.<br><br>function init() {<br> use("ODBC");<br> var db = new ODBC("test", "testuser", "testpwd");
<br> var path = "test.mp3";<br> if(db.connect()) {<br> var tn = session.getVariable("destination_number");<br> var sql = "select path from sounds where tn = " +tn;<br> db.exec(sql);<br> if(
db.nextRow()) {<br> data = db.getData();<br> console_log("**********Playing back " + data["path"] + "**********");<br> path = data["path"];<br> }<br> }<br> else {
<br> console_log("Connection to database failed!");<br> }<br> db = null;<br> bridgeCall(path);<br>}<br>init();<br><br>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.
<br><br>The last three lines output in the console before crashing is - <br><br>2008-01-22 07:22:45 [DEBUG] mod_spidermonkey.c:3202 js_api_use() Loading ODBC<br>2008-01-22 07:22:45 [DEBUG] switch_odbc.c:145 switch_odbc_handle_connect() Connecting test
<br>Segmentation fault (core dumped)<br>________________________________<br><br>OS: RHEL 4.<br>Freeswitch Version: Latest svn checkout (22nd jan 2008 11 AM)<br><br>Kindly help me in resolving this issue.<br><br>Thanks in Advance,
<br><br>B Karthik<br><br>