Skip to main content

Pure python parsing of SIP messages and headers

Project description

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.3.tar.gz (21.4 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.3-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sipmessage-0.6.3.tar.gz
  • Upload date:
  • Size: 21.4 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.3.tar.gz
Algorithm Hash digest
SHA256 9ab69bafeb7eb1d7de3fdc068dbb3b344efa193ec7a45e91de8453003a8d4347
MD5 12e197223a5ba5c18b306a04d2d74e72
BLAKE2b-256 df0f6713e5430f25dce81dac348df6ab5abe6944c217d32ae7a25c8f228027a5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sipmessage-0.6.3-py3-none-any.whl
  • Upload date:
  • Size: 15.8 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0794af372360e1ca916ef6a3784b69846db8250d5dbb175296aaf81a0a5efc9a
MD5 61c7e404b1e6d16b0d80c5a6f5295525
BLAKE2b-256 453f7a3c9ef2381746e50eddec77ae0e596bc7bc45a773505e14da37c6d99dc1

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