[Freeswitch-users] ODBC spidermonkey

mashudi mashudiflexi at telkom.co.id
Thu Aug 28 23:58:13 PDT 2008


Hi Jonas.gauffin,
here is my configuration related to odbc ,

mashudi:/usr/local/freeswitch/conf/autoload_configs# more 
spidermonkey.conf.xml
<configuration name="spidermonkey.conf" description="Spider Monkey 
JavaScript Pl
ug-Ins">
  <modules>
    <load module="mod_spidermonkey_teletone"/>
    <load module="mod_spidermonkey_core_db"/>
    <load module="mod_spidermonkey_socket"/>
    <load module="mod_spidermonkey_odbc"/>
  </modules>
</configuration>


jonas.gauffin at gmail.com wrote:
> Have you specified in fs\conf\autoload_configs\spidermonkey.conf.xml
> that odbc should be loaded?
>
> On 8/29/08, mashudi <mashudiflexi at telkom.co.id> wrote:
>   
>> it is already
>>
>> use("ODBC");
>>
>>
>> var DSN = "DB";
>> var DB_USER = "conce";
>> var DB_PASS = "password";
>>
>> var line = "====================================\n";
>>
>> var db = new ODBC(DSN, DB_USER, DB_PASS);
>> db.connect();
>> var sql;
>> var dtmf = new Object();
>> var replay = 1;
>>
>> function mycb (session, type, data, arg) {
>>
>>         if (type == "dtmf") {
>>                 arg.digits += data.digit;
>>                 if (arg.digits.length >= 1) {
>>                         return false;
>>                 }
>>         }
>> }
>>
>> function get_route(digits)
>> {
>>
>>         sql = "select count(*) as count from conferences where pin = \""
>> + digits +"\";";
>>
>>         var line = "====================================\n";
>>
>>         console_log("notice", "Menu Option Entered: " + digits +" \n sql
>> statment [" + sql + "]\n");
>>         console_log("notice", line);
>>
>>         db.exec(sql);
>>
>>         while(db.nextRow()) {
>>                 var row = db.getData();
>>                 if (row["count"] >= 1) {
>>                         console_log("notice", "Found Conf Pin=[" +
>> digits + "]\n");
>>                         return digits;
>>                 } else {
>>
>>
>> and the odbc already running :
>>
>> mashudi:/usr/local/freeswitch/scripts# isql -v DB
>> +---------------------------------------+
>> | Connected!                            |
>> |                                       |
>> | sql-statement                         |
>> | help [tablename]                      |
>> | quit                                  |
>> |                                       |
>> +---------------------------------------+
>> SQL>
>>
>>
>>
>> Jonas Gauffin wrote:
>>     
>>> First you have to add
>>>
>>> use("ODBC");
>>>
>>> in your javascript.
>>>
>>>
>>> On Thu, Aug 28, 2008 at 9:06 AM, mashudi <mashudiflexi at telkom.co.id>
>>> wrote:
>>>
>>>       
>>>> Hi folks,
>>>> i try javascripts example for conference application and get this error,
>>>>
>>>> 2008-08-28 20:59:55 [ERR] mod_spidermonkey.c:3303 js_api_use() Error
>>>> loading ODBC
>>>> 2008-08-28 20:59:55 [ERR] conference.js:10 mod_spidermonkey()
>>>> ReferenceError: ODBC is not defined
>>>>
>>>> i have follow the instruction as documented on
>>>> http://wiki.freeswitch.org/wiki/Mod_spidermonkey_odbc.
>>>>
>>>> please help.
>>>>
>>>> *****************************************
>>>> Flexi-Gratis bicara sepanjang waktu se-Jawa Barat,
>>>> Banten dan DKI Jakarta.
>>>>
>>>> Speedy-Gratis Internetan unlimited dari Pkl. 20.00
>>>> s/d 8.00 se- Jabodetabek, Banten, Karawang dan
>>>> Purwakarta
>>>> *****************************************
>>>>
>>>> _______________________________________________
>>>> Freeswitch-users mailing list
>>>> Freeswitch-users at 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 at lists.freeswitch.org
>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>> http://www.freeswitch.org
>>>
>>> *****************************************
>>> Flexi-Gratis bicara sepanjang waktu se-Jawa Barat,
>>> Banten dan DKI Jakarta.
>>>
>>> Speedy-Gratis Internetan unlimited dari Pkl. 20.00
>>> s/d 8.00 se- Jabodetabek, Banten, Karawang dan
>>> Purwakarta
>>> *****************************************
>>>
>>>
>>>       
>> *****************************************
>> Flexi-Gratis bicara sepanjang waktu se-Jawa Barat,
>> Banten dan DKI Jakarta.
>>
>> Speedy-Gratis Internetan unlimited dari Pkl. 20.00
>> s/d 8.00 se- Jabodetabek, Banten, Karawang dan
>> Purwakarta
>> *****************************************
>>
>> _______________________________________________
>> Freeswitch-users mailing list
>> Freeswitch-users at 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 at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
> *****************************************
> Flexi-Gratis bicara sepanjang waktu se-Jawa Barat,
> Banten dan DKI Jakarta.
>
> Speedy-Gratis Internetan unlimited dari Pkl. 20.00
> s/d 8.00 se-Jabodetabek, Banten, Karawang dan
> Purwakarta.
> *****************************************
>
>   


*****************************************
Flexi-Gratis bicara sepanjang waktu se-Jawa Barat,
Banten dan DKI Jakarta.

Speedy-Gratis Internetan unlimited dari Pkl. 20.00
s/d 8.00 se- Jabodetabek, Banten, Karawang dan
Purwakarta
*****************************************




More information about the FreeSWITCH-users mailing list