Multiple dial macros in parallel

Hi,

I am running Asterisk 1.8.13.0 from source. My client has a phone number that they want monitored by multiple offsite volunteers. What I want to have happen is that when someone dials the incoming number (2125551111 in the example below), the system makes simultaneous outgoing calls to the volunteers (2125552222 and 2125553333). When a volunteer picks up the phone, they hear a message asking them to press 1 to accept the call. If they press 1, they are connected to the caller, and the outbound call to the other volunteer drops.

However, what is actually happening is that as soon as the first volunteer picks up the call, but before they hear the message or press 1, the other call is dropped. The issue is that I don’t want volunteer B to lose the opportunity to answer the call, just because volunteer A’s voicemail picked up. I want the attempt to call volunteer B to continue making progress right up until volunteer A actually presses 1 to accept the call.

I have it set up in the dial plan like this:

[main context]
exten => 2125551111,1, Dial(SIP/2125552222@pstn&SIP/2125553333@pstn,25,mM(followscreen))

[macro-followscreen]
exten => s,1,Read(ACCEPT,you-have-a-call,1)
exten => s,n,GotoIf($["${ACCEPT}" = “” ] ?no)
exten => s,n,GotoIf($["${ACCEPT}" = “1” ] ?yes:no)
exten => s,n(no),Set(MACRO_RESULT=CONTINUE)
exten => s,n,Goto(done)
exten => s,n(yes),Playback(connecting-say-hello)
exten => s,n,Playback(beep)
exten => s,n(done),NoOp(macro-followscreen ACCEPT=${ACCEPT})

Any help would be much appreciated. Thanks!

It might be possible to do this using local channels, depending on when Dial sets the incoming channel up in relation to running the subroutine on the outgoing channel. (Note macros are deprecated.)

If it does work, the confirmation of each answerer will not be serialised, so two people could be asked to answer at once,

Hi

To do this the best way is to use a queue,

all the agents are local channels that have the macro

[queue121]
member = Local/212@force-ans/n
member = Local/213@force-ans/n

[force-ans]
exten => 212,1, Dial(SIP/2125552222@pstn,180,mM(followscreen))
exten => 213,1, Dial(SIP/2125553333@pstn,180,mM(followscreen))

[macro-followscreen]
exten => s,1,Read(ACCEPT,you-have-a-call,1)
exten => s,n,GotoIf($["${ACCEPT}" = “” ] ?no)
exten => s,n,GotoIf($["${ACCEPT}" = “1” ] ?yes:no)
exten => s,n(no),Set(MACRO_RESULT=CONTINUE)
exten => s,n,Goto(done)
exten => s,n(yes),Playback(connecting-say-hello)
exten => s,n,Playback(beep)
exten => s,n(done),NoOp(macro-followscreen ACCEPT=${ACCEPT})

we do this for some callceteres and where calls are diverted to mobile phones.