[asterisk-users] Global variables in global variables
Joel Serrano
joel at textplus.com
Tue Jan 24 11:03:58 CST 2023
I believe that EVAL might be able to help you here:
https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+Function_EVAL
Example:
Allphones=${EVAL(Kphones)}&${EVAL(Sphones)}
I'm not sure if in the globals it will let you, but in the dialplan for
sure it will.
On Tue, Jan 24, 2023 at 3:59 AM Antony Stone <
Antony.Stone at asterisk.open.source.it> wrote:
> Hi.
>
> I have a very old dialplan (ie: a dialplan for a very old version of
> Asterisk)
> which I've just transferred to Asterisk 16.28.0
>
> The [globals] section of that dialplan includes:
>
> Kphones=SIP/KC470IP&SIP/KSnom870
> Sphones=SIP/SYealinkT38G&SIP/SGC610IP
> Allphones=${Kphones}&${Sphones}
>
> In the old system, this results in ${Allphones} containing:
>
> SIP/KC470IP&SIP/KSnom870&SIP/SYealinkT38G&SIP/SGC610IP
>
> I can use this in a dial() command.
>
> On the new system, the variable Allphones ends up containing:
>
> ${Kphones}&${Sphones}
>
> (ie: the unexpanded variable names, not the content of those previously-
> defined variables.)
>
> This fairly obviously does not work in a dial() command.
>
>
> a) is this a deliberate backward incompatiblity at some stage in the
> development of Asterisk?
>
> b) if not, is this a known bug?
>
> c) is there some other way I'm supposed to be doing this now, to be able
> to
> define a global variable including the value of another global variable?
>
> d) if not, is there some workaround?
>
>
> Thanks,
>
>
> Antony.
>
> --
> Most people are aware that the Universe is big.
>
> - Paul Davies, Professor of Theoretical Physics
>
> Please reply to the
> list;
> please *don't* CC
> me.
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
> https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20230124/b3a97773/attachment.html>
More information about the asterisk-users
mailing list