Answer the question
In order to leave comments, you need to log in
How to get variable from asterisk macro?
How to get a variable from a macro that runs during DIAL?
SOMEVAR is empty in the main context. The same situation is with GoSub.
[incoming]
exten => trunk_78888888888,1,Dial(SIP/trunk_78888888888/79999999999,,gM(example))
exten => trunk_78888888888,2,NoOp(${SOMEVAR})
[macro-example]
exten => s,1,SET(SOMEVAR=456)
Answer the question
In order to leave comments, you need to log in
If the channel is the same, then the variable will have a value, if the channel is different, then resp. will be empty.
Act as you have already been suggested, or you can still use SHARED, but for this you need to clearly understand which channel you are currently in when processing the dialplan.
Use variable inheritance: voip.rus.net/tiki-index.php?page=Asterisk%20Variables
exten => s,1,SET(__SOMEVAR=456)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question