Steve Murphy wrote:
On Tue, 2008-12-23 at 12:14 -0600, Brent Davidson wrote:
I have two offices sharing a phone system. They also share a common internal context because all of the employees of the second office also work for the first office. Each office has 4 outside lines and I have defined 2 channel groups in my zapata.conf. The second office needs all of their outgoing calls to go out over their lines so the people they call will have the correct callerID. I created an asterisk database and with entries in the database for all extensions in the second office and defined the following macro:

globals {
  CONSOLE="Console/dsp";
  TRUNK="Zap/r1";
  TCTC_Operator=15;
  Law_Operator=12;
};

macro outside-dial ( num ) {
  if (${DB_EXISTS(Office/${CALLERID(num)})}) {
    TRUNK="Zap/r2";
  } else {
    TRUNK="Zap/r1";
  }
  Dial(${TRUNK}/${num},,Ttok);
}

It's working and correctly routing outside calls, but I get the following messages when I reload the extensions.ael file:

[Dec 23 12:16:22] WARNING[2994]: pbx_ael.c:2500 check_pval_item: Warning: file /etc/asterisk/extensions.ael, line 93-93: expression "Zap/r2" has operators, but no variables. Interesting... [Dec 23 12:16:22] WARNING[2994]: pbx_ael.c:2500 check_pval_item: Warning: file /etc/asterisk/extensions.ael, line 95-95: expression "Zap/r1" has operators, but no variables. Interesting...

Any idea what is causing the warnings?

Yes, I do! I was concerned that users were falling into a common
error, where they forget to wrap variable references in $(); so,
if it looks like an expr has arithmetic operators, but no variable
refs, then you get this message.

Yes, I *could* have made it more intelligent. File a bug, and I'll
see if I can do so. At the worst, you can ignore this warning, or
I can simply remove this overly-simple warning.

murf
Well, before I file a bug I have another question... In AEL, what is the correct syntax? Do all variable references still need to be wrapped in ${} or not? If they do, then the documentation on voip-info.org needs to be changed to reflect that.

Beyond that, what are the rules for putting the values assigned to variables in quotes? In my example above, at one point I had a space between the = and the Zap/r2 statement with no quotes. The value assigned to TRUNK then included a leading space. I didn't test to see whether or not putting a space after the variable name adds a space to the variables name. I would think that any spaces after an operator should be ignored unless the come after a single or double quote.

Thanks,
Brent
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to