Monday, 2 July 2018

Asterisk/FreePBX/Elastix add Listen/Whisper/Barge facilities to your PABX

If you have PABX server like Asterisk / Free PBX / Elastix and want to  feature to listen / whisper / barge to other calls.

ChanSpy can give you ability to achieve this feature.

So here’s what you can do. If you’re using this as it is, make sure that there are no feature codes using *331 & *332 & *333.

Add below code to extensions_custom.conf. Reload asterisk and you should be able to listen on extension 1001, simply dial *3311001.

[ext-local-custom]

;listen
exten => _*331x.#,1,Macro(user-callerid,)
exten => _*331x.#,n,Answer
exten => _*331x.#,n,NoCDR
exten => _*331x.#,n,Wait(1)
exten => _*331x.#,n,ChanSpy(sip/${EXTEN:4},q)
exten => _*331x.#,n,Hangup

;whisper
exten => _*332x.#,1,Macro(user-callerid,)
exten => _*332x.#,n,Answer
exten => _*332x.#,n,NoCDR
exten => _*332x.#,n,Wait(1)
exten => _*332x.#,n,ChanSpy(sip/${EXTEN:4},qw)
exten => _*332x.#,n,Hangup

;barge
exten => _*333x.#,1,Macro(user-callerid,)
exten => _*333x.#,n,Answer
exten => _*333x.#,n,NoCDR
exten => _*333x.#,n,Wait(1)
exten => _*333x.#,n,ChanSpy(SIP/${EXTEN:4},qB)
exten => _*333x.#,n,Hangup



Now, say there are some extensions like managers, CEO, CIO that you don’t want to be listened on, there are many ways to do it. Easy way to do this, add following code the above set.

Here, no one should be able to listen/whisper/barge on extension 1007’s calls. What this code does is if someone tries to do be naughty, it will simply hangup the call.

;blockaccess
exten => _*3311007,1,Macro(user-callerid,)
exten => _*3311007,n,Hangup
exten => _*3321007,1,Macro(user-callerid,)
exten => _*3321007,n,Hangup
exten => _*3331007,1,Macro(user-callerid,)
exten => _*3331007,n,Hangup


If you are using PJSIP then
change

,n,ChanSpy(sip/${EXTEN:4},qw) 
to
,n,ChanSpy(pjsip/${EXTEN:4},qw)


Also you may want to try with password

[from-internal-custom]
exten => 5555,1,Macro(user-callerid)
exten => 5555,2,Authenticate(YOUR PIN like 12345)
exten => 5555,3,Read(SPYNUM,agent-newlocation)
exten => 5555,4,ChanSpy(SIP/${SPYNUM))

No comments:

ISM Cyber Security Terms

ISM Cyber Security Terms