[asterisk-users] Dial Macros

Alexandru Pirvulescu sigxcpu at gmail.com
Tue Apr 3 02:53:16 MST 2007


Hello,

I've seen this already asked and answered but it is still a no go for  
me.
I'm trying to do some preprocessing in the middle of a call, before  
bridging.

I've seen two choices: M() and G() parameters of the Dial() command.

G() was discarded because I don't know if it is possible to bridge  
channels after processing.

With M() I've done something like that:

macro screen ( screen_file, destination, caller_email ) {
         Set(screen_file=${ARG1});
         Set(destination=${ARG2});
         Set(caller_email=${ARG3});

begin:
         // compute play prompt for background()
         Set(BACKGROUND_PROMPT=voip-call-pending&${screen_file});
         Wait(0.5);
         Background(${BACKGROUND_PROMPT});

         catch 2 {
                 Noop(GOTCHA!!!!!!!!!!);
         };

         catch t {
                 goto s|begin;
         };

};

The dial command looks like this:
Dial(IAX2/shortcut1:shortcut1 at bu-vg1/${EXTEN}@from-network|120|M 
(screen^${SCREEN_FILE}^${EXTEN}^${EMAIL_ADDRESS}));

What I do want is to ask the called person to press a key and make a  
choice.
everything goes well until a key is pressed, macro exits with status  
48 + ASCII code of the key and the call is bridged.

I've read that for both G() and M() the pbx services are not  
available. This means that I cannot read a DTMF option in the  
Background() command during the called person IVR?

Shouldn't catch 2 { } block catch the press of the '2' key and print  
GHOTCHA!! ?

Thanks,
Alex



More information about the asterisk-users mailing list