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 §

NameLicensePython 2.7Python 3.6RFC 3261 compliantNotes
TwistedMITYesYesNoConforms to RFC 2543, not RFC 3261. Adding RFC 3261 support has not progressed for 6 years.
rtclite (39 peers)LGPLYesNoYesDescribed 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.
dionaeaGPL v2Yes?Maybe?Maybe?Appears to be a trap for malware. Does not look suitable.
SippyBSD 2-clauseYesNoYesAppears rather heavyweight.
pysippGPL v2YesYesMaybe?Appears to be an interface to a separate tool, SIPp. Does not look suitable.
PJSUAGPL v2???Low-level C Python extension. Appears rather heavyweight.
dpktBSD 3-clauseYesAlmost (Python 3.5)No?Looks incomplete, SIP support last touched 2 years ago.
SIP Simple ClientGPL v3YesNo?YesAppears 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.

See all notes.

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