Re: [asterisk-users] Storing a variable at a context and using it in another context

2011-10-25 Thread Danny Nicholas
In my 1.4 and 10.0 experience, there are two types of variables.  Call/Local
variables that "live" for the duration of the current call only and Global
variables that are set and live on until Asterisk is restarted.  I can do
set(foo=${CALLERID(num)) and use ${foo} anywhere in my dialplan.   I can do
Set(GLOBAL(lastcaller)=${CALLERID(num)}) and see that my last caller was
${lastcaller} from any concurrent or later call.

 

From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of amit anand
Sent: Monday, October 24, 2011 6:44 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Storing a variable at a context and using it
in another context

 

Declare the global variable

On Mon, Oct 24, 2011 at 15:16, bilal ghayyad  wrote:

Hi All;

Is it possible to store a variable at context and using it in another
context or in the MACRO? For example, how I can store the ${CALLERID(num)}
in a variable and use it in another context or in a MACRO?

Regards
Bilal

--
_
-- 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





 

-- 

 

Amit Anand

 


 


+91 9818559898

 

 

--
_
-- 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

Re: [asterisk-users] Storing a variable at a context and using it in another context

2011-10-24 Thread A J Stiles
On Monday 24 October 2011, bilal ghayyad wrote:
> Hi All;
> 
> Is it possible to store a variable at context and using it in another
> context or in the MACRO? For example, how I can store the ${CALLERID(num)}
> in a variable and use it in another context or in a MACRO?

Variables are local to channels  (to all intents and purposes, call legs),  
not contexts.  If you call a macro or GoTo() another context, any variables 
you defined in the calling context should be preserved.  They will only be 
forgotten when the channel is destroyed  (to all intents and purposes, when 
the call is hung up).

-- 
AJS

Answers come *after* questions.

--
_
-- 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


Re: [asterisk-users] Storing a variable at a context and using it in another context

2011-10-24 Thread amit anand
Declare the global variable

On Mon, Oct 24, 2011 at 15:16, bilal ghayyad  wrote:

> Hi All;
>
> Is it possible to store a variable at context and using it in another
> context or in the MACRO? For example, how I can store the ${CALLERID(num)}
> in a variable and use it in another context or in a MACRO?
>
> Regards
> Bilal
>
> --
> _
> -- 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
>



-- 

Amit Anand


+91 9818559898
--
_
-- 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

Re: [asterisk-users] Storing a variable at a context and using it in another context

2011-10-24 Thread Sammy Govind
Try using variables between macros and contexts without doing anything. It
works fine for me in asterisk 1.6.13+. If not then use _ before variable
name.

On Mon, Oct 24, 2011 at 2:46 PM, bilal ghayyad  wrote:

> Hi All;
>
> Is it possible to store a variable at context and using it in another
> context or in the MACRO? For example, how I can store the ${CALLERID(num)}
> in a variable and use it in another context or in a MACRO?
>
> Regards
> Bilal
>
> --
> _
> -- 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
>
--
_
-- 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

[asterisk-users] Storing a variable at a context and using it in another context

2011-10-24 Thread bilal ghayyad
Hi All;

Is it possible to store a variable at context and using it in another context 
or in the MACRO? For example, how I can store the ${CALLERID(num)} in a 
variable and use it in another context or in a MACRO?

Regards
Bilal

--
_
-- 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