Using Variables in a Dialplan

From Etel

Jump to: navigation, search

Contents

Using Variables in a Dialplan

Problem

You want to store information in a variable for later use in a dialplan.

Solution

Adding these lines to your extension.conf:

[oreilly]
exten => _X.,1,Set(foo="Flamenco")
exten => _X.,2,Set(bar="Spain")
exten => _X.,3,Set(foo=${bar})
exten => _X.,4,NoOp(${foo})

Would result in this being executed by Asterisk:

-- Executing [123@oreilly:1] Set("SIP/3000-01829e00", "foo="Flamenco"") in new stack
-- Executing [123@oreilly:2] Set("SIP/3000-01829e00", "bar="Spain"") in new stack
-- Executing [123@oreilly:3] Set("SIP/3000-01829e00", "foo=Spain") in new stack
-- Executing [123@oreilly:4] NoOp("SIP/3000-01829e00", "Spain") in new stack

Discussion

Coming soon...

See Also:

Metadata

  • By: Jason Goecke
Personal tools