Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ChannelSpy

Status
Not open for further replies.

UCxNewbie

Technical User
Dec 22, 2017
4
US
Hello.
Our Company is checking out the UCx. We currently have a CS1000e. Is there a way to exclude extensions from being Channel Spied on?
 
I don't believe you can exclude extensions at this time. If it's important to you, try suggesting this capability as an enhancement to your E-MetroTel representative.
 
Yes there is a way
What is your extension range and what extension to be excluded?
 
Thank you both.
The extension range is 7401..7420 or so.
 
I was giving you the range of the extensions that I do not want to spy on.
We have several hundred DIDs! Like 5100 - 5999, 7200 - 7499, 8000 - 8599!
 
A version of this works on my 4.0 UCX-50e. This should match your dial plan

I’m not sure if it was needed but I disabled ChanSpy and ChanSpy Direct in feature codes under PBX Configuration
Save and Apply


next goto Tools select configuration file editor
filter on ext
select extension_custom.conf
go to the bottom and add

Code:
[ext-local-custom]

exten => _*222x.#,1,Macro(user-callerid,)
exten => _*222x.#,n,Answer
exten => _*222x.#,n,NoCDR
exten => _*222x.#,n,Wait(1)
exten => _*22274[3-9]x,n,ChanSpy(UCX/${EXTEN:4},q)
exten => _*2227[23]xx,n,ChanSpy(UCX/${EXTEN:4},q)
exten => _*222[58]xxx,n,ChanSpy(UCX/${EXTEN:4},q)
exten => _*222x.#,n,Hangup

select Save then select Reload Configuration

explanation:
*22274[3-9]x, will dial only extension in the range of 7430 thru 7499
*2227[23]xx, will dial only extension in the range of 7200 thru 7299 and 7300 thru 7399
*222[58]xxx, will dial only extension in the range of 5000 thru 5999 and 8000 thru 8999
 
Hi theislandtech!

Thank you SO much for that post. I work at the same company as UCxNewbie.

We tried your script, and it didn't work with our version of UCx directly, but the idea of turning off the feature code, then writing our own into the extension_custom.conf file was pure genius. It got me looking into the scripting language or whatever you'd call that.

To help anyone else looking for a similar solution, here's what we settled on:

Code:
[ext-local-custom]
exten => 779,1,Macro(user-callerid,)
exten => 779,n,Authenticate(1234)
exten => 779,n,Read(SPYNUM,agent-newlocation)
exten => 779,n,Set(CH_TYPE=${DB(DEVICE/${SPYNUM}/dial)})
exten => 779,n,GotoIf($["${SPYNUM:0:2}" = "73"]?hangup)
exten => 779,n,GotoIf($["${SPYNUM:0:2}" = "74"]?hangup:spy)
exten => 779,n(hangup),Playback(custom/ChanSpyDisallowed)
exten => 779,n,Hangup()
exten => 779,n(spy),ChanSpy(${CH_TYPE})

I only put the "73" matching line in there to prove we could use more than one range if we wanted. I'll probably just keep the "74" line in production.

I couldn't find a good way to do a expression match inside a goto condition. If anyone knows how, I'd appreciate a reply. After digging some, I finally found how to at least do a substring so I could compare on the first two digits. Ideally, I'd be able to do something along the lines of "$SPYNUM like 74[0-5]x", but what I've got will work for us.

 
Good fix. Did anyone look at using Custom Context to do the same thing. I did not test in Lab system but I have used Custom Contexts in the past to disallow features on Extensions. Just a thought. It may be a little easier than writing code.

EmetroTel Stocking Distributer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top