[asterisk-users] hwo to stok variable wiith menu

Dale Noll dnoll at wi.rr.com
Wed Nov 30 19:40:58 CST 2011


On 11/30/2011 11:13 AM, salaheddine elharit wrote:
> i have last question regarding this thread
> with exten => 3,n,MYSQL(Query resultid ${connid} insert into test ( 
> option_name ) values ('${CALLERID(num)}'))
> i can store the phone number without issue
> i need also the date and hour fo call in the "count coulum"
> could you please give me the syntex
> best regards
>

The example table that I gave originally was before I knew what you were 
looking to do. I assumed, incorrectly that you simply wanted to track 
how many times an option was selected in the menu.
I would recommend that you create a table specifically for this 
application.

That table may look like this.  Please name the table and columns 
appropriately for your application.

create table option_three (
calldate    datetime,
callerid    varchar(40)
)

Then the sql would look something like this...
   exten => 3,n,MYSQL(Query resultid ${connid} insert into option_three 
( calldate, callerid ) values ( now(), '${CALLERID(num)}'))

Dale

-- 
"The truth speaks for itself. I'm just the messenger."
      Lyta Alexander - Babylon 5




More information about the asterisk-users mailing list