Apr
22
2009






extensions.conf – agent logoff example

[general]

static=yes
writeprotect=no

[bogon-calls]

exten => _x.,1,Congestion

[macro-stdexten]
;
;for dialing internal extensions

exten => s,1,Set(dynext=${DB(dynext/${ARG1})})
exten => s,n,NoOp(${dynext})
exten => s,n,NoOp(${LEN(${dynext})})
exten => s,n,GotoIf($[“${LEN(${dynext})}” = “7”]?s,100)
exten => s,n,GotoIf($[“${LEN(${dynext})}” = “10”]?s,100)
exten => s,n,GotoIf($[“${LEN(${dynext})}” = “11”]?s,100)
exten => s,n,GotoIf($[“${LEN(${dynext})}” = “6”]?s,200) ; Calls 6-digit Extension
exten => s,n,GotoIf($[“${LEN(${dynext})}” = “0”]?s,300) ; Calls 6-digit Extension
exten => s,n(dial),Dial(SIP/${dynext},20,twW) ; Ring the interface, 20 seconds maximum
exten => s,n,Goto(s-${DIALSTATUS},1) ; Jump based on status
exten => s,100,Dial(ZAP/g1/${dynext},20,twW) ; Ring the interface, 20 seconds maximum
exten => s,101,Goto(s-${DIALSTATUS},1) ; Jump based on status
exten => s,200,Goto(from-sip,${dynext},1); Calls 6-digit Extension
exten => s,300,Set(dynext=${ARG1})
exten => s,301,Goto(dial)

exten => s-BUSY,1,Voicemail(b${ARG1}) ; If busy, send to voicemail w/ busy announce
exten => s-BUSY,2,Hangup
exten => s-NOANSWER,1,Voicemail(u${ARG1}) ; If unavailable, send to voicemail
exten => s-NOANSWER,2,Hangup
exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer

[from-sip]

include => test
include => from-internal

[test]

exten => 1234,1,agi(matts-test.agi)
exten => 1234,2,wait(2)
;exten => 1234,n,voicemail(8888)
exten => 1234,n,hangup

[from-internal]

;Standard Internal Extensions

exten => _888X,1,Macro(stdexten,${EXTEN},sip/${EXTEN})
exten => _888X,2,Hangup

;Logon
exten => 1000,1,AgentcallbackLogin(${CALLERID(num)}||${CALLERID(num)}@savelono-queue-out)
exten => 1000,n,hangup

;Logoff – best alternative I’ve found so far
;could be better with additional logic

exten => 1001,1,System(/usr/sbin/asterisk -rx “agent logoff Agent/${CALLERID(NUM)}”)
exten => 1001,n,RemoveQueueMember(savelono-support|Agent/${CALLERID(NUM)})
exten => 1001,n,Playback(agent-loggedoff)
exten => 1001,n,Playback(auth-thankyou)
exten => 1001,n,Hangup

;Logoff this way works but is not very intuitive because you
;have to hit the # key when prompted for a dial back extension
;it really doesn’t make sense to endusers
;
exten => 1002,1,AgentcallbackLogin(${CALLERID(num)}||)
exten => 1002,n,hangup

[savelono-queue-out]

include => from-internal



1 Comment »

RSS feed for comments on this post. TrackBack URL

Leave a comment