[asterisk-users] Func_ODBC question

Tarek Sawah tareksawah at hotmail.com
Wed Dec 10 11:15:25 CST 2008


if you are using MYSQL.. why don't you query your DB directly from Asterisk ?
the following example is something i use with my servers
 
[ivr1-cont]exten => 7700,1,Answer
exten => 7700,n,MYSQL(Connect connid 127.0.0.1 root rootpass TarekDB)exten => 7700,n,MYSQL(Query resultid_2 ${connid} SELECT q_name FROM tbl_ivr ORDER BY RAND( ) LIMIT 1 )exten => 7700,n,MYSQL(Fetch fetchid1 ${resultid_2} question)exten => 7700,n,Read(A1,ivr1/${question})exten => 7700,n,MYSQL(Disconnect ${connid})
 
-- AHD Tarek Sawah Integrated Digital Systems CCNA, MCSE, RHCE, VoIP Syria: +963 944 618286 USA: +1 347 562 2308 



From: scgm at adinet.com.uyTo: asterisk-users at lists.digium.comDate: Tue, 9 Dec 2008 15:45:59 -0200Subject: [asterisk-users] Func_ODBC question



Hi I have
 
On func_odbc
 
[EXEC]
readhandle=ressqlserver
writehandle=ressqlserver
readsql=${ARG1}
writesql=${ARG1}
 
 
I’m trying an update on dialplan:
 
exten=> 141,3,Set(dummy=${ODBC_EXEC(UPDATE Tabla set campo = ${EXTEN})})
 
On Cli:
WARNING[3579]: func_odbc.c:353 acf_odbc_read: Error -1 in FETCH [UPDATE Tabla set campo = 4356]
 
 
Any  idea why is this??
The query works fine, I just wanto to know if the warning can cause any problem to me.
 
Thanks!!
 
Sebastian
 __________ Information from ESET Smart Security, version of virus signature database 3677 (20081209) __________The message was checked by ESET Smart Security.http://www.eset.com
_________________________________________________________________
Send e-mail faster without improving your typing skills.
http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_speed_122008
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20081210/ac465a28/attachment.htm 


More information about the asterisk-users mailing list