[Freeswitch-users] Javascript ODBC with MSSQL

Areski K kikihack at gmail.com
Tue Jun 17 12:02:19 PDT 2008


Hey Guys,

I tried to narrow the bug and got some progress !

patch - mod_spidermonkey_odbc.c
http://pastebin.com/f265b99
patch - switch_odbc.c
http://pastebin.com/f446d8596

The issue is basically on :
	SQLRowCount(stmt, &m);
	ret = (int) m;

	if (result < 0 || m < 0) {
		goto error;
	}

By using FreeTDS-MSSQL driver, it will never assign *m* correctly... I
could not fully understand the reason of this!
It does work well if we use other FreeTDS driver like with Postgresql!

Once the --db_is_up() The sql server is not responding for DSN *** []--
is fixed ref patch, the same problem will appear on
spidermonkey_odbc.c when you will be trying to fetch a query!

Both patches are pretty dirty, this is just to illustrate a possible fix!
That make it works smoothly for me, on both postgresql and Mssql :D

Related thread on freetds mailing-list :
http://lists.ibiblio.org/pipermail/freetds/2005q4/019448.html


Thanks for your help,
/Areski


On Sat, Jun 14, 2008 at 11:58 AM, RR <ranjtech at gmail.com> wrote:
> Hi Areski,
> can u let us know if you have this working, because you're not the only
> freak trying to have this work with MSSQL. I have been quite silent on the
> list although have read every single email on it, since we already have the
> infrastructure built around MSSQL and I would love to interface FS with
> MSSQL over TDS etc (Just the way we have done Asterisk) and drive it off of
> that instead of having seperate DBs with replicated information about
> subscribers, endpoints, gateways etc.
> Cheers,
> |R
>
> On Fri, Jun 13, 2008 at 8:01 PM, Areski K <kikihack at gmail.com> wrote:
>>
>> Anyone have been working with an MSSQL ODBC connection through Javascript
>> FS !?
>>
>> I am facing this constant error :
>> 2008-06-14 01:38:22 [CRIT] switch_odbc.c:240 db_is_up() The sql server
>> is not responding for DSN DEVMSSQLTDS []
>> 2008-06-14 01:38:22 [INFO] switch_odbc.c:245 db_is_up() The connection
>> has been re-established
>>
>> It seems that the script block on : db.query(sql);
>> I checked the ODBC connection, DNS and it does work fine from Isql or
>> with php-odbc!
>> For info, this works perfectly if I use an odbc connection on postgresql.
>>
>> I will bet I am the only freak trying to connect to a MSSQL DB ;-)
>>
>> Cheers,
>> //Areski
>>
>> _______________________________________________
>> 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
>
>




More information about the FreeSWITCH-users mailing list