<div dir="ltr">thank you so much i will test this option and i will update you <br><br>
<div class="gmail_quote">2011/11/25 Dale Noll <span dir="ltr">&lt;<a href="mailto:dnoll@wi.rr.com">dnoll@wi.rr.com</a>&gt;</span><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote"><u></u>
<div bgcolor="#ffffff" text="#000000">
<div class="im">On 11/25/2011 10:48 AM, salaheddine elharit wrote: 
<blockquote type="cite">
<div dir="ltr">
<div><br>thanks for your response </div>
<div> </div>
<div>i use mysql like a database and my question when the customer press 3 in context menu i want to stok this variable in a table in my database and i want to get this variable after</div>
<div>could you please give an exemple like below</div>
<div> </div>
<div>thanks and regards</div>
<div> </div>
<div>[menu]<br>exten =&gt; s,1,Background(${sounds_path}menu)<br>exten =&gt; 0,1,Goto(menu,s,1)<br>exten =&gt; 1,1,Goto(appel,s,1)<br>exten =&gt; 2,1,Goto(message,s,1)<br>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="COLOR: red"><font size="3"><font face="Times New
                  Roman">exten =&gt; 3,1,Goto(support,s,1) </font></font></span></p>exten =&gt; s,2,goto(menu,s,1)<br>exten =&gt; i,1,Playback(${sounds_path}erreur-saisie)<br>exten =&gt; i,2,Goto(menu,s,1)<br>exten =&gt; t,1,Goto(menu,s,1)<br>
</div><br></div></blockquote><br></div>It is difficult to get a good example because I do not know what you are looking to save.  You say you want to store the variable, but the only variable you have in this case is the digit the user entered, in this case &#39;3&#39;.  If you are trying to count the number of times callers press option &#39;3&#39;, then it is a simple update. <br>
<br>If you have the app_mysql module compiled and loaded you can user the MYSQL() app.<br><a href="http://www.voip-info.org/wiki/view/Asterisk+cmd+MYSQL" target="_blank">http://www.voip-info.org/wiki/view/Asterisk+cmd+MYSQL</a><br>
<br>If you do not want would prefer to setup an ODBC connection, that is a bid more complex as you have to setup unixODBC ( /etc/odbcinst.ini, /etc/odbc.ini ), then setup res_odbc(/etc/asterisk/res_odbc.conf) and func_odbc (/etc/asterisk/func_odbc.conf).<br>
<br>How you update the database from within dialplan depends on which access method you choose.<br><br>Assume you have a mysql table with two columns:<br>option_name    varchar(15)<br>count                int<br><br><br>You could write something like this if you are using app_mysql<br>
<br>exten =&gt; 3,1,NoOp(User chose support option)<br>exten =&gt; 3,n,MYSQL(Connect connid localhost database_user database_password database_name)<br>exten =&gt; 3,n,MYSQL(Query resultid ${connid}  update counter_table set count = count + 1 where option_name = &#39;support&#39;)<br>
exten =&gt; 3,n,MYSQL(Clear ${resultid})<br>exten =&gt; 3,n,MYSQL(Disconnect ${connid})<br>exten =&gt; 3,n,Goto(support,s,1) 
<div class="im"><br><br><br><br><br><pre cols="72">-- 
&quot;The truth speaks for itself. I&#39;m just the messenger.&quot;
     Lyta Alexander - Babylon 5
</pre></div></div><br>--<br>_____________________________________________________________________<br>-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com/" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>              <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br><br>asterisk-users mailing list<br>To UNSUBSCRIBE or update options visit:<br>
  <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br></div>