Passing Variables from agi to extensions.conf



I am connecting to the asterisk manager to generate a call using the below.

Action: Originate Channel: sip/provider/1234567 Context: my-context Exten: 1000 Priority: 1 Variable: 1000 Variable: VAR1=xxxxxxxx Variable: VAR2=yyyyyyyyy Variable: VAR3=zzzzzzzzz

In my extensions.conf i have:

[my-context] exten => _X.,1,Set(CDR(userfield)=${ID}) exten => _X.,2,AGI(agi-newre.agi,${EXTEN},${VAR1},${VAR2},${VAR3})

This all works fine and variables are passed with no problem.

My problem is that i need to make a second call that needs to go out from my extensions.conf and and pass along the variables. I have tried many things but know i am doing something stupid. In my AGI script if i put:

In my extensions.conf

[my-context2] exten => _X.,1,Dial(SIP/$VAR1)

The dial out from my-context2 would need to pass the variables to an AGI script. Can this be done? Thanks for any help.


I am not sure if this will do what you want, but you should probably look at variable inheritance. … nce+Basics