TCP server plugin for tSIP

TCP server plugin listens for TCP connections and allows to send Lua scripts to tSIP (as commands) and passes text messages back from Lua scripts to TCP clients. It is expected to work with plaintext and newline-terminated ("\n") messages.

As a TCP keepalive plugin sends just newline to each client connection that was inactive in the last 60 seconds.

Installation

Usage

Example session (Lua scripts as commands, JSON values as replies/events):

local util = require("scripts.server_util"); util.report_call_state("INITIAL_CALL_REPORT")
{"type":"call_state","state_text":"CLOSED","state":0,"tag":"INITIAL_CALL_REPORT","call_peer":"","call_incoming":0}
Call("sip:music@iptel.org")
{"type":"call_state","tag":"","state_text":"OUTGOING","call_incoming":0,"call_peer":"sip:music@iptel.org","state":2}
{"type":"call_state","tag":"","state_text":"ESTABLISHED","call_incoming":0,"call_peer":"sip:music@iptel.org","state":6}
Hangup()
{"state_text":"CLOSED","state":0,"type":"call_state","call_peer":"","tag":"","call_incoming":0}

Notes

Source and binary

https://github.com/tomek-o/tSIP-plugin-TcpServer

Back to tSIP softphone


 "Cookie monsters": 7700328    Parse time: 0.001 s