[asterisk-users] Variables are empty after Redirecting a channel

Gareth Blades mailinglist+asterisk at dns99.co.uk
Thu Feb 20 06:33:34 CST 2014


On 20/02/14 10:24, Igor Dvorzhak wrote:
> Guys,
>
> I am using
> Asterisk 1.8.20.0 built by mockbuild @ 
> buildvm-24.phx2.fedoraproject.org 
> <http://buildvm-24.phx2.fedoraproject.org> on a x86_64 running Linux 
> on 2013-01-18 19:52:25 UTC
>
> How can I set variable in one context and then Redirect a channel to 
> another context and use variable there? The code below doesn't work, 
> so I've got empty VAR1 in context_2
>
> [context_1]
>
> exten => s,1,SET(__VAR1=VALUE1)
> exten => s,n,ChannelRedirect(${CHANNEL},context_2,AMD,1)
>
> [context_2]
>
> exten => AMD,1,NoOp(VAR1: ${VAR1})
>
> Thank you in advance,
> Igor
>
>
You should be able to get something working using a shared variable. I 
have used them in one of my blog posts if you would like an example of 
their use
http://gblades.blogspot.co.uk/2013/07/how-to-get-sip-response-code-in.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20140220/5de1e83e/attachment.html>


More information about the asterisk-users mailing list