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 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.7.0.tar.gz (26.8 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.7.0-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sipmessage-0.7.0.tar.gz
Algorithm Hash digest
SHA256 c3af07e8785b35b4f9dde3be4ac5a86a834878a68013059b5cf0ee7f759862d9
MD5 045d97551aa3f58e2f8f928d99bf9cfe
BLAKE2b-256 b5b1669ccbf5fdf6ed019a7d83f622f68a5f841576ce9b9ffdffe4a416f20db8

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for sipmessage-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3264b6452ef0e769dfed19010651a40d4b628b1b2c7464cb75f56f703f4ae098
MD5 d97c74a4f3282b99a97bd2f2eb24e472
BLAKE2b-256 6876095b342f7aba1602bbf532d4a35ce87d2b81f126586c2a7878db57a35ae5

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