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:
- enter specified digits and start calling
- end current call
- enter specified digits (for using as DTMF during call)
- clear dial edit box
- check registration (0/1) state
- check if any call is active (0/1)
- 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
- check if streaming (transmitter) is active (0/1)
- 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)
- check if script was interrupted by the user, intended to be called periodically in loop
- clear output window (the window where print writes to)
- display standard modal Win32 message
-- 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");
- 2015.10.24. Initial release: Version 1.0
Script_1_0.zip (binary only).
Issues: before exiting application or unloading plugin from using tSIP settings script execution has to stop, otherwise application cannot be closed. Make sure that running script handles manual interruption (i.e. if it contains long or infinite loop check for CheckBreak() function result inside it - see example in help menu).
- 2015.10.26. Version 1.0.1
- 2016.01.24. Version 1.0.2
Script_1_0_2.zip, extended interface, make sure appropriate tSIP version is used
- added ClearDial()
- added PagingTx()
- added CheckPagingTxState()
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