[Home]

Summary:ASTERISK-04985: Macro parameters not handled properly
Reporter:J.W.Hoogervorst (jeroenho)Labels:
Date Opened:2005-09-05 06:37:44Date Closed:2011-06-07 14:10:48
Priority:MinorRegression?No
Status:Closed/CompleteComponents:PBX/pbx_ael
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:I'm using the following macro:

macro stdexten(ext, dev) {
  Set(lang=${DB(Language/${CALLERIDNUM})});
  Set(LANGUAGE()=${lang});
  Dial(${dev},20);
  switch(${DIALSTATUS}) {
     case BUSY:
        Voicemail(b${ext});
        break;
     default:
        Voicemail(u${ext});
  };
  catch a {
     VoiceMailMain(${ext});
     return;
  };
};

This results in the following code:

[ Context 'macro-stdexten' created by 'pbx_ael' ]
 'a' =>            1. VoiceMailMain(${ext})                      [pbx_ael]
                   2. return()                                   [pbx_ael]
 's' =>            1. Set(ext=${ARG1})                           [pbx_ael]
                   2. Set(dev=${ARG2})                           [pbx_ael]
                   3. Set(lang=${DB(Language/${CALLERIDNUM})})   [pbx_ael]
                   4. Set(LANGUAGE()=${lang})                    [pbx_ael]
                   5. Dial(${dev}|20)                            [pbx_ael]
                   6. Goto(sw-stdexten-6-${DIALSTATUS}|1)        [pbx_ael]
                   7. NoOp(Finish switch-stdexten-6)             [pbx_ael]
 'sw-stdexten-6-BUSY' => 1. Voicemail(b${ext})                         [pbx_ael]
                   2. Goto(s|7)                                  [pbx_ael]
 '_sw-stdexten-6-.' => 1. Voicemail(u${ext})                         [pbx_ael]

So the "a" extension is missing the assignment of ${ARG1} to ${ext}.
For now I used an extra 'Set(ext=${ARG1})'.
Comments:By: Russell Bryant (russell) 2005-09-22 22:38:23

Um ... this is not a bug.  When a variable is set on a channel, it is available for use no matter what extension it goes to.