[asterisk-users] Dial() M parameter in 1.6.2.11-rc2

Mark G. Thomas Mark at Misty.com
Tue Aug 3 13:19:11 CDT 2010


Hi,

I can't figure out what syntax to use with the Dial() "M" parameter
for the AEL parser to interpret properly.  Creating an AEL 
macro named "macro-screen()" partly works as a hack, but it must
not turn into a gosub properly, so I get warnings about the "return;".

  Dial(...,tgM(&screen)) with the ael macro named "screen" does not work
  Dial(...,tgM&screen) with the ael macro named "screen" does not work
  Dial(...,tgM(screen)) with the ael macro named "screen" does not work
  Dial(...,tgM(screen)) with the ael macro named "macro-screen" partly works

Is a more correct or otherwise better way to do this in AEL? Is there
some other solution? The other followme examples I've found all have
different behaviors than I want. I'm not looking for the caller to
be prompted for their name or anything, and I don't want the followme
connect to happen unless the cellphone user hits a "1" to accept the 
call, or other key to ditch the call, otherwise cellphone voicemail 
gets the call.

Mark

context inbound {
    ...
    2155551234 => Dial(SIP/1234 at cme&local/102 at internals,18,rt); // screen these
    ...
};

context internals {
    102 => {
        Dial(${CELLPHONE},30,tgM(screen)); // cellphone user gets prompted
        jump s at general-menu;	// jump to IVR menu if call not accepted
    };
};

// play message to cellphone before connecting inbound call
// http://www.voip-info.org/wiki/view/Asterisk+tips+findme
// http://lists.digium.com/pipermail/asterisk-dev/2005-June/013598.html
//
macro macro-screen() {    // hack
    Wait(0.5);
    Read(ACCEPT,followme/options,1,,1,20);
    if( "${ACCEPT}" = "1" ) {
        Background(connecting);
    } else {
        Set(MACRO_RESULT=CONTINUE);
    };
    return;   // I get AEL complaints regardless of whether this is here or not.
};


-- 
Mark G. Thomas (Mark at Misty.com)



More information about the asterisk-users mailing list