Sam Hooke

Lightweight Python SIP library

Situation §

Need to create SIP requests and parse SIP responses as defined in RFC 3261. Do not need a “heavyweight” solution that runs a SIP server/proxy. Needs to support Python 2.7 and 3.6.

Existing Solutions §

Name License Python 2.7 Python 3.6 RFC 3261 compliant Notes
Twisted MIT Yes Yes No Conforms to RFC 2543, not RFC 3261. Adding RFC 3261 support has not progressed for 6 years.
rtclite (39 peers) LGPL Yes No Yes Described as being a lightweight reference implementation. Consists of four files, including two other RFCs it imports and a common file. However contains many TODOs in the source.
dionaea GPL v2 Yes? Maybe? Maybe? Appears to be a trap for malware. Does not look suitable.
Sippy BSD 2-clause Yes No Yes Appears rather heavyweight.
pysipp GPL v2 Yes Yes Maybe? Appears to be an interface to a separate tool, SIPp. Does not look suitable.
PJSUA GPL v2 ? ? ? Low-level C Python extension. Appears rather heavyweight.
dpkt BSD 3-clause Yes Almost (Python 3.5) No? Looks incomplete, SIP support last touched 2 years ago.
SIP Simple Client GPL v3 Yes No? Yes Appears rather heavyweight.

Interesting Sidenote §

SIPit is a week long event where people bring their SIP implementations to make sure they work together. It runs every 18 to 24 months.

Update 2018-08-15 §

From an HN thread found a report on implementing SIP in Python.

Update 2022-04-14 §

As a long overdue follow-up: back in 2018-04-20, solved the need by writing a light-weight SIP client compatible with Python 2.7 and Python 3.6, which implemented minimal support for only the necessary commands: e.g. sending INVITE, ACK, SUBSCRIBE, BYE; receiving and parsing NOTIFY. Since this just consists of UTF-8 strings sent/received over a socket, it was fairly simple to implement.

Four years later, it looks like there are some new options, such as pyVOIP. However, the situation regarding Twisted’s support for RFC 3261 has not changed.

These are rough notes from whatever I was working on, interested in or thinking about at the time. They vary greatly in quality and length, but prove useful to me, and hopefully to you too!

← Previous: Removing unused COM ports from Windows
Next: Make temporary network changes permanent under CentOS 7 →