[asterisk-users] Cisco 7940 log on/off

James FitzGibbon james.fitzgibbon at gmail.com
Tue Jul 17 12:45:13 CDT 2007


On 7/16/07, Adrian Marsh <Adrian.Marsh at ubiquisys.com> wrote:

> Anyone know if theres a way to share a Cisco 7940 between hot-desk
> users?
>
> My phones get their setup via SIP .cnf files, that load at boot via
> tftp, so I'm assuming the configs a failry static. However if I want a
> phone to be hot-desked, I could have different users sitting there.  Is
> there any concept of "logging on" in these environments?


You can set up single-person queues that you can use like extensions.  The
deskphone itself would still have to be addressable as "SIP/something", and
the outbound context will be the same regardless of who is logged in (unless
you want to get fancy and store who is logged in in ASTdb then fork to the
proper outbound context using Goto in the shared context for the peer), but
it works.

Here's my queues.conf for a single-person queue:

[queuename]
strategy=rrmemory
servicelevel=60
timeout=20
retry=5
wrapuptime=0
maxlen=1
announce-frequency=0
announce-holdtime=no
joinempty=strict
leavewhenempty=strict
reportholdtime=no
monitor-format=wav
ringinuse=no

And the dialplan to enqueue:

--START--
[somecontext]
exten => ###,n,Macro(singlequeue,queuename,###)

[macro-singlequeue]
; No-op to give us a 1 priority
exten   => s,1,NoOp

; if DIAL_ANNOUNCE is set, play the "please hold on while I..." msg
exten   => s,n,GotoIf($["${DIAL_ANNOUNCE}" != "1"]?check_clid_set)
exten   => s,n,Playback(transfer)

; Set CLID Name if specified
exten   => s,n(check_clid_set),GotoIf(${ISNULL(${CLID_NAME})}?enqueue)
exten   => s,n,Set(CALLERID(name)=${CLID_NAME})

; Enqueue the caller
exten   => s,n(enqueue),Queue(${ARG1}|nrtW|||20)

; Jump based on status - TIMEOUT | FULL | JOINEMPTY | LEAVEEMPTY |
JOINUNAVAIL |
 LEAVEUNAVAIL
exten   => s,n(branch),Goto(s-${QUEUESTATUS},1)

; If unavailable, send to voicemail w/ unavail announce
exten   => s-TIMEOUT,1(vmu),Voicemail(${ARG2}|uj)
exten   => s-TIMEOUT,n,Hangup

exten   => s-TIMEOUT,vmu+101,Playback(vm-theperson)
exten   => s-TIMEOUT,n,SayDigits(${ARG2})
exten   => s-TIMEOUT,n,Playback(vm-isunavail)
exten   => s-TIMEOUT,n,Hangup

; If busy, send to voicemail w/ busy announce
exten   => s-FULL,1(vmb),Voicemail(${ARG2}|bj)
exten   => s-FULL,n,Hangup

exten   => s-FULL,vmb+101,Playback(vm-theperson)
exten   => s-FULL,n,SayDigits(${ARG2})
exten   => s-FULL,n,Playback(vm-isunavail)
exten   => s-FULL,n,Hangup

; Treat the empty, unavail as full
exten   => s-JOINEMPTY,1,Goto(s-FULL,1)
exten   => s-LEAVEEMPTY,1,Goto(s-FULL,1)
exten   => s-JOINUNAVAIL,1,Goto(s-FULL,1)
exten   => s-LEAVEUNAVAIL,1,Goto(s-FULL,1)

; Treat anything else as timeout
exten   => _s-.,1,Goto(s-NOANSWER,1)

; if people star out of voicemail, send them to the top-level admin IVR
exten   => a,1,GotoIf(${ISNULL(${IVR_CONTEXT})}?setivrcontext:gotoivr)
exten   => a,n(setivrcontext),Set(IVR_CONTEXT=ivr-admin)
exten   => a,n(gotoivr),Goto(${IVR_CONTEXT},s,1)

; If they hit 0 from VoiceMail to dial the operator,
; after 20 seconds they go back to the top of the named context
exten   => o,1,Macro(operator)

exten   => h,1,Macro(loghangupcause)
---END---

There's some extra cruft in there you could easily cut out to suit your
environment.  Using that macro in the same way I would normally use "Dial",
the experience for both the caller and agent is pretty much the same.   You
need to have 1.4.7 so that if the agent hits "ignore" or "reject" the call
immediately exits Queue() - there was a bug surrounding the 'n' option in
1.4.6 and earlier.  If you don't have that version, then hitting ignore or
reject will send the call back to the phone after 'retry' seconds until the
timeout runs out (in my case 20 seconds).

All you then need is some dialplan sugar to invoke AddQueueMember and
RemoveQueueMember in response to logon and logoff actions by the agent.  If
you're not worried about authenticating the users, you can just do something
like:

exten =>
_7000XXX,1,AddQueueMember(singlequeue_${EXTEN:4},${CUT(CHANNEL,,1)},,,${CUT(CHANNEL,,1)})
exten =>
_7001XXX,1,RemoveQueueMember(singlequeue_${EXTEN:4},${CUT(CHANNEL,,1)},,,${CUT(CHANNEL,,1)})

Then agent 123 can log in by dialing extension 7000123 and log off by
dialing extension 7001123.  If you attempt to enqueue the caller to the
queue when there's nobody logged in, then you'll immediately get kicked to
your dialplan with ${QUEUESTATUS} set appropriately.  This may or may not be
what you want, because it means that callers will go directly to voicemail
if the person they're calling isn't logged in.

HTH

-- 
j.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070717/d49b1a87/attachment.htm 


More information about the asterisk-users mailing list