Re: [asterisk-users] Func_ODBC question

2008-12-10 Thread Tarek Sawah

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: [EMAIL PROTECTED]: [EMAIL PROTECTED]: 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___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Func_ODBC question

2008-12-09 Thread Sebastian
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

 

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Func_ODBC question

2008-12-09 Thread Tilghman Lesher
On Tuesday 09 December 2008 11:45:59 Sebastian wrote:
 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??

Yes, because you did an update in a query where it's expecting to retrieve
rows.

 The query works fine, I just wanto to know if the warning can cause any
 problem to me.

No, it won't, but if you insist upon this syntax, you'd be better off doing:

Set(ODBC_EXEC(UPDATE Tabla set campo = ${EXTEN})=whatever)

Of course, a much better syntax would be:

[TABLA]
readhandle=ressqlserver
writehandle=ressqlserver
writesql=UPDATE Tabla SET ${ARG1}=${VALUE}

exten = 141,3,Set(ODBC_TABLA(campo)=${EXTEN})

-- 
Tilghman

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users