BreadCrumbs: Asterisk Queue
Asterisk Queue
From Luke Jackson
(Difference between revisions)
Revision as of 22:34, 6 December 2006 (edit) Ljackson (Talk | contribs) (→Dynamic Members) ← Previous diff |
Revision as of 17:16, 7 December 2006 (edit) Ljackson (Talk | contribs) Next diff → |
||
Line 4: | Line 4: | ||
<pre> | <pre> | ||
+ | ; Adds a dynamic agent/member to a Queue | ||
+ | ; arg1 = trunk number, arg2 = number | ||
[macro-agent-add] | [macro-agent-add] | ||
exten => s,1,Wait(1) | exten => s,1,Wait(1) | ||
Line 10: | Line 12: | ||
exten => s,4,GotoIf($["${CALLBACKNUM}" = ""]?111)) ; if no number, jump to fail. | exten => s,4,GotoIf($["${CALLBACKNUM}" = ""]?111)) ; if no number, jump to fail. | ||
exten => s,5,AddQueueMember(${ARG1}|Local/${CALLBACKNUM}@from-internal/n) ; using chan_local allows us to have agents over trunks | exten => s,5,AddQueueMember(${ARG1}|Local/${CALLBACKNUM}@from-internal/n) ; using chan_local allows us to have agents over trunks | ||
- | exten => s,6,UserEvent(Agentlogin|Agent: ${CALLBACKNUM}) | + | exten => s,6,QueueLog(${UNIQUEID},${ARG1},${CALLBACKNUM},AGENTLOGIN,0) |
- | exten => s,7,Wait(1) | + | exten => s,7,Set(DB(agentlogin/q_${ARG1}_a_${CALLBACKNUM})=${EPOCH}) |
- | exten => s,8,Playback(agent-loginok) | + | exten => s,8,UserEvent(Agentlogin|Agent: ${CALLBACKNUM}) |
- | exten => s,9,Hangup() | + | exten => s,9,Wait(1) |
+ | exten => s,10,Playback(agent-loginok) | ||
+ | exten => s,11,Hangup() | ||
exten => s,106,RemoveQueueMember(${ARG1}|Local/${CALLBACKNUM}@from-internal/n) | exten => s,106,RemoveQueueMember(${ARG1}|Local/${CALLBACKNUM}@from-internal/n) | ||
exten => s,107,UserEvent(RefreshQueue) | exten => s,107,UserEvent(RefreshQueue) | ||
- | exten => s,108,Wait(1) | + | exten => s,108,Set(ORGEPOCH=${DB(agentlogin/q_${ARG1}_a_${CALLBACKNUM})}) |
- | exten => s,109,Playback(agent-loggedoff) | + | exten => s,109,Set(LGNT=$[${EPOCH} - ${ORGEPOCH}]) |
- | exten => s,110,Hangup() | + | exten => s,110,GotoIf($["${LGNT}" = "0"]?116:111) |
- | exten => s,111,Playback(sorry-cant-let-you-do-that) | + | exten => s,111,QueueLog(${UNIQUEID},${ARG1},${CALLBACKNUM},AGENTLOGOFF,${LGNT}) |
- | exten => s,112,Hangup() | + | exten => s,112,DBdel(agentlogin/q_${ARG1}_a_${CALLBACKNUM}) |
+ | exten => s,113,Wait(1) | ||
+ | exten => s,114,Playback(agent-loggedoff) | ||
+ | exten => s,115,Hangup() | ||
+ | exten => s,116,Playback(sorry-cant-let-you-do-that) | ||
+ | exten => s,117,Hangup() | ||
</pre> | </pre> | ||
<pre> | <pre> | ||
+ | ; Removes a dynamic agent/member from a Queue | ||
+ | ; arg1 = trunk number, arg2 = number | ||
[macro-agent-del] | [macro-agent-del] | ||
exten => s,1,Wait(1) | exten => s,1,Wait(1) |
Revision as of 17:16, 7 December 2006
Dynamic Members
Logs a dynamic member in or out of the queue.
; Adds a dynamic agent/member to a Queue ; arg1 = trunk number, arg2 = number [macro-agent-add] exten => s,1,Wait(1) exten => s,2,Macro(user-callerid) exten => s,3,Set(CALLBACKNUM=${CALLERID(number)}) exten => s,4,GotoIf($["${CALLBACKNUM}" = ""]?111)) ; if no number, jump to fail. exten => s,5,AddQueueMember(${ARG1}|Local/${CALLBACKNUM}@from-internal/n) ; using chan_local allows us to have agents over trunks exten => s,6,QueueLog(${UNIQUEID},${ARG1},${CALLBACKNUM},AGENTLOGIN,0) exten => s,7,Set(DB(agentlogin/q_${ARG1}_a_${CALLBACKNUM})=${EPOCH}) exten => s,8,UserEvent(Agentlogin|Agent: ${CALLBACKNUM}) exten => s,9,Wait(1) exten => s,10,Playback(agent-loginok) exten => s,11,Hangup() exten => s,106,RemoveQueueMember(${ARG1}|Local/${CALLBACKNUM}@from-internal/n) exten => s,107,UserEvent(RefreshQueue) exten => s,108,Set(ORGEPOCH=${DB(agentlogin/q_${ARG1}_a_${CALLBACKNUM})}) exten => s,109,Set(LGNT=$[${EPOCH} - ${ORGEPOCH}]) exten => s,110,GotoIf($["${LGNT}" = "0"]?116:111) exten => s,111,QueueLog(${UNIQUEID},${ARG1},${CALLBACKNUM},AGENTLOGOFF,${LGNT}) exten => s,112,DBdel(agentlogin/q_${ARG1}_a_${CALLBACKNUM}) exten => s,113,Wait(1) exten => s,114,Playback(agent-loggedoff) exten => s,115,Hangup() exten => s,116,Playback(sorry-cant-let-you-do-that) exten => s,117,Hangup()
; Removes a dynamic agent/member from a Queue ; arg1 = trunk number, arg2 = number [macro-agent-del] exten => s,1,Wait(1) exten => s,2,Playback(sorry-cant-let-you-do-that) exten => s,3,Hangup()
Categories: VoIP | Linux | Mac OS X