tSIP softphone: record pause/resume/status

tSIP 0.1.72.2 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")
	return
end
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"
end

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

Back to howto list


 "Cookie monsters": 7701723    Parse time: 0.001 s