[asterisk-users] hwo to stok variable wiith menu

Salaheddine Elharit salah.elharit200 at gmail.com
Wed May 8 10:27:23 CDT 2013


hello list

i would your help please regarding this issue

with the below code i can store the call date and the callerid ,now i want
to store also the sip phone called 223

could you please see the code and tell me  how can i add the sip phone in
my table 'Menu'

exten => 506,1,Ringing()
exten => 506,n,Dial(SIP/223, 30)
exten => 506,n,Goto(support,s,1)

[support]

exten => s,1,NoOp(User chose support option)
exten => s,n,MYSQL(Connect connid localhost aheevaccs aheevaccs aheevaccs)
exten => s,n,MYSQL(Query resultid ${connid} INSERT\ INTO\ menu\  SET\
callerid='${CALLERID(num)}'\, calldate=now())
exten => s,n,MYSQL(Clear ${resultid})
exten => s,n,MYSQL(Disconnect ${connid})

thanks and regards


2011/12/1 salaheddine elharit <salah.elharit200 at gmail.com>

> Hi Noll,
>
> all works perfectly thanks a lot for your help and support i really
> appreciate it :)
>
> Best Regards
>
> 2011/12/1 Dale Noll <dnoll at wi.rr.com>
>
>>
>> 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
>>
>>
>> --
>> ______________________________**______________________________**_________
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>> New to Asterisk? Join us for a live introductory webinar every Thurs:
>>              http://www.asterisk.org/hello
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>  http://lists.digium.com/**mailman/listinfo/asterisk-**users<http://lists.digium.com/mailman/listinfo/asterisk-users>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20130508/ed26216e/attachment.htm>


More information about the asterisk-users mailing list