| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \section{Introduction} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | Pardon, but the dialplan in this tutorial will be expressed | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | in AEL, the new Asterisk Extension Language. If you are | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | not used to its syntax, we hope you will find it to some | 
					
						
							|  |  |  | degree intuitive. If not, there are documents explaining | 
					
						
							|  |  |  | its syntax and constructs. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \section{Configuring Call Queues} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \subsection{queues.conf} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | First of all, set up call queues in queue.conf | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Here is an example: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \begin{astlisting} | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \begin{verbatim} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:16:22 +00:00
										 |  |  |    =========== queues.conf =========== | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  |    | ; Cool Digium Queues            | | 
					
						
							|  |  |  |    | [general]                       | | 
					
						
							|  |  |  |    | persistentmembers = yes         | | 
					
						
							|  |  |  |    |                                 | | 
					
						
							|  |  |  |    | ; General sales queue           | | 
					
						
							|  |  |  |    | [sales-general]                 | | 
					
						
							|  |  |  |    | music=default                   | | 
					
						
							|  |  |  |    | context=sales                   | | 
					
						
							|  |  |  |    | strategy=ringall                | | 
					
						
							|  |  |  |    | joinempty=strict                | | 
					
						
							|  |  |  |    | leavewhenempty=strict           | | 
					
						
							|  |  |  |    |                                 | | 
					
						
							|  |  |  |    | ; Customer service queue        | | 
					
						
							|  |  |  |    | [customerservice]               | | 
					
						
							|  |  |  |    | music=default                   | | 
					
						
							|  |  |  |    | context=customerservice         | | 
					
						
							|  |  |  |    | strategy=ringall                | | 
					
						
							|  |  |  |    | joinempty=strict                | | 
					
						
							|  |  |  |    | leavewhenempty=strict           | | 
					
						
							|  |  |  |    |                                 | | 
					
						
							|  |  |  |    | ; Support dispatch queue        | | 
					
						
							| 
									
										
										
										
											2007-06-07 17:52:41 +00:00
										 |  |  |    | [dispatch]                      | | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  |    | music=default                   | | 
					
						
							|  |  |  |    | context=dispatch                | | 
					
						
							|  |  |  |    | strategy=ringall                | | 
					
						
							|  |  |  |    | joinempty=strict                | | 
					
						
							|  |  |  |    | leavewhenempty=strict           | | 
					
						
							|  |  |  |    =================================== | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \end{verbatim} | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \end{astlisting} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | In the above, we have defined 3 separate calling queues: | 
					
						
							| 
									
										
										
										
											2007-06-07 17:52:41 +00:00
										 |  |  | sales-general, customerservice, and dispatch. | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | Please note that the sales-general queue specifies a | 
					
						
							|  |  |  | context of "sales", and that customerservice specifies the | 
					
						
							| 
									
										
										
										
											2007-06-07 17:52:41 +00:00
										 |  |  | context of "customerservice", and the dispatch | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | queue specifies the context "dispatch". These three | 
					
						
							|  |  |  | contexts must be defined somewhere in your dialplan. | 
					
						
							|  |  |  | We will show them after the main menu below. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-08-17 18:32:47 +00:00
										 |  |  | In the [general] section, specifying the persistentmembers=yes, | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | will cause the agent lists to be stored in astdb, and | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | recalled on startup. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The strategy=ringall will cause all agents to be dialed | 
					
						
							|  |  |  | together, the first to answer is then assigned the incoming | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | call. | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | "joinempty" set to "strict" will keep incoming callers from | 
					
						
							|  |  |  | being placed in queues where there are no agents to take calls. | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | The Queue() application will return, and the dial plan can | 
					
						
							| 
									
										
										
										
											2006-09-11 17:02:37 +00:00
										 |  |  | determine what to do next. | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | If there are calls queued, and the last agent logs out, the | 
					
						
							|  |  |  | remaining incoming callers will immediately be removed from | 
					
						
							|  |  |  | the queue, and the Queue() call will return, IF the "leavewhenempty" is | 
					
						
							|  |  |  | set to "strict". | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \subsection{Routing incoming Calls to Queues} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Then in extensions.ael, you can do these things: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \subsubsection{The Main Menu} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | At Digium, incoming callers are sent to the "mainmenu" context, where they | 
					
						
							|  |  |  | are greeted, and directed to the numbers they choose... | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \begin{astlisting} | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \begin{verbatim} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | context mainmenu { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	includes { | 
					
						
							|  |  |  | 		digium; | 
					
						
							|  |  |  | 		queues-loginout; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  |         0 => goto dispatch,s,1; | 
					
						
							|  |  |  |         2 => goto sales,s,1; | 
					
						
							|  |  |  |         3 => goto customerservice,s,1; | 
					
						
							|  |  |  |         4 => goto dispatch,s,1; | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         s => { | 
					
						
							|  |  |  |                 Ringing(); | 
					
						
							|  |  |  |                 Wait(1); | 
					
						
							|  |  |  |                 Set(attempts=0); | 
					
						
							|  |  |  |                 Answer(); | 
					
						
							|  |  |  |                 Wait(1); | 
					
						
							|  |  |  |                 Background(digium/ThankYouForCallingDigium); | 
					
						
							|  |  |  |                 Background(digium/YourOpenSourceTelecommunicationsSupplier); | 
					
						
							|  |  |  |                 WaitExten(0.3); | 
					
						
							|  |  |  |         repeat: | 
					
						
							|  |  |  |                 Set(attempts=$[${attempts} + 1]); | 
					
						
							|  |  |  |                 Background(digium/IfYouKnowYourPartysExtensionYouMayDialItAtAnyTime); | 
					
						
							|  |  |  |                 WaitExten(0.1); | 
					
						
							|  |  |  |                 Background(digium/Otherwise); | 
					
						
							|  |  |  |                 WaitExten(0.1); | 
					
						
							|  |  |  |                 Background(digium/ForSalesPleasePress2); | 
					
						
							|  |  |  |                 WaitExten(0.2); | 
					
						
							|  |  |  |                 Background(digium/ForCustomerServicePleasePress3); | 
					
						
							|  |  |  |                 WaitExten(0.2); | 
					
						
							|  |  |  |                 Background(digium/ForAllOtherDepartmentsPleasePress4); | 
					
						
							|  |  |  |                 WaitExten(0.2); | 
					
						
							|  |  |  |                 Background(digium/ToSpeakWithAnOperatorPleasePress0AtAnyTime); | 
					
						
							|  |  |  |                 if( ${attempts} < 2 ) {
 | 
					
						
							|  |  |  |                         WaitExten(0.3); | 
					
						
							|  |  |  |                         Background(digium/ToHearTheseOptionsRepeatedPleaseHold); | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |                 WaitExten(5); | 
					
						
							|  |  |  |                 if( ${attempts} < 2 ) goto repeat;
 | 
					
						
							|  |  |  |                 Background(digium/YouHaveMadeNoSelection); | 
					
						
							|  |  |  |                 Background(digium/ThisCallWillBeEnded); | 
					
						
							|  |  |  |                 Background(goodbye); | 
					
						
							|  |  |  |                 Hangup(); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \end{verbatim} | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \end{astlisting} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \subsubsection{The Contexts referenced from the queues.conf file} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \begin{astlisting} | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \begin{verbatim} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | context sales { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  |         0 => goto dispatch,s,1; | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  |         8 => Voicemail(${SALESVM});
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         s => { | 
					
						
							|  |  |  |                 Ringing(); | 
					
						
							|  |  |  |                 Wait(2); | 
					
						
							|  |  |  |                 Background(digium/ThankYouForContactingTheDigiumSalesDepartment); | 
					
						
							|  |  |  |                 WaitExten(0.3); | 
					
						
							|  |  |  |                 Background(digium/PleaseHoldAndYourCallWillBeAnsweredByOurNextAvailableSalesRepresentative); | 
					
						
							|  |  |  |                 WaitExten(0.3); | 
					
						
							|  |  |  |                 Background(digium/AtAnyTimeYouMayPress0ToSpeakWithAnOperatorOr8ToLeaveAMessage); | 
					
						
							|  |  |  |                 Set(CALLERID(name)=Sales); | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  |                 Queue(sales-general,t); | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  |                 Set(CALLERID(name)=EmptySalQ); | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  |                 goto dispatch,s,1; | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  |                 Playback(goodbye); | 
					
						
							|  |  |  |                 Hangup(); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \end{verbatim} | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \end{astlisting} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | Please note that there is only one attempt to queue a call in the sales queue. All sales agents that | 
					
						
							|  |  |  | are logged in will be rung. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \begin{astlisting} | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \begin{verbatim} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | context customerservice { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         0 => { | 
					
						
							|  |  |  |                 SetCIDName(CSVTrans); | 
					
						
							|  |  |  |                 goto dispatch|s|1; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         8 => Voicemail(${CUSTSERVVM});
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         s => { | 
					
						
							|  |  |  |                 Ringing(); | 
					
						
							|  |  |  |                 Wait(2); | 
					
						
							|  |  |  |                 Background(digium/ThankYouForCallingDigiumCustomerService); | 
					
						
							|  |  |  |                 WaitExten(0.3); | 
					
						
							|  |  |  |         notracking: | 
					
						
							|  |  |  |                 Background(digium/PleaseWaitForTheNextAvailableCustomerServiceRepresentative); | 
					
						
							|  |  |  |                 WaitExten(0.3); | 
					
						
							|  |  |  |                 Background(digium/AtAnyTimeYouMayPress0ToSpeakWithAnOperatorOr8ToLeaveAMessage); | 
					
						
							|  |  |  |                 Set(CALLERID(name)=Cust Svc); | 
					
						
							|  |  |  |                 Set(QUEUE_MAX_PENALTY=10); | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  |                 Queue(customerservice,t); | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  |                 Set(QUEUE_MAX_PENALTY=0); | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  |                 Queue(customerservice,t); | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  |                 Set(CALLERID(name)=EmptyCSVQ); | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  |                 goto dispatch,s,1; | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  |                 Background(digium/NoCustomerServiceRepresentativesAreAvailableAtThisTime); | 
					
						
							|  |  |  |                 Background(digium/PleaseLeaveAMessageInTheCustomerServiceVoiceMailBox); | 
					
						
							|  |  |  |                 Voicemail(${CUSTSERVVM});
 | 
					
						
							|  |  |  |                 Playback(goodbye); | 
					
						
							|  |  |  |                 Hangup(); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \end{verbatim} | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \end{astlisting} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | Note that calls coming into customerservice will first be try to queue | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | calls to those agents with a QUEUE\_MAX\_PENALTY of 10, and if none are available, | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | then all agents are rung. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \begin{astlisting} | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \begin{verbatim} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | context dispatch | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         s => { | 
					
						
							|  |  |  |                 Ringing(); | 
					
						
							|  |  |  |                 Wait(2); | 
					
						
							|  |  |  |                 Background(digium/ThankYouForCallingDigium); | 
					
						
							|  |  |  |                 WaitExten(0.3); | 
					
						
							|  |  |  |                 Background(digium/YourCallWillBeAnsweredByOurNextAvailableOperator); | 
					
						
							|  |  |  |                 Background(digium/PleaseHold); | 
					
						
							|  |  |  |                 Set(QUEUE_MAX_PENALTY=10); | 
					
						
							|  |  |  |                 Queue(dispatch|t); | 
					
						
							|  |  |  |                 Set(QUEUE_MAX_PENALTY=20); | 
					
						
							|  |  |  |                 Queue(dispatch|t); | 
					
						
							|  |  |  |                 Set(QUEUE_MAX_PENALTY=0); | 
					
						
							|  |  |  |                 Queue(dispatch|t); | 
					
						
							|  |  |  |                 Background(digium/NoOneIsAvailableToTakeYourCall); | 
					
						
							|  |  |  |                 Background(digium/PleaseLeaveAMessageInOurGeneralVoiceMailBox); | 
					
						
							|  |  |  |                 Voicemail(${DISPATCHVM});
 | 
					
						
							|  |  |  |                 Playback(goodbye); | 
					
						
							|  |  |  |                 Hangup(); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \end{verbatim} | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \end{astlisting} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | And in the dispatch context, first agents of priority 10 are tried, then | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | 20, and if none are available, all agents are tried. | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | Notice that a common pattern is followed in each of the three queue contexts: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | First, you set QUEUE\_MAX\_PENALTY to a value, then you call | 
					
						
							| 
									
										
										
										
											2007-07-26 14:49:51 +00:00
										 |  |  | Queue($<$queue-name$>$,option,...) (see the Queue application documetation for details) | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | In the above, note that the "t" option is specified, and this allows the | 
					
						
							|  |  |  | agent picking up the incoming call the luxury of transferring the call to | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | other parties. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | The purpose of specifying the QUEUE\_MAX\_PENALTY is to develop a set of priorities | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | amongst agents. By the above usage, agents with lower number priorities will | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | be given the calls first, and then, if no-one picks up the call, the QUEUE\_MAX\_PENALTY | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | will be incremented, and the queue tried again. Hopefully, along the line, someone | 
					
						
							|  |  |  | will pick up the call, and the Queue application will end with a hangup. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | The final attempt to queue in most of our examples sets the QUEUE\_MAX\_PENALTY | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | to zero, which means to try all available agents. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \subsection{Assigning agents to Queues} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | In this example dialplan, we want to be able to add and remove agents to | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | handle incoming calls, as they feel they are available. As they log in, | 
					
						
							|  |  |  | they are added to the queue's agent list, and as they log out, they are | 
					
						
							|  |  |  | removed. If no agents are available, the queue command will terminate, and | 
					
						
							|  |  |  | it is the duty of the dialplan to do something appropriate, be it sending | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | the incoming caller to voicemail, or trying the queue again with a higher | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | QUEUE\_MAX\_PENALTY. | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | Because a single agent can make themselves available to more than one queue, | 
					
						
							|  |  |  | the process of joining multiple queues can be handled automatically by the | 
					
						
							|  |  |  | dialplan. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \subsubsection{Agents Log In and Out} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \begin{astlisting} | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \begin{verbatim} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | context queues-loginout | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |         6092 => { | 
					
						
							|  |  |  |                         Answer(); | 
					
						
							|  |  |  |                         Read(AGENT_NUMBER,agent-enternum); | 
					
						
							|  |  |  |                         VMAuthenticate(${AGENT_NUMBER}@default,s);
 | 
					
						
							|  |  |  |                         Set(queue-announce-success=1); | 
					
						
							|  |  |  |                         goto queues-manip,I${AGENT_NUMBER},1;
 | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         6093 => { | 
					
						
							|  |  |  |                         Answer(); | 
					
						
							|  |  |  |                         Read(AGENT_NUMBER,agent-enternum); | 
					
						
							|  |  |  |                         Set(queue-announce-success=1); | 
					
						
							|  |  |  |                         goto queues-manip,O${AGENT_NUMBER},1;
 | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \end{verbatim} | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \end{astlisting} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | In the above contexts, the agents dial 6092 to log into their queues, | 
					
						
							|  |  |  | and they dial 6093 to log out of their queues. The agent is prompted | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | for their agent number, and if they are logging in, their passcode, | 
					
						
							|  |  |  | and then they are transferred to the proper extension in the | 
					
						
							|  |  |  | queues-manip context.  The queues-manip context does all the | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | actual work: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \begin{astlisting} | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \begin{verbatim} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | context queues-manip { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // Raquel Squelch | 
					
						
							|  |  |  |         _[IO]6121 => { | 
					
						
							| 
									
										
										
										
											2007-06-07 17:52:41 +00:00
										 |  |  |                 &queue-addremove(dispatch,10,${EXTEN});
 | 
					
						
							|  |  |  |                 &queue-success(${EXTEN});
 | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // Brittanica Spears | 
					
						
							|  |  |  |         _[IO]6165 => { | 
					
						
							| 
									
										
										
										
											2007-06-07 17:52:41 +00:00
										 |  |  |                 &queue-addremove(dispatch,20,${EXTEN});
 | 
					
						
							|  |  |  |                 &queue-success(${EXTEN});
 | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // Rock Hudson | 
					
						
							|  |  |  |         _[IO]6170 => { | 
					
						
							| 
									
										
										
										
											2007-06-07 17:52:41 +00:00
										 |  |  |                 &queue-addremove(sales-general,10,${EXTEN});
 | 
					
						
							|  |  |  |                 &queue-addremove(customerservice,20,${EXTEN});
 | 
					
						
							|  |  |  |                 &queue-addremove(dispatch,30,${EXTEN});
 | 
					
						
							|  |  |  |                 &queue-success(${EXTEN});
 | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // Saline Dye-on | 
					
						
							|  |  |  |         _[IO]6070 => { | 
					
						
							| 
									
										
										
										
											2007-06-07 17:52:41 +00:00
										 |  |  |                 &queue-addremove(sales-general,20,${EXTEN});
 | 
					
						
							|  |  |  |                 &queue-addremove(customerservice,30,${EXTEN});
 | 
					
						
							|  |  |  |                 &queue-addremove(dispatch,30,${EXTEN});
 | 
					
						
							|  |  |  |                 &queue-success(${EXTEN});
 | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \end{verbatim} | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \end{astlisting} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | In the above extensions, note that the queue-addremove macro is used | 
					
						
							|  |  |  | to actually add or remove the agent from the applicable queue, | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | with the applicable priority level. Note that agents with a | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | priority level of 10 will be called before agents with levels | 
					
						
							|  |  |  | of 20 or 30. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | In the above example, Raquel will be dialed first in the dispatch | 
					
						
							|  |  |  | queue, if she has logged in. If she is not, then the second call of | 
					
						
							|  |  |  | Queue() with priority of 20 will dial Brittanica if she is present, | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | otherwise the third call of Queue() with MAX\_PENALTY of 0 will | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | dial Rock and Saline simultaneously. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | Also note that Rock will be among the first to be called in the sales-general | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | queue, and among the last in the dispatch queue. As you can see in | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | main menu, the callerID is set in the main menu so they can tell | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | which queue incoming calls are coming from. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The call to queue-success() gives some feedback to the agent | 
					
						
							|  |  |  | as they log in and out, that the process has completed. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \begin{astlisting} | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \begin{verbatim} | 
					
						
							| 
									
										
										
										
											2007-06-07 17:52:41 +00:00
										 |  |  | macro queue-success(exten) | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | { | 
					
						
							|  |  |  |         if( ${queue-announce-success} > 0 )
 | 
					
						
							|  |  |  |         { | 
					
						
							| 
									
										
										
										
											2007-06-07 17:52:41 +00:00
										 |  |  |                 switch(${exten:0:1})
 | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  |                 { | 
					
						
							|  |  |  |                 case I: | 
					
						
							|  |  |  |                         Playback(agent-loginok); | 
					
						
							|  |  |  |                         Hangup(); | 
					
						
							| 
									
										
										
										
											2007-11-20 15:30:48 +00:00
										 |  |  |                         break; | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  |                 case O: | 
					
						
							|  |  |  |                         Playback(agent-loggedoff); | 
					
						
							|  |  |  |                         Hangup(); | 
					
						
							| 
									
										
										
										
											2007-11-20 15:30:48 +00:00
										 |  |  |                         break; | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  |                 } | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \end{verbatim} | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \end{astlisting} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | The queue-addremove macro is defined in this manner: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \begin{astlisting} | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \begin{verbatim} | 
					
						
							| 
									
										
										
										
											2007-06-07 17:52:41 +00:00
										 |  |  | macro queue-addremove(queuename,penalty,exten) | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2007-06-07 17:52:41 +00:00
										 |  |  |         switch(${exten:0:1})
 | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  |         { | 
					
						
							|  |  |  |         case I:  // Login | 
					
						
							| 
									
										
										
										
											2007-06-07 17:52:41 +00:00
										 |  |  |                  AddQueueMember(${queuename},Local/${exten:1}@agents,${penalty});
 | 
					
						
							|  |  |  | 		 break; | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  |         case O:  // Logout | 
					
						
							| 
									
										
										
										
											2007-06-07 17:52:41 +00:00
										 |  |  |                  RemoveQueueMember(${queuename},Local/${exten:1}@agents); | 
					
						
							|  |  |  | 		 break; | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  |         case P:  // Pause | 
					
						
							| 
									
										
										
										
											2007-06-07 17:52:41 +00:00
										 |  |  |                  PauseQueueMember(${queuename},Local/${exten:1}@agents); | 
					
						
							|  |  |  | 		 break; | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  |         case U:  // Unpause | 
					
						
							| 
									
										
										
										
											2007-06-07 17:52:41 +00:00
										 |  |  |                  UnpauseQueueMember(${queuename},Local/${exten:1}@agents); | 
					
						
							|  |  |  | 		 break; | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  |         default: // Invalid | 
					
						
							| 
									
										
										
										
											2007-06-07 17:52:41 +00:00
										 |  |  |                  Playback(invalid); | 
					
						
							| 
									
										
										
										
											2007-11-20 15:30:48 +00:00
										 |  |  |                  break; | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \end{verbatim} | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \end{astlisting} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-06-07 17:52:41 +00:00
										 |  |  | Basically, it uses the first character of the exten variable, to determine the | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | proper actions to take. In the above dial plan code, only the cases I or O are used, | 
					
						
							|  |  |  | which correspond to the Login and Logout actions. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \subsection{Controlling The Way Queues Call the Agents} | 
					
						
							| 
									
										
										
										
											2006-08-18 02:31:12 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | Notice in the above, that the commands to manipulate agents in queues have | 
					
						
							|  |  |  | "@agents" in their arguments. This is a reference to the agents context: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \begin{astlisting} | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \begin{verbatim} | 
					
						
							| 
									
										
										
										
											2006-08-18 02:31:12 +00:00
										 |  |  | context agents | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	// General sales queue | 
					
						
							|  |  |  | 	8010 => | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		Set(QUEUE_MAX_PENALTY=10); | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | 		Queue(sales-general,t); | 
					
						
							| 
									
										
										
										
											2006-08-18 02:31:12 +00:00
										 |  |  | 		Set(QUEUE_MAX_PENALTY=0); | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | 		Queue(sales-general,t); | 
					
						
							| 
									
										
										
										
											2006-08-18 02:31:12 +00:00
										 |  |  | 		Set(CALLERID(name)=EmptySalQ); | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | 		goto dispatch,s,1; | 
					
						
							| 
									
										
										
										
											2006-08-18 02:31:12 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	// Customer Service queue | 
					
						
							|  |  |  | 	8011 => | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		Set(QUEUE_MAX_PENALTY=10); | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | 		Queue(customerservice,t); | 
					
						
							| 
									
										
										
										
											2006-08-18 02:31:12 +00:00
										 |  |  | 		Set(QUEUE_MAX_PENALTY=0); | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | 		Queue(customerservice,t); | 
					
						
							| 
									
										
										
										
											2006-08-18 02:31:12 +00:00
										 |  |  | 		Set(CALLERID(name)=EMptyCSVQ); | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | 		goto dispatch,s,1; | 
					
						
							| 
									
										
										
										
											2006-08-18 02:31:12 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	8013 => | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		Dial(iax2/sweatshop/9456@from-ecstacy); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		Set(CALLERID(name)=EmptySupQ); | 
					
						
							|  |  |  | 		Set(QUEUE_MAX_PENALTY=10); | 
					
						
							|  |  |  | 		Queue(support-dispatch,t); | 
					
						
							|  |  |  | 		Set(QUEUE_MAX_PENALTY=20); | 
					
						
							|  |  |  | 		Queue(support-dispatch,t); | 
					
						
							|  |  |  | 		Set(QUEUE_MAX_PENALTY=0); // means no max | 
					
						
							|  |  |  | 		Queue(support-dispatch,t); | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | 		goto dispatch,s,1; | 
					
						
							| 
									
										
										
										
											2006-08-18 02:31:12 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2007-06-07 17:52:41 +00:00
										 |  |  | 	6121 => &callagent(${RAQUEL},${EXTEN}); | 
					
						
							|  |  |  | 	6165 => &callagent(${SPEARS},${EXTEN}); | 
					
						
							|  |  |  | 	6170 => &callagent(${ROCK},${EXTEN}); | 
					
						
							|  |  |  | 	6070 => &callagent(${SALINE},${EXTEN}); | 
					
						
							| 
									
										
										
										
											2006-08-18 02:31:12 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \end{verbatim} | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \end{astlisting} | 
					
						
							| 
									
										
										
										
											2006-08-18 02:31:12 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-15 13:12:51 +00:00
										 |  |  | In the above, the variables \$\{RAQUEL\}, etc stand for | 
					
						
							| 
									
										
										
										
											2006-08-18 02:31:12 +00:00
										 |  |  | actual devices to ring that person's | 
					
						
							| 
									
										
										
										
											2008-06-12 17:27:55 +00:00
										 |  |  | phone (like DAHDI/37). | 
					
						
							| 
									
										
										
										
											2006-08-18 02:31:12 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | The 8010, 8011, and 8013 extensions are purely for transferring | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | incoming callers to queues. For instance, a customer service | 
					
						
							|  |  |  | agent might want to transfer the caller to talk to sales. The | 
					
						
							| 
									
										
										
										
											2006-08-18 02:31:12 +00:00
										 |  |  | agent only has to transfer to extension 8010, in this case. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Here is the callagent macro, note that if a person in the | 
					
						
							|  |  |  | queue is called, but does not answer, then they are automatically | 
					
						
							|  |  |  | removed from the queue. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \begin{astlisting} | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \begin{verbatim} | 
					
						
							| 
									
										
										
										
											2007-06-07 17:52:41 +00:00
										 |  |  | macro callagent(device,exten) | 
					
						
							| 
									
										
										
										
											2006-08-18 02:31:12 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2007-06-07 17:52:41 +00:00
										 |  |  | 	if( ${GROUP_COUNT(${exten}@agents)}=0 ) | 
					
						
							| 
									
										
										
										
											2006-08-18 02:31:12 +00:00
										 |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2007-06-07 17:52:41 +00:00
										 |  |  | 		Set(OUTBOUND_GROUP=${exten}@agents);
 | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | 		Dial(${device},300,t);
 | 
					
						
							| 
									
										
										
										
											2006-08-18 02:31:12 +00:00
										 |  |  | 		switch(${DIALSTATUS})
 | 
					
						
							|  |  |  | 		{ | 
					
						
							|  |  |  | 		case BUSY: | 
					
						
							|  |  |  | 			Busy(); | 
					
						
							|  |  |  | 			break; | 
					
						
							|  |  |  | 		case NOANSWER: | 
					
						
							|  |  |  | 			Set(queue-announce-success=0); | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | 			goto queues-manip,O${exten},1;
 | 
					
						
							| 
									
										
										
										
											2006-08-18 02:31:12 +00:00
										 |  |  | 		default: | 
					
						
							|  |  |  | 			Hangup(); | 
					
						
							|  |  |  | 			break; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		Busy(); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \end{verbatim} | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \end{astlisting} | 
					
						
							| 
									
										
										
										
											2006-08-18 02:31:12 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-15 13:12:51 +00:00
										 |  |  | In the callagent macro above, the \$\{exten\} will | 
					
						
							| 
									
										
										
										
											2006-08-18 02:31:12 +00:00
										 |  |  | be 6121, or 6165, etc, which is the extension of the agent. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | The use of the GROUP\_COUNT, and OUTBOUND\_GROUP follow this line | 
					
						
							| 
									
										
										
										
											2006-08-18 02:31:12 +00:00
										 |  |  | of thinking. Incoming calls can be queued to ring all agents in the | 
					
						
							|  |  |  | current priority. If some of those agents are already talking, they | 
					
						
							|  |  |  | would get bothersome call-waiting tones. To avoid this inconvenience, | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | when an agent gets a call, the OUTBOUND\_GROUP assigns that | 
					
						
							| 
									
										
										
										
											2006-08-18 02:31:12 +00:00
										 |  |  | conversation to the group specified, for instance 6171@agents. | 
					
						
							| 
									
										
										
										
											2007-10-15 13:12:51 +00:00
										 |  |  | The \$\{GROUP\_COUNT()\} variable on a subsequent call should return | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | "1" for that group. If GROUP\_COUNT returns 1, then the busy() | 
					
						
							| 
									
										
										
										
											2006-08-18 02:31:12 +00:00
										 |  |  | is returned without actually trying to dial the agent. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \subsection{Pre Acknowledgement Message} | 
					
						
							| 
									
										
										
										
											2006-08-23 20:39:23 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | If you would like to have a pre acknowledge message with option to reject the message | 
					
						
							|  |  |  | you can use the following dialplan Macro as a base with the 'M' dial argument. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \begin{astlisting} | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \begin{verbatim} | 
					
						
							| 
									
										
										
										
											2006-08-23 20:39:23 +00:00
										 |  |  | [macro-screen] | 
					
						
							|  |  |  | exten=>s,1,Wait(.25) | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | exten=>s,2,Read(ACCEPT,screen-callee-options,1) | 
					
						
							| 
									
										
										
										
											2006-08-23 20:39:23 +00:00
										 |  |  | exten=>s,3,Gotoif($[${ACCEPT} = 1] ?50) | 
					
						
							|  |  |  | exten=>s,4,Gotoif($[${ACCEPT} = 2] ?30) | 
					
						
							|  |  |  | exten=>s,5,Gotoif($[${ACCEPT} = 3] ?40) | 
					
						
							|  |  |  | exten=>s,6,Gotoif($[${ACCEPT} = 4] ?30:30) | 
					
						
							|  |  |  | exten=>s,30,Set(MACRO_RESULT=CONTINUE) | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | exten=>s,40,Read(TEXTEN,custom/screen-exten,) | 
					
						
							| 
									
										
										
										
											2006-08-23 20:39:23 +00:00
										 |  |  | exten=>s,41,Gotoif($[${LEN(${TEXTEN})} = 3]?42:45)
 | 
					
						
							|  |  |  | exten=>s,42,Set(MACRO_RESULT=GOTO:from-internal^${TEXTEN}^1)
 | 
					
						
							|  |  |  | exten=>s,45,Gotoif($[${TEXTEN} = 0] ?46:4) | 
					
						
							|  |  |  | exten=>s,46,Set(MACRO_RESULT=CONTINUE) | 
					
						
							|  |  |  | exten=>s,50,Playback(after-the-tone) | 
					
						
							|  |  |  | exten=>s,51,Playback(connected) | 
					
						
							|  |  |  | exten=>s,52,Playback(beep) | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \end{verbatim} | 
					
						
							| 
									
										
										
										
											2007-10-12 15:50:29 +00:00
										 |  |  | \end{astlisting} | 
					
						
							| 
									
										
										
										
											2006-08-18 02:31:12 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \subsection{Caveats} | 
					
						
							| 
									
										
										
										
											2006-08-17 18:09:59 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | In the above examples, some of the possible error checking has been omitted, | 
					
						
							|  |  |  | to reduce clutter and make the examples clearer. |