<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.24.5">
</HEAD>
<BODY>
This comes from the book Asterisk 1.4 Professional Guide :<BR>
<BR>
<B>A practical queue</B><BR>
Reading the above, you may well feel that queues are pretty constrained in their<BR>
application, however, consider this scenario&#8212;a busy executive wants any call hitting<BR>
his desk phone to ring his desk phone, and at the same time call his mobile/cell. You<BR>
might think it's easy ... we'll simply ring both the numbers:<BR>
&nbsp;&nbsp;&nbsp;&nbsp; Dial(SIP/200&amp;IAX2/${mytrunk}/07749000001)<BR>
There is no problem if the mobile is switched on and has a signal, but if it's switched<BR>
off, guess what? It's going to go to voicemail straight away and perhaps ring the desk<BR>
phone once or twice.<BR>
<BR>
<B>Using queues to cascade calls</B><BR>
In order to resolve the above situation, what we need to do is ring the desk phone<BR>
and delay the call to the mobile so as to give the executive a chance to answer the<BR>
phone on his desk (if he's there).<BR>
You could of course do this:<BR>
&nbsp;&nbsp;&nbsp; Exten =&gt; s,1,Dial(SIP/200,10)<BR>
&nbsp;&nbsp;&nbsp; Exten =&gt; s,2,Dial(SIP/200&amp;IAX2/${mytrunk}/07749000001)<BR>
The problem with the above is that you'll get a break in the ringing, so that if the<BR>
desk phone is picked up (just as it's going to the second priority), it will result in<BR>
a dead call.<BR>
A neater solution is to use the queue application to kickoff multiple calls for<BR>
you with delays where required. Look at the following example of queues in<BR>
extensions.conf:<BR>
<BR>
<FONT SIZE="2">; Call Sales</FONT><BR>
<FONT SIZE="2">exten =&gt; 1,1,NoOp(calling sales)</FONT><BR>
<FONT SIZE="2">exten =&gt; 1,2,Queue(salesQ)</FONT><BR>
<FONT SIZE="2">[Queues.conf]</FONT><BR>
<FONT SIZE="2">[salesQ]</FONT><BR>
<FONT SIZE="2">joinempty = yes</FONT><BR>
<FONT SIZE="2">member =&gt; Local/*<A HREF="mailto:35@call_nik_mobile">35@call_nik_mobile</A></FONT><BR>
<FONT SIZE="2">member =&gt; Local/<A HREF="mailto:1@call_sales">1@call_sales</A>/n</FONT><BR>
<FONT SIZE="2">member =&gt; Local/<A HREF="mailto:1@call_200">1@call_200</A>/n</FONT><BR>
<FONT SIZE="2">[..extensions.conf]</FONT><BR>
<FONT SIZE="2">[call_sales]</FONT><BR>
<FONT SIZE="2">exten =&gt; 1,1,Dial(${SALES},30,ortT)</FONT><BR>
<FONT SIZE="2">exten =&gt; 1,2,VoiceMail(<A HREF="mailto:200@default">200@default</A>,su)</FONT><BR>
<FONT SIZE="2">[call_200]</FONT><BR>
<FONT SIZE="2">exten =&gt; 1,1,wait(5)</FONT><BR>
<FONT SIZE="2">exten =&gt; 1,2,Dial(SIP/200&amp;SIP/201,30,ortT)</FONT><BR>
<FONT SIZE="2">[call_nik_mobile]</FONT><BR>
<FONT SIZE="2">exten =&gt; *35,1,wait(10)</FONT><BR>
<FONT SIZE="2">exten =&gt; *35,2,Dial(SIP/${mytrunk}/07749600000)</FONT><BR>
<FONT SIZE="2">exten =&gt; *35,3,Hangup()</FONT><BR>
<BR>
In this example, an inbound call is routed to [salesQ].<BR>
<BR>
Within [Queues.conf], we've defined three static members to call. The queue<BR>
application executes all three of them at the same time. In essence, now we have<BR>
three independent threads running for a single inbound call.<BR>
The net result is that the phones defined in the ${Sales} ring group are called, and<BR>
ten seconds later, the extension 200 starts to ring. In the meantime, the sales phones<BR>
continue to ring uninterrupted. Finally, the mobile starts to ring.<BR>
The above shows how you can stagger calls to devices without interrupting the<BR>
ring process.<BR>
<BR>
<BR>
Jonas.<BR>
<BR>
On Thu, 2009-11-05 at 20:25 -0600, Darrick Hartman wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Russell Horn wrote:
&gt; Hi,
&gt; 
&gt; I've a DID number that gets passed to three internal phones and a cell
&gt; phone via my outbound IAX trunk. If the cell phone is off or out of
&gt; coverage, its voice mail captures the call.
&gt; 
&gt; What's the best way to avoid this? Is there a recommended way to force
&gt; the cell phone user to press 1 before the call is passed there ala
&gt; google voice? Or is there another way to detect the presence of the
&gt; answering machine rather than a human?
&gt; 
&gt; Thanks,
&gt; 
&gt; Russell.
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>