[asterisk-users] Originate with label?

Antony Stone Antony.Stone at asterisk.open.source.it
Wed Aug 31 04:29:23 CDT 2022


On Tuesday 30 August 2022 at 23:51:34, Mark Murawski wrote:

> On 8/30/22 12:34, Antony Stone wrote:

> >>> 	Tracker=${CDR(uniqueid)};
> >>> 
> >>> results in:
> >>> 	MSet(Tracker=-1661872057.2349)
> >>> 
> >>> systemname is missing.
> 
> Please re-evaluate what I wrote previously.  Again, this is not a
> problem with MSet.  You can see this for yourself if you do an inline
> MSet(Tracker=${CDR(uniqueid)});  this will work fine.

Aha - now I see that my problems (or confusions) are being caused by the 
automatic wrapping in $[..] and not by MSet itself, thank you.

> Just because the documentation says that MSet should not be used, it's
> not appropriate to blame all undesirable behaviors on MSet(), since
> clearly MSet() is not the problem here.

Agreed.

> > I think we'll have to disagree on what a programmer "expects" a syntax
> > like var=value to do, then.

> > What I am suggesting is that Tracker=${CDR(uniqueid)} should be converted
> > by AEL into Set(Tracker=${CDR(uniqueid)}) in order to avoid this sort of
> > surprise.
> 
> On the flip-side... anyone who currently relies on purely
> numeric/boolean handling of the current implementation would be
> incredibly surprised to find their AEL suddenly broken... so we need to
> take that into account.

Indeed.

I realise that the better solution might be to wrap assignments (inside Set() 
or MSet(), no matter) with $[..] *only* if the expressions contain arithmetic 
operators + - * / and not if they are simple a=b assignments, including 
a=${b}.

This would ensure that even if ${b} expanded to something containing a dash, 
it would be interpreted as a mathematical minus sign in a=${b}

> I'm a huge fan of enhancements and improvements and bug fixes, but as
> noted, MSet isn't the problem here.

Indeed, I agree with you now.  I was focusing on MSet and not $[..]

> But... currently I don't see a justifiable reason to make this a thing,
> unless there's actual problems demonstrated with the fact that MSet is being
> used.

I would still be interested to know whether there are any examples of MSet() 
doing what one expects and Set() in the same situation causing a problem.


Thanks,


Antony.

-- 
This sentence contains exacly three erors.

                                                   Please reply to the list;
                                                         please *don't* CC me.



More information about the asterisk-users mailing list