[asterisk-users] MYSQL INSERT QUESTION IN DIALPLAN

lists65 at gmail.com lists65 at gmail.com
Mon Apr 9 19:34:06 CDT 2012


I am not a programmer and I have learned so much from examples and the list.
Perhaps someone could tell me what I am doing wrong in my example below:

I am getting the caller ID and caller name from my local POTS line and I
want to add it into a sql table.  I am trying with the following code but
the data never gets put into the table.

Can anyone correct my syntax and tell me what I am doing wrong?


[callerinfo]
exten => s,1,MYSQL(Connect connid localhost myuser mypassword cnam)
exten => s,n,MYSQL(Query resultid ${connid} INSERT INTO `calleridcapture`
(`number`,`name`) VALUES (${CALLERID(num)},${CALLERID(name)})
exten => s,n,MYSQL(Clear ${resultid})
exten => s,n,MYSQL(Disconnect ${connid})
exten => s,n,NoOp(Callerid Name  ${CALLERID(name)})
exten => s,n,NoOp(Callerid Number  ${CALLERID(num)})


The NoOP does show the correct CALLERID name & number when I test it.  The
information just doesn't go into my calleridcapture table in the cnam
database.

Thanks very much for your help
Again I am not a programmer and I am sure my syntax is wrong.

This is Asterisk 1.8.10.0






More information about the asterisk-users mailing list