[asterisk-users] Originate with label?
Mark Murawski
markm-lists at intellasoft.net
Mon Aug 29 09:11:31 CDT 2022
On 8/29/22 09:53, Antony Stone wrote:
> On Monday 29 August 2022 at 15:35:09, Joshua C. Colp wrote:
>
>> MSet is not deprecated.
> https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_MSet
> includes the sentence "MSet behaves in a similar fashion to the way Set worked
> in 1.2/1.4 and is thus prone to doing things that you may not expect." and
> ends with "Avoid its use if possible."
>
> So, that may not mean "officially deprecated", but it still strongly suggests to
> me that it's undesirable for AEL to convert all assignments into MSet instead
> of Set (allowing the user to explicitly write MSet if that's what's desired).
>
>
> Antony.
>
Some users of AEL might rely on the 'odd behavior' of MSet (the most
obvious of which is the removal of quotes). This would definitely have
to be an option if all conversions were to use Set instead of MSet.
But! What specific reason do you have for wanting Set() instead of
MSet() for all assignments that can't be otherwise just written as an
in-line Set() instead?
Also.. if you specifically want to use Set(), there's nothing preventing
you from just using Set()
The assignment (ex: a=1) style shortcut is mostly useful for math-based
operations. such as making nice syntactic sugar for something like:
a = ${a} + 1
You can of course accomplish math operations a traditional Set() by
using traditional $[] syntax. So for the intended purposes it's pretty
much a shortcut for simple assignments or math. Anything else, you
would need to call Set() directly.
More information about the asterisk-users
mailing list