Re: [asterisk-users] Dialplan MySQL inserted ID

2013-08-21 Thread Gareth Blades
On 20/08/13 17:48, Gergo Csibra wrote: can I echo this variable ? Like : exten = s,n,NoOp(${LAST_INSERT_ID()}) No, this is a mysql query, so: exten = s,n,MYSQL(Query resultid ${connid} INSERT INTO myTable SET C1=${ARG1}, C2=${ARG2}, timestamp=${STRFTIME(${EPOCH},,%Y-%m-%d_%H:%M:%S)}) exten

[asterisk-users] Dialplan MySQL inserted ID

2013-08-20 Thread Jonas Kellens
Hello, how can I obtain the inserted ID after having inserted a row with MySQL in the dialplan ? exten = s,n,MYSQL(Query resultid ${connid} INSERT INTO myTable SET C1=${ARG1}, C2=${ARG2}, timestamp=${STRFTIME(${EPOCH},,%Y-%m-%d_%H:%M:%S)}) I need to know the ID of the newly inserted row.

Re: [asterisk-users] Dialplan MySQL inserted ID

2013-08-20 Thread Gareth Blades
On 20/08/13 14:53, Jonas Kellens wrote: Hello, how can I obtain the inserted ID after having inserted a row with MySQL in the dialplan ? exten = s,n,MYSQL(Query resultid ${connid} INSERT INTO myTable SET C1=${ARG1}, C2=${ARG2}, timestamp=${STRFTIME(${EPOCH},,%Y-%m-%d_%H:%M:%S)}) I need

Re: [asterisk-users] Dialplan MySQL inserted ID

2013-08-20 Thread A J Stiles
On Tuesday 20 August 2013, Jonas Kellens wrote: Hello, how can I obtain the inserted ID after having inserted a row with MySQL in the dialplan ? exten = s,n,MYSQL(Query resultid ${connid} INSERT INTO myTable SET C1=${ARG1}, C2=${ARG2}, timestamp=${STRFTIME(${EPOCH},,%Y-%m-%d_%H:%M:%S)})

Re: [asterisk-users] Dialplan MySQL inserted ID

2013-08-20 Thread Gergo Csibra
Tuesday, August 20, 2013, 5:47:24 PM, Gareth wrote: On 20/08/13 14:53, Jonas Kellens wrote: Hello, how can I obtain the inserted ID after having inserted a row with MySQL in the dialplan ? exten = s,n,MYSQL(Query resultid ${connid} INSERT INTO myTable SET C1=${ARG1}, C2=${ARG2},

Re: [asterisk-users] Dialplan MySQL inserted ID

2013-08-20 Thread Jonas Kellens
On 08/20/2013 06:03 PM, Gergo Csibra wrote: Tuesday, August 20, 2013, 5:47:24 PM, Gareth wrote: On 20/08/13 14:53, Jonas Kellens wrote: Hello, how can I obtain the inserted ID after having inserted a row with MySQL in the dialplan ? exten = s,n,MYSQL(Query resultid ${connid} INSERT INTO

Re: [asterisk-users] Dialplan MySQL inserted ID

2013-08-20 Thread Chris Bagnall
On 20/8/13 5:00 pm, A J Stiles wrote: Why not write an AGI script in your favourite language (Perl, Python, PHP, Java all have AGI and MySQL bindings) to perform the INSERT query for you? +1. It would also give you somewhere to perform sanity checks on your ${ARGS} to avoid SQL injection

Re: [asterisk-users] Dialplan MySQL inserted ID

2013-08-20 Thread Gergo Csibra
Tuesday, August 20, 2013, 6:08:19 PM, Jonas wrote: On 08/20/2013 06:03 PM, Gergo Csibra wrote: Tuesday, August 20, 2013, 5:47:24 PM, Gareth wrote: On 20/08/13 14:53, Jonas Kellens wrote: Hello, how can I obtain the inserted ID after having inserted a row with MySQL in the dialplan ?