tSIP softphone: record pause/resume/status

tSIP adds two new button types:

and new script event, "on recording state", allowing to present current state (idle/active/pause) to the user. Following example script uses caption of the button #1 to show this state as text:

local targetButtonId = 1

local execSourceType = GetExecSourceType()
if execSourceType ~= 14 then
	print("Unhandled script source!\n")
local recorderId = GetExecSourceId()

local recorderState = GetRecorderState(recorderId)
local recorderStateStr = "???"
if recorderState == 0 then
	recorderStateStr = "idle"
elseif recorderState == 1 then
	recorderStateStr = "active"
elseif recorderState == 2 then
	recorderStateStr = "paused"

local str = string.format("REC: %s", recorderStateStr)
SetButtonCaption(targetButtonId, str) 

Back to howto list

 "Cookie monsters": 6028133    Parse time: 0.001 s