[asterisk-users] Multi-Level Queue

Chris Bagnall lists at minotaur.cc
Sun Apr 1 04:21:18 MST 2007


How about using one queue to provide the caller with music and position info, then delayed dialling on the mobiles:

[queue]
timeout=30
retry=0
joinempty=yes
member => SIP/201
member => SIP/202
member => SIP/203
member => SIP/204
member => Local/<mobile1>@delaydial
member => Local/<mobile2>@delaydial

[delaydial]
exten => _X.,1,Wait(10)
exten => _X.,1,Dial(Local/${EXTEN}@outbound)

[outbound]
exten => _X.,1,Dial(IAX2/provider/${EXTEN},,gM(acceptcall))
exten => _X.,t,Playback(toolate)

macro acceptcall {
        Read(ACCEPT,press1,1);
        if (${ACCEPT} != 1)
                MACRO_RESULT=CONTINUE;
};
[queue] goes in queues.conf, obviously. [delaydial] and [outbound] go in extensions.conf. acceptcall is an AEL macro. Modify as required. The sound file "toolate" is played back to the caller who doesn't press 1. You can remove it if you wish. I think this fits most of your requirements:

The SIP clients won't have to ack to receive the call in this scenario, only the mobile clients. Personally, I think that's preferred, since SIP clients will only go to VM if you tell them to in your dialplan.

In a nutshell, an incoming call flows as follows:

1) call comes into the queue, receives announcements, etc. as you specify.
2) all queue members are dialled, SIP extensions ring immediately, but since mobiles are going to the [delaydial] context which gives them a 10 second delay, they won't ring immediately.
3) if none of the SIP members pick up the call, the mobiles are dialled. When they're connected, the sound file "press1" is played to the other end.
4) Mobile user presses 1 to be connected to the caller. If you end up with VM, it obviously doesn't press 1, so call is dropped as soon as one of the others picks up.
5) If nothing picks up, queue retries after 30 seconds.

To achieve your 20 second SIP / 20 second mobile back-and-forth, change the Wait() time in delaydial to 20, and the queue timeout to 40.

You'll need to have a play with it to ensure the timings work out for your setup (e.g. it takes a good 5-6 seconds for mobiles to start ringing after the Dial() command is sent here - that might be different where you are).

Hope that helps.

Regards,

Chris
-- 
C.M. Bagnall, Director, Minotaur I.T. Limited
For full contact details visit http://www.minotaur.it/chris.html
This email is made from 100% recycled electrons



More information about the asterisk-users mailing list