Lua scripting plugin for tSIP

Note: Lua scripting was also added as built-in softphone function (scripts running when button is pressed or on specified events) making this plugin partially obsolete. Despite using same script language script plugin and built-in scripting are independent implementations with different function sets. Currently built-in scripting has richer functionality and in general is easier to maintain (i.e. add new function). This plugin may be still preferred for long-running tasks like scripts calling multiple numbers, fuzzing, etc.

Apart from using tSIP as my basic phone (with EX-03 USB hardware), connected to local PABX at workplace (thus eating my own dog food whenever I have opportunity) this softphone is also one of my basic test tools. It proved itself with BLF testing (multiple instances with multiple subscriptions each running same time), echo testing ("stereo" call recording and playing test signal from wave file) and off-site testing (thanks to being portable and lightweight - multiple preconfigured copies with bat file launching them can be sent to client in single mail).

Lua scripting plugin is intended to fill the gap between SIPp (powerful but relatively complex, sometimes not effective for simple one-time tests) and pjsua with commands piped from file (not too elegant and probably not viable for randomized tests with fuzzing purposes).

Lua is extended with following commands:

Call
enter specified digits and start calling
Hangup
end current call
Dial
enter specified digits (for using as DTMF during call)
ClearDial
clear dial edit box
CheckRegistered
check registration (0/1) state
CheckCallState
check if any call is active (0/1)
CheckCallDisplay
get displayed number ("CLIP" or dialed)
PagingTx(destination, wave_file, codec)
start streaming to destination; if wave_file is empty default audio source is used
CheckPagingTxState
check if streaming (transmitter) is active (0/1)
Sleep
pause execution for specified time in miliseconds; may be interrupted by the user with Break button
Beep(freq, time)
equivalent for WinAPI Beep() (PC speaker)
CheckBreak
check if script was interrupted by the user, intended to be called periodically in loop
ClearOutput
clear output window (the window where print writes to)
ShowMessage
display standard modal Win32 message

Example script:

  -- calling and sending DTMFs
  print(string.format("Running %s on %s\n", _VERSION, os.date()))
  Call("2000")
  Sleep(5000)
  -- hoping that 2nd party would answer the call in meantime
  Dial("012345678*#")
  -- pause to let digits get out of the queues safely
  Sleep(3000)
  Hangup()
  print("Done\n");

Lua scripting plugin for tSIP softphone

Installation: unzip dll into tSIP "phone" subdirectory, enable plugin in tSIP settings ("Phones" card). If enabled plugin/editor window will be visible all the time.

Back to tSIP softphone


 "Cookie monsters": 3265209    Parse time: 0.002 s