Audio Streaming - Line Snoop

Audio Streaming - Line Snoop


Download the evaluation version of Xtend IVR and install the telephony application in your system. Run the sample script from the Script Editor. Click here to refer the code.

	
if ActivePorts() <= 1
	MsgBox("You need multi-port license to run this script")
	return
endif

:MAIN
	if $deviceid == 1
		
		snoop()
	else
		
		service()
	endif
	goto MAIN




	
:MAIN
	answer 1
	speak "run any service here you want to snoop"
	hangup
	goto MAIN
	
:ONHANGUP
	hangup
	goto MAIN
	
:ONSYSTEMERROR
	log $error
	hangup
	goto MAIN
	


	
:MAIN
	answer 1
	speak "Please enter the channel number."
	$device = accept("",2,2)
	if $device = "" then goto GOODBYE
	if $device > 0 and $device < ActivePorts() and $device <> $deviceid
		$var = format("$device%d",$deviceid)
		if atomicget(1,$var) = 0
			speak "No active calls in this channel"
			hangup
			goto MAIN
		endif
		SoftListen($device,0)
		while true
			sleepevent
		endwhile
		goto MAIN
	else
		speak "The channel number you have entered is invalid."
		hangup
		goto MAIN
	endif
	
:GOODBYE
	speak "good bye."
	hangup
	goto MAIN
	
:ONHANGUP
	hangup
	goto MAIN
	
:ONSYSTEMERROR
	log $error
	hangup
	goto MAIN