[asterisk-users] Transfer_CONTEXT behaviour

Jared Smith jsmith at digium.com
Thu Apr 15 20:53:31 CDT 2010


----- "Steve Davies" <davies147 at gmail.com> wrote:
> I'll have to give that a go. Is there something similar available for
> all of the other Channel technologies, or at least for DAHDI and IAX?

This works for SIP and IAX from at least the 1.4 release, and in DAHDI since 1.6.0 release.
 
> Is TRANSFER_CONTEXT copied to a bridged channel under any
> circumstances? I would be concerned that when Dial() bridges a call,
> it will incorrectly copy this variable onto another channel.
> Basically
> if I dial out of an IAX channel to a 3rd party with a very permissive
> TRANSFER_CONTEXT on the calling channel, I do not want to
> accidentally
> grant permissions to a remote stranger!

You'll need to play around with variable inheritance to get it set right.  If you define a variable with a single underscore (_TRANSFER_CONTEXT in my example), it'll get inherited by the next spawned channel, but go no further.  If you define a variable with two underscores (say, __TRANSFER_CONTEXT), then it will get inherited by the next spawned channel, and any channels spawned by that channel, and so forth.  Obviously defining it without any underscores at all means it won't get inherited by spawned channels.

--
Jared Smith
Digium, Inc.



More information about the asterisk-users mailing list