Skip to main content

Pure python parsing of SIP messages and headers

Project description

sipmessage License Version Tests Coverage Documentation

The sipmessage project provides a set of Python helpers and structures for parsing and serialising SIP messages. It can be used to manipulate either either entire requests and responses or individual header values.

To learn more about sipmessage please read the documentation.

Example

from sipmessage import Message, Parameters, Request, Via

request = Message.parse(
    b"REGISTER sip:atlanta.com SIP/2.0\r\n"
    b"Via: SIP/2.0/WSS mYn6S3lQaKjo.invalid;branch=z9hG4bKgD24yaj\r\n"
    b"Max-Forwards: 70\r\n"
    b"To: <sip:alice@atlanta.com>\r\n"
    b"From: <sip:alice@atlanta.com>;tag=69piINLbAb\r\n"
    b"Call-ID: t87Br1RHAoBz2FsrKKk6hV\r\n"
    b"CSeq: 1 REGISTER\r\n"
    b"Contact: <sip:Mk9sZp5Z@mYn6S3lQaKjo.invalid;transport=ws>;expires=300\r\n"
    b"User-Agent: Tester/0.1.0\r\n"
    b"Content-Length: 0\r\n\r\n"
)
assert isinstance(request, Request)
assert request.via == [
    Via(
        transport="WSS",
        host="mYn6S3lQaKjo.invalid",
        port=None,
        parameters=Parameters(branch="z9hG4bKgD24yaj"),
    )
]

License

sipmessage is released under the BSD license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sipmessage-0.6.4.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sipmessage-0.6.4-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file sipmessage-0.6.4.tar.gz.

File metadata

  • Download URL: sipmessage-0.6.4.tar.gz
  • Upload date:
  • Size: 25.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for sipmessage-0.6.4.tar.gz
Algorithm Hash digest
SHA256 2915e9c92449e5d0e6ba30d605849b4dd82fac93bf0049b437f534111a642f1d
MD5 ff6564482bfec54dcac042cbca7e77c1
BLAKE2b-256 253b7ca9c625fe5d55eac8592fa8a08cd9a8bb06d8d97660995329352de6f1b5

See more details on using hashes here.

File details

Details for the file sipmessage-0.6.4-py3-none-any.whl.

File metadata

  • Download URL: sipmessage-0.6.4-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for sipmessage-0.6.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0ca0b9b63f1c84336cbdac98c30a7d0dc31cfdc052ccd44941277d3836ac96eb
MD5 3118552adb97558621508c98f7e1b53a
BLAKE2b-256 1cde980e8cfa52c91ebc972516c36af3ffe68d3f6dcea990e660db9545315bb9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page