I am sorry for my bad English. Apparently I&#39;m explain myself wrongly but you got the point.<br><br>I tried GetVar as AMI action but I have to specify a channel string. Of course I have the channel string, I parametrized it but Asterisk adds another string to the original channel and I can&#39;t obtain the variable value because of the lack of the real channel string.<br>
<br>eg. <br>I write SIP/1000 in the channel param. but asterisk adds SIP/1000-<b>12eg12</b>. Obviously is not always the same string. This is just a illustrative demonstration.<br><br>I wrote a mail asking for help with that problem.<br>
<br>Thanks.<br><br><br><div class="gmail_quote">2009/7/6 &quot;Juan E. Rodríguez&quot; <span dir="ltr">&lt;<a href="mailto:jerdguez@gmail.com">jerdguez@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



  

<div bgcolor="#ffffff" text="#000000">
Well, I do not understand very well what you are trying to do, but I&#39;ll
give you some advice:<br>
<br>
If you want a variable only for the AGI you call, you just have to
declare that variable on the AGI.<br>
If you would like to make visible that variable as long as the call is
active and for each call, even if the name is the same, you have to set
a channel variable with the Set(variable=value) command.<br>
If you would like to have a variable shared between two or more
channels, use the SHARED() funcion(Asterisk 1.6, back ported to 1.4) <br>
If you want a variable to be accessed from all the channels, you could
use a global variable.<br>
<br>
<a href="http://www.voip-info.org/wiki/view/Asterisk+variables" target="_blank">http://www.voip-info.org/wiki/view/Asterisk+variables</a><br>
<br>
Regards,<br>
Juan<br>
<br>
Carlos Ruiz Diaz wrote:
<blockquote type="cite"><div><div></div><div class="h5">Thank you!<br>
  <br>
I did not know the existence of  DB command. The command allows me to
store KVPs but I have to use the same variable name every time so every
process that starts the AMI instance will override the values making it
unusable for what I want to achieve.<br>
  <br>
It was really useful anyways. :)<br>
  <br>
  <br>
  <div class="gmail_quote">2009/7/6 &quot;Juan E. Rodríguez&quot; <span dir="ltr">&lt;<a href="mailto:jerdguez@gmail.com" target="_blank">jerdguez@gmail.com</a>&gt;</span><br>
  <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
    <div bgcolor="#ffffff" text="#000000">Maybe you could use the
Asterisk Database. <br>
In 1.4 you can do it with DBGet and DBPut:<br>
    <a href="http://www.voip-info.org/wiki/view/Asterisk+cmd+DBget" target="_blank">http://www.voip-info.org/wiki/view/Asterisk+cmd+DBget</a><br>
    <a href="http://www.voip-info.org/wiki/view/Asterisk+cmd+DBput" target="_blank">http://www.voip-info.org/wiki/view/Asterisk+cmd+DBput</a><br>
    <br>
In 1.6 use DB() function.<br>
    <br>
Regards,<br>
    <font color="#888888">Juan</font>
    <div>
    <div><br>
    <br>
David Backeberg wrote:
    <blockquote type="cite">
      <pre>On Mon, Jul 6, 2009 at 11:37 AM, Carlos Ruiz
Diaz<a href="mailto:carlos.ruizdiaz@gmail.com" target="_blank">&lt;carlos.ruizdiaz@gmail.com&gt;</a> wrote:
  </pre>
      <blockquote type="cite">
        <pre>Hello,

if I do a variable assignation using AMI interface, that variable will be
visible only for the current AMI instance or will be readable for all AMI
instances?. I will login using the same user, concurrently. A program will
write a global variable using the same name and if asterisk don&#39;t have any
scope rules I have to find another way to do what I want.
    </pre>
      </blockquote>
      <pre>If you want to maintain scope for a variable across multiple calls you
should maintain the value of that variable outside of asterisk and
keep setting it for each new phonecall. Global variables in asterisk
do not do what you are describing.

AMI does have something where you can name a particular AMI session,
and then communication for that session will care that name. That
should not be confused with a system-wide global variable.

_______________________________________________
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a>
  </pre>
    </blockquote>
    <br>
    <br>
    </div>
    </div>
    </div>
    <br>
_______________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</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></div><pre><hr size="4" width="90%"><div class="im">
_______________________________________________
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a></div></pre>
</blockquote>
<br>
</div>

<br>_______________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</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>