[asterisk-users] Variable inheritance with dialplan command Originate

Naomi Rosenberg naomi at dmcip.com
Fri Apr 8 04:57:01 CDT 2011


Hi,

I would have thought that when spawning a channel using the Originate() dialplan command, variables prefixed with two underscores would be preserved.

However this does not work in the following case.

Dialplan code:

[intern]
exten => 200,1,Set(__myvar="foo")
exten => 200,n,Originate(Local/123 at test_orig,exten,dummy)

[test_orig]
exten => 123,1,NoOp(${myvar})
exten => 123,n,Hangup()

[dummy]

/end dialplan code.

Console output:

    -- Executing [200 at intern:1] Set("SIP/200-00000018", "__myvar="foo"") in new stack
    -- Executing [200 at intern:2] Originate("SIP/200-00000018", "Local/123 at test_orig,exten,dummy") in new stack
    -- Executing [123 at test_orig:1] NoOp("Local/123 at test_orig-cbab;2", "") in new stack
    -- Executing [123 at test_orig:2] Hangup("Local/123 at test_orig-cbab;2", "") in new stack


/end console output.

This is in Asterisk 1.8.3.

Is this expected behaviour or a bug, or am I just confused? I would appreciate your thoughts on the matter.

Thank you,

Naomi 




More information about the asterisk-users mailing list