## Macros

A macro is defined in its own block like this. The arguments to the macro are specified with the name of the macro. They are then referred to by that same name. A catch block can be specified to catch special extensions.

-     macro std-exten( ext , dev ) {
             Dial(${dev}/${ext},20);
             switch(${DIALSTATUS) {
             case BUSY:
                     Voicemail(${ext},b);
                     break;
             default:
                     Voicemail(${ext},u);

             }
             catch a {
                     VoiceMailMain(${ext});
                     return;
             }
      }

A macro is then called by preceding the macro name with an ampersand. Empty arguments can be passed simply with nothing between comments(0.11).

-     context example {
          _5XXX => &std-exten(${EXTEN}, "IAX2");
          _6XXX => &std-exten(, "IAX2");
          _7XXX => &std-exten(${EXTEN},);
          _8XXX => &std-exten(,);
      }