SARK V4.0.0 doorsnooper

From sailpbx
Jump to: navigation, search

Up a level

Introduction

We often get requests to repeat what is going on in a conversation at some other location. SARK has feature codes for Spy (*68*) and Whisper (*67*) but sometimes you want to create the snoop automatically. A good example is door entry; often a customer wants the door entry conversation between the caller and callee to be broadcast over an overhead speaker or at some other phone. This is the code we use to do it, it requires a little custom app to be coded in SARK...

Create an app and call it dialsnoop with a span of internal. Below is the annotated app - you can just cut and paste it then change the extension numbers and conference room number to suit your site.

; overhead repeat app
; 4444 is an extension that the doorphone will dial when the key is pressed. 
; 401 is the overhead speaker 
; 403 is the extension that will be called internally by the doorphone. 
; you can freely change these to suit your site

exten=>4444,1,Originate(SIP/401,exten,dialsnoop) 
exten=>4444,n,Dial(SIP/403,60,G(dialsnoop,s,101))   
;
; If you want you can have the door dial a ring group like this:-
;    exten=>4444,n,Dial(SIP/403&SIP/404&SIP/405,20,G(dialsnoop,s,101))  

; Next we will fetch the overhead speaker into conference room 301 in listen mode - 
: you can change the conf room to whatever you like 
; but change it for all 3 MeetMe commands in the app

exten=>s,1,MeetMe(301,1mqx)      
        
: This is where the caller at the door will arrive 

exten=>s,101,MeetMe(301,Fqx) 

; this is where whoever picks the call up will arrive so connect them to the 
; conf room as Master so when they hang up all will hang up

exten=>s,102,MeetMe(301,AFqx) 

; end of the app   

Without the annotation the app is only 5 lines of code. Basically what happens is that when a caller presses the door entry button, the system will invite the overhead repeater into a conference room then ring one or more phones and wait for an answer. Once the call is answered, the caller, the callee and the overhead repeater all end up in the same conference room. The caller and callee are unaware of this; to them it just sounds like a normal call. However, the overhead will monitor the conversation so that others can hear, When the callee hangs up, all three calls will end (because the callee is the master, or tagged, user in the conference). The overhead repeater joins the conference in listen-only mode and it must be set to auto-answer so that when we send it the invite it will join the call automatically.