[asterisk-users] Dialplan MySQL inserted ID

Gareth Blades mailinglist+asterisk at dns99.co.uk
Tue Aug 20 10:47:24 CDT 2013


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 to know the ID of the newly inserted row.

You could write an AGI script in something like php or perl and get it 
to write to the mysql database instead. It can then set a variable which 
the dialplan can pick up.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20130820/9478a13d/attachment.htm>


More information about the asterisk-users mailing list