CHANSPY customization

What is the easiest way to setup CHANSPY to monitor specific extensions?

We got it to work so that a user could dial 555, be asked for a password and then enter the extension number by making these modifications:

In extensions_custom.conf:

[app-chanspy-custom]
exten => 5555,1,Answer
exten => 5555,2,Wait(1)
exten => 5555,3,Goto(custom-app-enh-chanspy,s,1)
exten => 5555,4,Hangup

[custom-app-enh-chanspy]
exten => s,1,BackGround(please-enter-the)
exten => s,n,Read(SPYNUM|extension)
exten => s,n,ChanSpy(SIP/${SPYNUM}|wv4)

end of extensions_custom.conf amendments

in extensions_override_freepbx.conf:

[app-chanspy]
include => app-chanspy-custom

exten => 555,1,Authenticate(1234)
exten => 555,2,Read(SPYNUM,extension)
exten => 555,3,ChanSpy(SIP/${SPYNUM},wq)

; end of [app-chanspy]

end of extensions_custom.conf amendments

We haven’t been able to limit it to only allow spying on or by specific extensions

Regards,
Dave.

Thanks Dave!

I found this info about SPYGROUP, but can’t make it work.

; Eavesdrop on an agent:
exten => 123,1,ChanSpy(Agent)
exten => 123,n,Hangup()

; Example using g:
; for calls to 0, set SPYGROUP 10005:
exten => _0.,1,Set(SPYGROUP=10005)
;…
; Listen to channels in SPYGROUP 10005:
exten => 123,1,ChanSpy(,g(10005))
exten => 123,n,Hangup()

I was trying to make out what you were trying to do above… why could I just not add the code below to the extensions_custom.conf and just use 5555 for the extension oriented version…

[app-chanspy-custom]
exten => 5555,1,Authenticate(1234)
exten => 5555,2,Read(SPYNUM,extension)
exten => 5555,3,ChanSpy(SIP/${SPYNUM},wq)