sipmessage 0.6.2__tar.gz → 0.6.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sipmessage-0.6.4/PKG-INFO +99 -0
- sipmessage-0.6.4/README.rst +67 -0
- sipmessage-0.6.4/docs/_static/sipmessage.svg +223 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/docs/conf.py +5 -1
- sipmessage-0.6.4/docs/index.rst +63 -0
- sipmessage-0.6.4/docs/license.rst +4 -0
- sipmessage-0.6.4/docs/requirements.txt +2 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/pyproject.toml +1 -2
- {sipmessage-0.6.2 → sipmessage-0.6.4}/src/sipmessage/message.py +111 -20
- sipmessage-0.6.4/src/sipmessage.egg-info/PKG-INFO +99 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/src/sipmessage.egg-info/SOURCES.txt +3 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/tests/test_message.py +71 -0
- sipmessage-0.6.2/PKG-INFO +0 -60
- sipmessage-0.6.2/README.rst +0 -27
- sipmessage-0.6.2/docs/index.rst +0 -30
- sipmessage-0.6.2/src/sipmessage.egg-info/PKG-INFO +0 -60
- {sipmessage-0.6.2 → sipmessage-0.6.4}/LICENSE +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/MANIFEST.in +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/Makefile +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/docs/Makefile +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/docs/headers.rst +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/docs/messages.rst +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/setup.cfg +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/src/sipmessage/__init__.py +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/src/sipmessage/address.py +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/src/sipmessage/auth.py +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/src/sipmessage/cseq.py +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/src/sipmessage/grammar.py +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/src/sipmessage/parameters.py +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/src/sipmessage/py.typed +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/src/sipmessage/uri.py +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/src/sipmessage/utils.py +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/src/sipmessage/via.py +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/src/sipmessage.egg-info/dependency_links.txt +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/src/sipmessage.egg-info/requires.txt +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/src/sipmessage.egg-info/top_level.txt +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/tests/__init__.py +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/tests/test_address.py +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/tests/test_auth.py +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/tests/test_cseq.py +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/tests/test_parameters.py +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/tests/test_public_api.py +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/tests/test_uri.py +0 -0
- {sipmessage-0.6.2 → sipmessage-0.6.4}/tests/test_via.py +0 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sipmessage
|
|
3
|
+
Version: 0.6.4
|
|
4
|
+
Summary: Pure python parsing of SIP messages and headers
|
|
5
|
+
Author-email: Spacinov Engineering <opensource@spacinov.com>
|
|
6
|
+
License-Expression: BSD-2-Clause
|
|
7
|
+
Project-URL: Documentation, https://sipmessage.readthedocs.io/
|
|
8
|
+
Project-URL: Repository, https://github.com/spacinov/sipmessage
|
|
9
|
+
Project-URL: Issues, https://github.com/spacinov/sipmessage/issues
|
|
10
|
+
Keywords: SIP,RFC3261
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: System Administrators
|
|
14
|
+
Classifier: Intended Audience :: Telecommunications Industry
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Communications :: Telephony
|
|
21
|
+
Classifier: Typing :: Typed
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/x-rst
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: check-manifest; extra == "dev"
|
|
27
|
+
Requires-Dist: coverage; extra == "dev"
|
|
28
|
+
Requires-Dist: mypy; extra == "dev"
|
|
29
|
+
Requires-Dist: pyroma; extra == "dev"
|
|
30
|
+
Requires-Dist: ruff; extra == "dev"
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
|
|
33
|
+
.. image:: docs/_static/sipmessage.svg
|
|
34
|
+
:width: 120px
|
|
35
|
+
:alt: sipmessage
|
|
36
|
+
|
|
37
|
+
.. image:: https://img.shields.io/pypi/l/sipmessage.svg
|
|
38
|
+
:target: https://pypi.python.org/pypi/sipmessage
|
|
39
|
+
:alt: License
|
|
40
|
+
|
|
41
|
+
.. image:: https://img.shields.io/pypi/v/sipmessage.svg
|
|
42
|
+
:target: https://pypi.python.org/pypi/sipmessage
|
|
43
|
+
:alt: Version
|
|
44
|
+
|
|
45
|
+
.. image:: https://github.com/spacinov/sipmessage/workflows/tests/badge.svg
|
|
46
|
+
:target: https://github.com/spacinov/sipmessage/actions
|
|
47
|
+
:alt: Tests
|
|
48
|
+
|
|
49
|
+
.. image:: https://img.shields.io/codecov/c/github/spacinov/sipmessage.svg
|
|
50
|
+
:target: https://codecov.io/gh/spacinov/sipmessage
|
|
51
|
+
:alt: Coverage
|
|
52
|
+
|
|
53
|
+
.. image:: https://readthedocs.org/projects/sipmessage/badge/?version=latest
|
|
54
|
+
:target: https://sipmessage.readthedocs.io/
|
|
55
|
+
:alt: Documentation
|
|
56
|
+
|
|
57
|
+
The ``sipmessage`` project provides a set of Python helpers and structures
|
|
58
|
+
for parsing and serialising SIP messages. It can be used to manipulate either
|
|
59
|
+
either entire requests and responses or individual header values.
|
|
60
|
+
|
|
61
|
+
To learn more about ``sipmessage`` please `read the documentation`_.
|
|
62
|
+
|
|
63
|
+
.. _read the documentation: https://sipmessage.readthedocs.io/en/stable/
|
|
64
|
+
|
|
65
|
+
Example
|
|
66
|
+
-------
|
|
67
|
+
|
|
68
|
+
.. code:: python
|
|
69
|
+
|
|
70
|
+
from sipmessage import Message, Parameters, Request, Via
|
|
71
|
+
|
|
72
|
+
request = Message.parse(
|
|
73
|
+
b"REGISTER sip:atlanta.com SIP/2.0\r\n"
|
|
74
|
+
b"Via: SIP/2.0/WSS mYn6S3lQaKjo.invalid;branch=z9hG4bKgD24yaj\r\n"
|
|
75
|
+
b"Max-Forwards: 70\r\n"
|
|
76
|
+
b"To: <sip:alice@atlanta.com>\r\n"
|
|
77
|
+
b"From: <sip:alice@atlanta.com>;tag=69piINLbAb\r\n"
|
|
78
|
+
b"Call-ID: t87Br1RHAoBz2FsrKKk6hV\r\n"
|
|
79
|
+
b"CSeq: 1 REGISTER\r\n"
|
|
80
|
+
b"Contact: <sip:Mk9sZp5Z@mYn6S3lQaKjo.invalid;transport=ws>;expires=300\r\n"
|
|
81
|
+
b"User-Agent: Tester/0.1.0\r\n"
|
|
82
|
+
b"Content-Length: 0\r\n\r\n"
|
|
83
|
+
)
|
|
84
|
+
assert isinstance(request, Request)
|
|
85
|
+
assert request.via == [
|
|
86
|
+
Via(
|
|
87
|
+
transport="WSS",
|
|
88
|
+
host="mYn6S3lQaKjo.invalid",
|
|
89
|
+
port=None,
|
|
90
|
+
parameters=Parameters(branch="z9hG4bKgD24yaj"),
|
|
91
|
+
)
|
|
92
|
+
]
|
|
93
|
+
|
|
94
|
+
License
|
|
95
|
+
-------
|
|
96
|
+
|
|
97
|
+
``sipmessage`` is released under the `BSD license`_.
|
|
98
|
+
|
|
99
|
+
.. _BSD license: https://sipmessage.readthedocs.io/en/stable/license.html
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
.. image:: docs/_static/sipmessage.svg
|
|
2
|
+
:width: 120px
|
|
3
|
+
:alt: sipmessage
|
|
4
|
+
|
|
5
|
+
.. image:: https://img.shields.io/pypi/l/sipmessage.svg
|
|
6
|
+
:target: https://pypi.python.org/pypi/sipmessage
|
|
7
|
+
:alt: License
|
|
8
|
+
|
|
9
|
+
.. image:: https://img.shields.io/pypi/v/sipmessage.svg
|
|
10
|
+
:target: https://pypi.python.org/pypi/sipmessage
|
|
11
|
+
:alt: Version
|
|
12
|
+
|
|
13
|
+
.. image:: https://github.com/spacinov/sipmessage/workflows/tests/badge.svg
|
|
14
|
+
:target: https://github.com/spacinov/sipmessage/actions
|
|
15
|
+
:alt: Tests
|
|
16
|
+
|
|
17
|
+
.. image:: https://img.shields.io/codecov/c/github/spacinov/sipmessage.svg
|
|
18
|
+
:target: https://codecov.io/gh/spacinov/sipmessage
|
|
19
|
+
:alt: Coverage
|
|
20
|
+
|
|
21
|
+
.. image:: https://readthedocs.org/projects/sipmessage/badge/?version=latest
|
|
22
|
+
:target: https://sipmessage.readthedocs.io/
|
|
23
|
+
:alt: Documentation
|
|
24
|
+
|
|
25
|
+
The ``sipmessage`` project provides a set of Python helpers and structures
|
|
26
|
+
for parsing and serialising SIP messages. It can be used to manipulate either
|
|
27
|
+
either entire requests and responses or individual header values.
|
|
28
|
+
|
|
29
|
+
To learn more about ``sipmessage`` please `read the documentation`_.
|
|
30
|
+
|
|
31
|
+
.. _read the documentation: https://sipmessage.readthedocs.io/en/stable/
|
|
32
|
+
|
|
33
|
+
Example
|
|
34
|
+
-------
|
|
35
|
+
|
|
36
|
+
.. code:: python
|
|
37
|
+
|
|
38
|
+
from sipmessage import Message, Parameters, Request, Via
|
|
39
|
+
|
|
40
|
+
request = Message.parse(
|
|
41
|
+
b"REGISTER sip:atlanta.com SIP/2.0\r\n"
|
|
42
|
+
b"Via: SIP/2.0/WSS mYn6S3lQaKjo.invalid;branch=z9hG4bKgD24yaj\r\n"
|
|
43
|
+
b"Max-Forwards: 70\r\n"
|
|
44
|
+
b"To: <sip:alice@atlanta.com>\r\n"
|
|
45
|
+
b"From: <sip:alice@atlanta.com>;tag=69piINLbAb\r\n"
|
|
46
|
+
b"Call-ID: t87Br1RHAoBz2FsrKKk6hV\r\n"
|
|
47
|
+
b"CSeq: 1 REGISTER\r\n"
|
|
48
|
+
b"Contact: <sip:Mk9sZp5Z@mYn6S3lQaKjo.invalid;transport=ws>;expires=300\r\n"
|
|
49
|
+
b"User-Agent: Tester/0.1.0\r\n"
|
|
50
|
+
b"Content-Length: 0\r\n\r\n"
|
|
51
|
+
)
|
|
52
|
+
assert isinstance(request, Request)
|
|
53
|
+
assert request.via == [
|
|
54
|
+
Via(
|
|
55
|
+
transport="WSS",
|
|
56
|
+
host="mYn6S3lQaKjo.invalid",
|
|
57
|
+
port=None,
|
|
58
|
+
parameters=Parameters(branch="z9hG4bKgD24yaj"),
|
|
59
|
+
)
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
License
|
|
63
|
+
-------
|
|
64
|
+
|
|
65
|
+
``sipmessage`` is released under the `BSD license`_.
|
|
66
|
+
|
|
67
|
+
.. _BSD license: https://sipmessage.readthedocs.io/en/stable/license.html
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
3
|
+
|
|
4
|
+
<svg
|
|
5
|
+
width="128"
|
|
6
|
+
height="128"
|
|
7
|
+
viewBox="0 0 33.866666 33.866666"
|
|
8
|
+
version="1.1"
|
|
9
|
+
id="svg8"
|
|
10
|
+
inkscape:version="1.4 (e7c3feb100, 2024-10-09)"
|
|
11
|
+
inkscape:export-xdpi="600.55133"
|
|
12
|
+
inkscape:export-ydpi="600.55133"
|
|
13
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
14
|
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
15
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
16
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
17
|
+
xmlns:svg="http://www.w3.org/2000/svg"
|
|
18
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
19
|
+
xmlns:cc="http://creativecommons.org/ns#"
|
|
20
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
|
21
|
+
<defs
|
|
22
|
+
id="defs2">
|
|
23
|
+
<linearGradient
|
|
24
|
+
id="linearGradient14"
|
|
25
|
+
inkscape:collect="always">
|
|
26
|
+
<stop
|
|
27
|
+
style="stop-color:#646464;stop-opacity:1;"
|
|
28
|
+
offset="0"
|
|
29
|
+
id="stop14" />
|
|
30
|
+
<stop
|
|
31
|
+
style="stop-color:#3c3c28;stop-opacity:1;"
|
|
32
|
+
offset="1"
|
|
33
|
+
id="stop15" />
|
|
34
|
+
</linearGradient>
|
|
35
|
+
<linearGradient
|
|
36
|
+
id="linearGradient10"
|
|
37
|
+
inkscape:collect="always">
|
|
38
|
+
<stop
|
|
39
|
+
style="stop-color:#646464;stop-opacity:1;"
|
|
40
|
+
offset="0"
|
|
41
|
+
id="stop10" />
|
|
42
|
+
<stop
|
|
43
|
+
style="stop-color:#3c3c28;stop-opacity:1;"
|
|
44
|
+
offset="1"
|
|
45
|
+
id="stop11" />
|
|
46
|
+
</linearGradient>
|
|
47
|
+
<linearGradient
|
|
48
|
+
id="linearGradient7"
|
|
49
|
+
inkscape:collect="always">
|
|
50
|
+
<stop
|
|
51
|
+
style="stop-color:#306998;stop-opacity:1;"
|
|
52
|
+
offset="0"
|
|
53
|
+
id="stop7" />
|
|
54
|
+
<stop
|
|
55
|
+
style="stop-color:#306998;stop-opacity:1;"
|
|
56
|
+
offset="1"
|
|
57
|
+
id="stop8" />
|
|
58
|
+
</linearGradient>
|
|
59
|
+
<linearGradient
|
|
60
|
+
id="linearGradient3"
|
|
61
|
+
inkscape:collect="always">
|
|
62
|
+
<stop
|
|
63
|
+
style="stop-color:#ffe873;stop-opacity:1;"
|
|
64
|
+
offset="0"
|
|
65
|
+
id="stop3" />
|
|
66
|
+
<stop
|
|
67
|
+
style="stop-color:#ffd43b;stop-opacity:1;"
|
|
68
|
+
offset="1"
|
|
69
|
+
id="stop4" />
|
|
70
|
+
</linearGradient>
|
|
71
|
+
<linearGradient
|
|
72
|
+
inkscape:collect="always"
|
|
73
|
+
xlink:href="#linearGradient3"
|
|
74
|
+
id="linearGradient4"
|
|
75
|
+
x1="13.287"
|
|
76
|
+
y1="265.29965"
|
|
77
|
+
x2="15.19231"
|
|
78
|
+
y2="265.29965"
|
|
79
|
+
gradientUnits="userSpaceOnUse"
|
|
80
|
+
gradientTransform="matrix(5.7405583,0,0,5.7405583,-55.877675,-1246.572)" />
|
|
81
|
+
<linearGradient
|
|
82
|
+
inkscape:collect="always"
|
|
83
|
+
xlink:href="#linearGradient7"
|
|
84
|
+
id="linearGradient8"
|
|
85
|
+
x1="9.7551348"
|
|
86
|
+
y1="265.30108"
|
|
87
|
+
x2="11.581377"
|
|
88
|
+
y2="265.30108"
|
|
89
|
+
gradientUnits="userSpaceOnUse"
|
|
90
|
+
gradientTransform="matrix(5.7405583,0,0,5.7405583,-53.761007,-1246.8297)" />
|
|
91
|
+
<linearGradient
|
|
92
|
+
inkscape:collect="always"
|
|
93
|
+
xlink:href="#linearGradient10"
|
|
94
|
+
id="linearGradient11"
|
|
95
|
+
x1="20.881417"
|
|
96
|
+
y1="265.14198"
|
|
97
|
+
x2="21.481417"
|
|
98
|
+
y2="265.14198"
|
|
99
|
+
gradientUnits="userSpaceOnUse" />
|
|
100
|
+
<linearGradient
|
|
101
|
+
inkscape:collect="always"
|
|
102
|
+
xlink:href="#linearGradient10"
|
|
103
|
+
id="linearGradient12"
|
|
104
|
+
gradientUnits="userSpaceOnUse"
|
|
105
|
+
x1="20.881417"
|
|
106
|
+
y1="265.14198"
|
|
107
|
+
x2="21.481417"
|
|
108
|
+
y2="265.14198" />
|
|
109
|
+
<linearGradient
|
|
110
|
+
inkscape:collect="always"
|
|
111
|
+
xlink:href="#linearGradient10"
|
|
112
|
+
id="linearGradient13"
|
|
113
|
+
gradientUnits="userSpaceOnUse"
|
|
114
|
+
x1="20.881417"
|
|
115
|
+
y1="265.14198"
|
|
116
|
+
x2="21.481417"
|
|
117
|
+
y2="265.14198" />
|
|
118
|
+
<linearGradient
|
|
119
|
+
inkscape:collect="always"
|
|
120
|
+
xlink:href="#linearGradient14"
|
|
121
|
+
id="linearGradient15"
|
|
122
|
+
x1="2.4053329"
|
|
123
|
+
y1="289.8365"
|
|
124
|
+
x2="31.609005"
|
|
125
|
+
y2="289.8365"
|
|
126
|
+
gradientUnits="userSpaceOnUse"
|
|
127
|
+
gradientTransform="translate(-0.10965954,0.22156376)" />
|
|
128
|
+
</defs>
|
|
129
|
+
<sodipodi:namedview
|
|
130
|
+
id="base"
|
|
131
|
+
pagecolor="#ffffff"
|
|
132
|
+
bordercolor="#666666"
|
|
133
|
+
borderopacity="1.0"
|
|
134
|
+
inkscape:pageopacity="0.0"
|
|
135
|
+
inkscape:pageshadow="2"
|
|
136
|
+
inkscape:zoom="3.5824902"
|
|
137
|
+
inkscape:cx="46.196916"
|
|
138
|
+
inkscape:cy="11.02585"
|
|
139
|
+
inkscape:document-units="mm"
|
|
140
|
+
inkscape:current-layer="layer1"
|
|
141
|
+
showgrid="false"
|
|
142
|
+
units="px"
|
|
143
|
+
inkscape:window-width="2194"
|
|
144
|
+
inkscape:window-height="1206"
|
|
145
|
+
inkscape:window-x="0"
|
|
146
|
+
inkscape:window-y="0"
|
|
147
|
+
inkscape:window-maximized="1"
|
|
148
|
+
inkscape:showpageshadow="2"
|
|
149
|
+
inkscape:pagecheckerboard="0"
|
|
150
|
+
inkscape:deskcolor="#d1d1d1" />
|
|
151
|
+
<metadata
|
|
152
|
+
id="metadata5">
|
|
153
|
+
<rdf:RDF>
|
|
154
|
+
<cc:Work
|
|
155
|
+
rdf:about="">
|
|
156
|
+
<dc:format>image/svg+xml</dc:format>
|
|
157
|
+
<dc:type
|
|
158
|
+
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
159
|
+
</cc:Work>
|
|
160
|
+
</rdf:RDF>
|
|
161
|
+
</metadata>
|
|
162
|
+
<g
|
|
163
|
+
inkscape:label="Layer 1"
|
|
164
|
+
inkscape:groupmode="layer"
|
|
165
|
+
id="layer1"
|
|
166
|
+
transform="translate(0,-263.13334)">
|
|
167
|
+
<text
|
|
168
|
+
xml:space="preserve"
|
|
169
|
+
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.175px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans Bold';text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#0000ff;stroke:#008080;stroke-width:3;stroke-linejoin:bevel"
|
|
170
|
+
x="21.860958"
|
|
171
|
+
y="266.64142"
|
|
172
|
+
id="text8"><tspan
|
|
173
|
+
sodipodi:role="line"
|
|
174
|
+
id="tspan8"
|
|
175
|
+
style="stroke-width:3"></tspan></text>
|
|
176
|
+
<g
|
|
177
|
+
id="g15"
|
|
178
|
+
transform="matrix(1.0888414,0,0,1.0888414,-1.3805749,-24.407106)">
|
|
179
|
+
<text
|
|
180
|
+
xml:space="preserve"
|
|
181
|
+
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:18.2262px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans Bold';text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:url(#linearGradient4);stroke-width:17.2217;stroke-linejoin:bevel"
|
|
182
|
+
x="18.72401"
|
|
183
|
+
y="283.03973"
|
|
184
|
+
id="text3"><tspan
|
|
185
|
+
sodipodi:role="line"
|
|
186
|
+
id="tspan3"
|
|
187
|
+
style="fill:url(#linearGradient4);stroke-width:17.2217"
|
|
188
|
+
x="18.72401"
|
|
189
|
+
y="283.03973">P</tspan></text>
|
|
190
|
+
<path
|
|
191
|
+
id="text1"
|
|
192
|
+
style="font-weight:bold;font-size:3.175px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans Bold';fill:url(#linearGradient8);stroke-width:17.2217;stroke-linejoin:bevel"
|
|
193
|
+
d="m 9.9592957,269.02624 c -0.9584912,0.0171 -1.9511203,0.19032 -2.7543539,0.22737 -1.6064662,0.074 -2.8301738,0.35564 -3.6845296,1.06764 -0.8543791,0.71195 -1.2815755,1.72944 -1.2815755,3.05252 0,1.05609 0.3056408,1.89575 0.9167399,2.51871 0.6170356,0.62303 1.5901992,1.07695 2.9192017,1.36168 l 1.3260172,0.29404 c 0.8069041,0.17807 1.3437611,0.37952 1.6107544,0.60513 0.2729059,0.22549 0.4092774,0.54614 0.4092774,0.96118 0,0.4628 -0.1988128,0.81901 -0.5963461,1.06815 -0.3975164,0.24914 -0.9701606,0.37362 -1.7177246,0.37362 -0.7356927,0 -1.5009566,-0.11288 -2.2959839,-0.33848 -0.7890908,-0.2314 -1.6077553,-0.57198 -2.4561808,-1.02319 v 2.89233 c 0.8484255,0.31418 1.6966441,0.55194 2.5450643,0.7121 0.8484255,0.16014 1.6943054,0.24029 2.5367961,0.24029 1.7858419,0 3.1118307,-0.35563 3.9780527,-1.06763 0.87218,-0.71786 1.30793,-1.80975 1.30793,-3.27525 0,-1.11539 -0.31134,-1.97555 -0.93431,-2.58072 -0.622972,-0.60523 -1.673385,-1.05611 -3.1507124,-1.35289 L 7.1780701,274.4688 c -0.6941775,-0.14236 -1.1747792,-0.31171 -1.4417725,-0.50746 -0.2610237,-0.20178 -0.3911906,-0.48073 -0.3911906,-0.83665 0,-0.47469 0.1954806,-0.82445 0.5870443,-1.05006 0.3915806,-0.2256 0.9966345,-0.33797 1.8153931,-0.33797 0.6170357,0 1.2726399,0.6077 1.966805,0.7736 0.6941656,0.1659 1.4577296,0.69987 2.1363046,0.43925 0.550524,-0.21131 0.926298,-0.84745 1.049031,-1.4242 0.127096,-0.59741 0.06581,-1.38593 -0.392224,-1.79007 -0.665488,-0.58697 -1.589674,-0.72608 -2.5481653,-0.709 z m 1.0717693,0.81752 a 0.56210554,0.5246318 0 0 1 0.56224,0.52503 0.56210554,0.5246318 0 0 1 -0.56224,0.52452 0.56210554,0.5246318 0 0 1 -0.56224,-0.52452 0.56210554,0.5246318 0 0 1 0.56224,-0.52503 z" />
|
|
194
|
+
<g
|
|
195
|
+
id="g10"
|
|
196
|
+
transform="matrix(5.7405584,0,0,5.7405584,-105.184,-1246.1471)"
|
|
197
|
+
style="fill:url(#linearGradient11)">
|
|
198
|
+
<ellipse
|
|
199
|
+
style="fill:url(#linearGradient12);fill-opacity:1;stroke:none;stroke-width:2.71084;stroke-linejoin:bevel"
|
|
200
|
+
id="path10"
|
|
201
|
+
cx="21.181417"
|
|
202
|
+
cy="264.17212"
|
|
203
|
+
rx="0.30000001"
|
|
204
|
+
ry="0.27108437" />
|
|
205
|
+
<path
|
|
206
|
+
style="font-weight:bold;font-size:3.175px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans Bold';fill:url(#linearGradient13);fill-opacity:1;stroke-width:3;stroke-linejoin:bevel"
|
|
207
|
+
d="m 20.903915,264.64661 h 0.555005 v 1.73632 h -0.555005 z"
|
|
208
|
+
id="text9" />
|
|
209
|
+
</g>
|
|
210
|
+
</g>
|
|
211
|
+
<text
|
|
212
|
+
xml:space="preserve"
|
|
213
|
+
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:6.02368px;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans Bold';text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:url(#linearGradient15);stroke:none;stroke-width:5.69167;stroke-linejoin:bevel"
|
|
214
|
+
x="1.7956607"
|
|
215
|
+
y="291.09485"
|
|
216
|
+
id="text13"><tspan
|
|
217
|
+
sodipodi:role="line"
|
|
218
|
+
id="tspan13"
|
|
219
|
+
style="fill:url(#linearGradient15);stroke-width:5.69167"
|
|
220
|
+
x="1.7956607"
|
|
221
|
+
y="291.09485">message</tspan></text>
|
|
222
|
+
</g>
|
|
223
|
+
</svg>
|
|
@@ -27,5 +27,9 @@ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
|
|
|
27
27
|
# -- Options for HTML output -------------------------------------------------
|
|
28
28
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
html_logo = "_static/sipmessage.svg"
|
|
31
31
|
html_static_path = ["_static"]
|
|
32
|
+
html_theme = "furo"
|
|
33
|
+
html_theme_options = {
|
|
34
|
+
"sidebar_hide_name": True,
|
|
35
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
sipmessage
|
|
2
|
+
==========
|
|
3
|
+
|
|
4
|
+
.. image:: https://img.shields.io/pypi/l/sipmessage.svg
|
|
5
|
+
:target: https://pypi.python.org/pypi/sipmessage
|
|
6
|
+
:alt: License
|
|
7
|
+
|
|
8
|
+
.. image:: https://img.shields.io/pypi/v/sipmessage.svg
|
|
9
|
+
:target: https://pypi.python.org/pypi/sipmessage
|
|
10
|
+
:alt: Version
|
|
11
|
+
|
|
12
|
+
.. image:: https://github.com/spacinov/sipmessage/workflows/tests/badge.svg
|
|
13
|
+
:target: https://github.com/spacinov/sipmessage/actions
|
|
14
|
+
:alt: Tests
|
|
15
|
+
|
|
16
|
+
.. image:: https://img.shields.io/codecov/c/github/spacinov/sipmessage.svg
|
|
17
|
+
:target: https://codecov.io/gh/spacinov/sipmessage
|
|
18
|
+
:alt: Coverage
|
|
19
|
+
|
|
20
|
+
The ``sipmessage`` project provides a set of Python helpers and structures
|
|
21
|
+
for parsing and serialising SIP messages. It can be used to manipulate either
|
|
22
|
+
either entire :doc:`requests and responses <messages>` or individual
|
|
23
|
+
:doc:`header values <headers>`.
|
|
24
|
+
|
|
25
|
+
.. code:: python
|
|
26
|
+
|
|
27
|
+
from sipmessage import Message, Parameters, Request, Via
|
|
28
|
+
|
|
29
|
+
request = Message.parse(
|
|
30
|
+
b"REGISTER sip:atlanta.com SIP/2.0\r\n"
|
|
31
|
+
b"Via: SIP/2.0/WSS mYn6S3lQaKjo.invalid;branch=z9hG4bKgD24yaj\r\n"
|
|
32
|
+
b"Max-Forwards: 70\r\n"
|
|
33
|
+
b"To: <sip:alice@atlanta.com>\r\n"
|
|
34
|
+
b"From: <sip:alice@atlanta.com>;tag=69piINLbAb\r\n"
|
|
35
|
+
b"Call-ID: t87Br1RHAoBz2FsrKKk6hV\r\n"
|
|
36
|
+
b"CSeq: 1 REGISTER\r\n"
|
|
37
|
+
b"Contact: <sip:Mk9sZp5Z@mYn6S3lQaKjo.invalid;transport=ws>;expires=300\r\n"
|
|
38
|
+
b"User-Agent: Tester/0.1.0\r\n"
|
|
39
|
+
b"Content-Length: 0\r\n\r\n"
|
|
40
|
+
)
|
|
41
|
+
assert isinstance(request, Request)
|
|
42
|
+
assert request.via == [
|
|
43
|
+
Via(
|
|
44
|
+
transport="WSS",
|
|
45
|
+
host="mYn6S3lQaKjo.invalid",
|
|
46
|
+
port=None,
|
|
47
|
+
parameters=Parameters(branch="z9hG4bKgD24yaj"),
|
|
48
|
+
)
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
.. toctree::
|
|
53
|
+
:caption: API Reference
|
|
54
|
+
:hidden:
|
|
55
|
+
|
|
56
|
+
messages
|
|
57
|
+
headers
|
|
58
|
+
|
|
59
|
+
.. toctree::
|
|
60
|
+
:caption: About sipmessage
|
|
61
|
+
:hidden:
|
|
62
|
+
|
|
63
|
+
license
|
|
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
|
|
|
5
5
|
[project]
|
|
6
6
|
# Version
|
|
7
7
|
name = "sipmessage"
|
|
8
|
-
version = "0.6.
|
|
8
|
+
version = "0.6.4"
|
|
9
9
|
|
|
10
10
|
# Dependencies
|
|
11
11
|
dependencies = []
|
|
@@ -47,7 +47,6 @@ dev = [
|
|
|
47
47
|
]
|
|
48
48
|
|
|
49
49
|
[project.urls]
|
|
50
|
-
Homepage = "https://sipmessage.readthedocs.io/"
|
|
51
50
|
Documentation = "https://sipmessage.readthedocs.io/"
|
|
52
51
|
Repository = "https://github.com/spacinov/sipmessage"
|
|
53
52
|
Issues = "https://github.com/spacinov/sipmessage/issues"
|
|
@@ -274,6 +274,19 @@ class Message:
|
|
|
274
274
|
)
|
|
275
275
|
self._set_optional_str("Date", str_value)
|
|
276
276
|
|
|
277
|
+
@property
|
|
278
|
+
def expires(self) -> int | None:
|
|
279
|
+
"""
|
|
280
|
+
The `Expires` header value.
|
|
281
|
+
|
|
282
|
+
:rfc:`3261#section-20.19`
|
|
283
|
+
"""
|
|
284
|
+
return self._get_optional_int("Expires")
|
|
285
|
+
|
|
286
|
+
@expires.setter
|
|
287
|
+
def expires(self, value: int | None) -> None:
|
|
288
|
+
self._set_optional_int("Expires", value)
|
|
289
|
+
|
|
277
290
|
@property
|
|
278
291
|
def from_address(self) -> Address:
|
|
279
292
|
"""
|
|
@@ -300,6 +313,19 @@ class Message:
|
|
|
300
313
|
def max_forwards(self, value: int | None) -> None:
|
|
301
314
|
self._set_optional_int("Max-Forwards", value)
|
|
302
315
|
|
|
316
|
+
@property
|
|
317
|
+
def min_expires(self) -> int | None:
|
|
318
|
+
"""
|
|
319
|
+
The `Min-Expires` header value.
|
|
320
|
+
|
|
321
|
+
:rfc:`3261#section-20.23`
|
|
322
|
+
"""
|
|
323
|
+
return self._get_optional_int("Min-Expires")
|
|
324
|
+
|
|
325
|
+
@min_expires.setter
|
|
326
|
+
def min_expires(self, value: int | None) -> None:
|
|
327
|
+
self._set_optional_int("Min-Expires", value)
|
|
328
|
+
|
|
303
329
|
@property
|
|
304
330
|
def proxy_authenticate(self) -> AuthChallenge | None:
|
|
305
331
|
"""
|
|
@@ -326,6 +352,58 @@ class Message:
|
|
|
326
352
|
def proxy_authorization(self, value: AuthCredentials | None) -> None:
|
|
327
353
|
self._set_auth_credentials("Proxy-Authorization", value)
|
|
328
354
|
|
|
355
|
+
@property
|
|
356
|
+
def proxy_require(self) -> list[str]:
|
|
357
|
+
"""
|
|
358
|
+
The `Proxy-Require` header values.
|
|
359
|
+
|
|
360
|
+
:rfc:`3261#section-20.29`
|
|
361
|
+
"""
|
|
362
|
+
return self._get_token_list("Proxy-Require")
|
|
363
|
+
|
|
364
|
+
@proxy_require.setter
|
|
365
|
+
def proxy_require(self, value: list[str]) -> None:
|
|
366
|
+
self._set_token_list("Proxy-Require", value)
|
|
367
|
+
|
|
368
|
+
@property
|
|
369
|
+
def record_route(self) -> list[Address]:
|
|
370
|
+
"""
|
|
371
|
+
The `Record-Route` header values.
|
|
372
|
+
|
|
373
|
+
:rfc:`3261#section-20.30`
|
|
374
|
+
"""
|
|
375
|
+
return self._get_address_list("Record-Route")
|
|
376
|
+
|
|
377
|
+
@record_route.setter
|
|
378
|
+
def record_route(self, value: list[Address]) -> None:
|
|
379
|
+
self._set_address_list("Record-Route", value)
|
|
380
|
+
|
|
381
|
+
@property
|
|
382
|
+
def require(self) -> list[str]:
|
|
383
|
+
"""
|
|
384
|
+
The `Require` header values.
|
|
385
|
+
|
|
386
|
+
:rfc:`3261#section-20.32`
|
|
387
|
+
"""
|
|
388
|
+
return self._get_token_list("Require")
|
|
389
|
+
|
|
390
|
+
@require.setter
|
|
391
|
+
def require(self, value: list[str]) -> None:
|
|
392
|
+
self._set_token_list("Require", value)
|
|
393
|
+
|
|
394
|
+
@property
|
|
395
|
+
def route(self) -> list[Address]:
|
|
396
|
+
"""
|
|
397
|
+
The `Route` header values.
|
|
398
|
+
|
|
399
|
+
:rfc:`3261#section-20.34`
|
|
400
|
+
"""
|
|
401
|
+
return self._get_address_list("Route")
|
|
402
|
+
|
|
403
|
+
@route.setter
|
|
404
|
+
def route(self, value: list[Address]) -> None:
|
|
405
|
+
self._set_address_list("Route", value)
|
|
406
|
+
|
|
329
407
|
@property
|
|
330
408
|
def server(self) -> str | None:
|
|
331
409
|
"""
|
|
@@ -352,6 +430,19 @@ class Message:
|
|
|
352
430
|
def subject(self, value: str | None) -> None:
|
|
353
431
|
self._set_optional_str("Subject", value)
|
|
354
432
|
|
|
433
|
+
@property
|
|
434
|
+
def supported(self) -> list[str]:
|
|
435
|
+
"""
|
|
436
|
+
The `Supported` header values.
|
|
437
|
+
|
|
438
|
+
:rfc:`3261#section-20.37`
|
|
439
|
+
"""
|
|
440
|
+
return self._get_token_list("Supported")
|
|
441
|
+
|
|
442
|
+
@supported.setter
|
|
443
|
+
def supported(self, value: list[str]) -> None:
|
|
444
|
+
self._set_token_list("Supported", value)
|
|
445
|
+
|
|
355
446
|
@property
|
|
356
447
|
def to_address(self) -> Address:
|
|
357
448
|
"""
|
|
@@ -366,30 +457,17 @@ class Message:
|
|
|
366
457
|
self.headers.set("To", str(value))
|
|
367
458
|
|
|
368
459
|
@property
|
|
369
|
-
def
|
|
370
|
-
"""
|
|
371
|
-
The `Record-Route` header values.
|
|
372
|
-
|
|
373
|
-
:rfc:`3261#section-20.30`
|
|
374
|
-
"""
|
|
375
|
-
return self._get_address_list("Record-Route")
|
|
376
|
-
|
|
377
|
-
@record_route.setter
|
|
378
|
-
def record_route(self, value: list[Address]) -> None:
|
|
379
|
-
self._set_address_list("Record-Route", value)
|
|
380
|
-
|
|
381
|
-
@property
|
|
382
|
-
def route(self) -> list[Address]:
|
|
460
|
+
def unsupported(self) -> list[str]:
|
|
383
461
|
"""
|
|
384
|
-
The `
|
|
462
|
+
The `Unsupported` header values.
|
|
385
463
|
|
|
386
|
-
:rfc:`3261#section-20.
|
|
464
|
+
:rfc:`3261#section-20.40`
|
|
387
465
|
"""
|
|
388
|
-
return self.
|
|
466
|
+
return self._get_token_list("Unsupported")
|
|
389
467
|
|
|
390
|
-
@
|
|
391
|
-
def
|
|
392
|
-
self.
|
|
468
|
+
@unsupported.setter
|
|
469
|
+
def unsupported(self, value: list[str]) -> None:
|
|
470
|
+
self._set_token_list("Unsupported", value)
|
|
393
471
|
|
|
394
472
|
@property
|
|
395
473
|
def user_agent(self) -> str | None:
|
|
@@ -490,6 +568,19 @@ class Message:
|
|
|
490
568
|
else:
|
|
491
569
|
self.headers.set(key, value)
|
|
492
570
|
|
|
571
|
+
def _get_token_list(self, key: str) -> list[str]:
|
|
572
|
+
values = []
|
|
573
|
+
for value in self.headers.getlist(key):
|
|
574
|
+
if value := value.strip():
|
|
575
|
+
values += [x.strip() for x in value.split(",")]
|
|
576
|
+
return values
|
|
577
|
+
|
|
578
|
+
def _set_token_list(self, key: str, value: list[str]) -> None:
|
|
579
|
+
if value:
|
|
580
|
+
self.headers.set(key, ", ".join(value))
|
|
581
|
+
else:
|
|
582
|
+
self.headers.remove(key)
|
|
583
|
+
|
|
493
584
|
|
|
494
585
|
class Request(Message):
|
|
495
586
|
"""
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sipmessage
|
|
3
|
+
Version: 0.6.4
|
|
4
|
+
Summary: Pure python parsing of SIP messages and headers
|
|
5
|
+
Author-email: Spacinov Engineering <opensource@spacinov.com>
|
|
6
|
+
License-Expression: BSD-2-Clause
|
|
7
|
+
Project-URL: Documentation, https://sipmessage.readthedocs.io/
|
|
8
|
+
Project-URL: Repository, https://github.com/spacinov/sipmessage
|
|
9
|
+
Project-URL: Issues, https://github.com/spacinov/sipmessage/issues
|
|
10
|
+
Keywords: SIP,RFC3261
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: System Administrators
|
|
14
|
+
Classifier: Intended Audience :: Telecommunications Industry
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Communications :: Telephony
|
|
21
|
+
Classifier: Typing :: Typed
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/x-rst
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: check-manifest; extra == "dev"
|
|
27
|
+
Requires-Dist: coverage; extra == "dev"
|
|
28
|
+
Requires-Dist: mypy; extra == "dev"
|
|
29
|
+
Requires-Dist: pyroma; extra == "dev"
|
|
30
|
+
Requires-Dist: ruff; extra == "dev"
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
|
|
33
|
+
.. image:: docs/_static/sipmessage.svg
|
|
34
|
+
:width: 120px
|
|
35
|
+
:alt: sipmessage
|
|
36
|
+
|
|
37
|
+
.. image:: https://img.shields.io/pypi/l/sipmessage.svg
|
|
38
|
+
:target: https://pypi.python.org/pypi/sipmessage
|
|
39
|
+
:alt: License
|
|
40
|
+
|
|
41
|
+
.. image:: https://img.shields.io/pypi/v/sipmessage.svg
|
|
42
|
+
:target: https://pypi.python.org/pypi/sipmessage
|
|
43
|
+
:alt: Version
|
|
44
|
+
|
|
45
|
+
.. image:: https://github.com/spacinov/sipmessage/workflows/tests/badge.svg
|
|
46
|
+
:target: https://github.com/spacinov/sipmessage/actions
|
|
47
|
+
:alt: Tests
|
|
48
|
+
|
|
49
|
+
.. image:: https://img.shields.io/codecov/c/github/spacinov/sipmessage.svg
|
|
50
|
+
:target: https://codecov.io/gh/spacinov/sipmessage
|
|
51
|
+
:alt: Coverage
|
|
52
|
+
|
|
53
|
+
.. image:: https://readthedocs.org/projects/sipmessage/badge/?version=latest
|
|
54
|
+
:target: https://sipmessage.readthedocs.io/
|
|
55
|
+
:alt: Documentation
|
|
56
|
+
|
|
57
|
+
The ``sipmessage`` project provides a set of Python helpers and structures
|
|
58
|
+
for parsing and serialising SIP messages. It can be used to manipulate either
|
|
59
|
+
either entire requests and responses or individual header values.
|
|
60
|
+
|
|
61
|
+
To learn more about ``sipmessage`` please `read the documentation`_.
|
|
62
|
+
|
|
63
|
+
.. _read the documentation: https://sipmessage.readthedocs.io/en/stable/
|
|
64
|
+
|
|
65
|
+
Example
|
|
66
|
+
-------
|
|
67
|
+
|
|
68
|
+
.. code:: python
|
|
69
|
+
|
|
70
|
+
from sipmessage import Message, Parameters, Request, Via
|
|
71
|
+
|
|
72
|
+
request = Message.parse(
|
|
73
|
+
b"REGISTER sip:atlanta.com SIP/2.0\r\n"
|
|
74
|
+
b"Via: SIP/2.0/WSS mYn6S3lQaKjo.invalid;branch=z9hG4bKgD24yaj\r\n"
|
|
75
|
+
b"Max-Forwards: 70\r\n"
|
|
76
|
+
b"To: <sip:alice@atlanta.com>\r\n"
|
|
77
|
+
b"From: <sip:alice@atlanta.com>;tag=69piINLbAb\r\n"
|
|
78
|
+
b"Call-ID: t87Br1RHAoBz2FsrKKk6hV\r\n"
|
|
79
|
+
b"CSeq: 1 REGISTER\r\n"
|
|
80
|
+
b"Contact: <sip:Mk9sZp5Z@mYn6S3lQaKjo.invalid;transport=ws>;expires=300\r\n"
|
|
81
|
+
b"User-Agent: Tester/0.1.0\r\n"
|
|
82
|
+
b"Content-Length: 0\r\n\r\n"
|
|
83
|
+
)
|
|
84
|
+
assert isinstance(request, Request)
|
|
85
|
+
assert request.via == [
|
|
86
|
+
Via(
|
|
87
|
+
transport="WSS",
|
|
88
|
+
host="mYn6S3lQaKjo.invalid",
|
|
89
|
+
port=None,
|
|
90
|
+
parameters=Parameters(branch="z9hG4bKgD24yaj"),
|
|
91
|
+
)
|
|
92
|
+
]
|
|
93
|
+
|
|
94
|
+
License
|
|
95
|
+
-------
|
|
96
|
+
|
|
97
|
+
``sipmessage`` is released under the `BSD license`_.
|
|
98
|
+
|
|
99
|
+
.. _BSD license: https://sipmessage.readthedocs.io/en/stable/license.html
|
|
@@ -364,6 +364,15 @@ Content-Length: 0
|
|
|
364
364
|
self.assertEqual(request.date, None)
|
|
365
365
|
self.assertMessageHeaders(request, [])
|
|
366
366
|
|
|
367
|
+
def test_header_expires(self) -> None:
|
|
368
|
+
request = dummy_message()
|
|
369
|
+
|
|
370
|
+
self.assertEqual(request.expires, None)
|
|
371
|
+
|
|
372
|
+
request.expires = 5
|
|
373
|
+
self.assertEqual(request.expires, 5)
|
|
374
|
+
self.assertMessageHeaders(request, ["Expires: 5"])
|
|
375
|
+
|
|
367
376
|
def test_header_from_address(self) -> None:
|
|
368
377
|
request = dummy_message()
|
|
369
378
|
|
|
@@ -383,6 +392,15 @@ Content-Length: 0
|
|
|
383
392
|
self.assertEqual(request.max_forwards, 1)
|
|
384
393
|
self.assertMessageHeaders(request, ["Max-Forwards: 1"])
|
|
385
394
|
|
|
395
|
+
def test_header_min_expires(self) -> None:
|
|
396
|
+
request = dummy_message()
|
|
397
|
+
|
|
398
|
+
self.assertEqual(request.min_expires, None)
|
|
399
|
+
|
|
400
|
+
request.min_expires = 60
|
|
401
|
+
self.assertEqual(request.min_expires, 60)
|
|
402
|
+
self.assertMessageHeaders(request, ["Min-Expires: 60"])
|
|
403
|
+
|
|
386
404
|
def test_header_proxy_authenticate(self) -> None:
|
|
387
405
|
request = dummy_message()
|
|
388
406
|
|
|
@@ -419,6 +437,18 @@ Content-Length: 0
|
|
|
419
437
|
self.assertEqual(request.proxy_authorization, None)
|
|
420
438
|
self.assertMessageHeaders(request, [])
|
|
421
439
|
|
|
440
|
+
def test_header_proxy_require(self) -> None:
|
|
441
|
+
request = dummy_message()
|
|
442
|
+
self.assertEqual(request.proxy_require, [])
|
|
443
|
+
|
|
444
|
+
request.proxy_require = ["foo"]
|
|
445
|
+
self.assertEqual(request.proxy_require, ["foo"])
|
|
446
|
+
self.assertMessageHeaders(request, ["Proxy-Require: foo"])
|
|
447
|
+
|
|
448
|
+
request.proxy_require = []
|
|
449
|
+
self.assertEqual(request.proxy_require, [])
|
|
450
|
+
self.assertMessageHeaders(request, [])
|
|
451
|
+
|
|
422
452
|
def test_header_record_route(self) -> None:
|
|
423
453
|
request = dummy_message()
|
|
424
454
|
|
|
@@ -428,6 +458,18 @@ Content-Length: 0
|
|
|
428
458
|
self.assertEqual(request.record_route, [ADDRESS])
|
|
429
459
|
self.assertMessageHeaders(request, ["Record-Route: <sip:example.com>"])
|
|
430
460
|
|
|
461
|
+
def test_header_require(self) -> None:
|
|
462
|
+
request = dummy_message()
|
|
463
|
+
self.assertEqual(request.require, [])
|
|
464
|
+
|
|
465
|
+
request.require = ["foo"]
|
|
466
|
+
self.assertEqual(request.require, ["foo"])
|
|
467
|
+
self.assertMessageHeaders(request, ["Require: foo"])
|
|
468
|
+
|
|
469
|
+
request.require = []
|
|
470
|
+
self.assertEqual(request.require, [])
|
|
471
|
+
self.assertMessageHeaders(request, [])
|
|
472
|
+
|
|
431
473
|
def test_header_route(self) -> None:
|
|
432
474
|
request = dummy_message()
|
|
433
475
|
|
|
@@ -455,6 +497,23 @@ Content-Length: 0
|
|
|
455
497
|
self.assertEqual(request.subject, "Need more boxes")
|
|
456
498
|
self.assertMessageHeaders(request, ["Subject: Need more boxes"])
|
|
457
499
|
|
|
500
|
+
def test_header_supported(self) -> None:
|
|
501
|
+
request = dummy_message()
|
|
502
|
+
self.assertEqual(request.supported, [])
|
|
503
|
+
|
|
504
|
+
request.supported = ["replaces", "timer"]
|
|
505
|
+
self.assertEqual(request.supported, ["replaces", "timer"])
|
|
506
|
+
self.assertMessageHeaders(request, ["Supported: replaces, timer"])
|
|
507
|
+
|
|
508
|
+
request.supported = []
|
|
509
|
+
self.assertEqual(request.supported, [])
|
|
510
|
+
self.assertMessageHeaders(request, [])
|
|
511
|
+
|
|
512
|
+
# Check parsing of an empty header.
|
|
513
|
+
request.headers.set("Supported", "")
|
|
514
|
+
self.assertEqual(request.supported, [])
|
|
515
|
+
self.assertMessageHeaders(request, ["Supported: "])
|
|
516
|
+
|
|
458
517
|
def test_header_to_address(self) -> None:
|
|
459
518
|
request = dummy_message()
|
|
460
519
|
|
|
@@ -465,6 +524,18 @@ Content-Length: 0
|
|
|
465
524
|
self.assertEqual(request.to_address, ADDRESS)
|
|
466
525
|
self.assertMessageHeaders(request, ["To: <sip:example.com>"])
|
|
467
526
|
|
|
527
|
+
def test_header_unsupported(self) -> None:
|
|
528
|
+
request = dummy_message()
|
|
529
|
+
self.assertEqual(request.unsupported, [])
|
|
530
|
+
|
|
531
|
+
request.unsupported = ["foo"]
|
|
532
|
+
self.assertEqual(request.unsupported, ["foo"])
|
|
533
|
+
self.assertMessageHeaders(request, ["Unsupported: foo"])
|
|
534
|
+
|
|
535
|
+
request.unsupported = []
|
|
536
|
+
self.assertEqual(request.unsupported, [])
|
|
537
|
+
self.assertMessageHeaders(request, [])
|
|
538
|
+
|
|
468
539
|
def test_header_user_agent(self) -> None:
|
|
469
540
|
request = dummy_message()
|
|
470
541
|
|
sipmessage-0.6.2/PKG-INFO
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: sipmessage
|
|
3
|
-
Version: 0.6.2
|
|
4
|
-
Summary: Pure python parsing of SIP messages and headers
|
|
5
|
-
Author-email: Spacinov Engineering <opensource@spacinov.com>
|
|
6
|
-
License-Expression: BSD-2-Clause
|
|
7
|
-
Project-URL: Homepage, https://sipmessage.readthedocs.io/
|
|
8
|
-
Project-URL: Documentation, https://sipmessage.readthedocs.io/
|
|
9
|
-
Project-URL: Repository, https://github.com/spacinov/sipmessage
|
|
10
|
-
Project-URL: Issues, https://github.com/spacinov/sipmessage/issues
|
|
11
|
-
Keywords: SIP,RFC3261
|
|
12
|
-
Classifier: Development Status :: 4 - Beta
|
|
13
|
-
Classifier: Intended Audience :: Developers
|
|
14
|
-
Classifier: Intended Audience :: System Administrators
|
|
15
|
-
Classifier: Intended Audience :: Telecommunications Industry
|
|
16
|
-
Classifier: Operating System :: OS Independent
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
-
Classifier: Topic :: Communications :: Telephony
|
|
22
|
-
Classifier: Typing :: Typed
|
|
23
|
-
Requires-Python: >=3.10
|
|
24
|
-
Description-Content-Type: text/x-rst
|
|
25
|
-
License-File: LICENSE
|
|
26
|
-
Provides-Extra: dev
|
|
27
|
-
Requires-Dist: check-manifest; extra == "dev"
|
|
28
|
-
Requires-Dist: coverage; extra == "dev"
|
|
29
|
-
Requires-Dist: mypy; extra == "dev"
|
|
30
|
-
Requires-Dist: pyroma; extra == "dev"
|
|
31
|
-
Requires-Dist: ruff; extra == "dev"
|
|
32
|
-
Dynamic: license-file
|
|
33
|
-
|
|
34
|
-
sipmessage
|
|
35
|
-
==========
|
|
36
|
-
|
|
37
|
-
|license| |version| |tests| |coverage| |docs|
|
|
38
|
-
|
|
39
|
-
.. |license| image:: https://img.shields.io/pypi/l/sipmessage.svg
|
|
40
|
-
:target: https://pypi.python.org/pypi/sipmessage
|
|
41
|
-
:alt: License
|
|
42
|
-
|
|
43
|
-
.. |version| image:: https://img.shields.io/pypi/v/sipmessage.svg
|
|
44
|
-
:target: https://pypi.python.org/pypi/sipmessage
|
|
45
|
-
:alt: Version
|
|
46
|
-
|
|
47
|
-
.. |tests| image:: https://github.com/spacinov/sipmessage/workflows/tests/badge.svg
|
|
48
|
-
:target: https://github.com/spacinov/sipmessage/actions
|
|
49
|
-
:alt: Tests
|
|
50
|
-
|
|
51
|
-
.. |coverage| image:: https://img.shields.io/codecov/c/github/spacinov/sipmessage.svg
|
|
52
|
-
:target: https://codecov.io/gh/spacinov/sipmessage
|
|
53
|
-
:alt: Coverage
|
|
54
|
-
|
|
55
|
-
.. |docs| image:: https://readthedocs.org/projects/sipmessage/badge/?version=latest
|
|
56
|
-
:target: https://sipmessage.readthedocs.io/
|
|
57
|
-
:alt: Documentation
|
|
58
|
-
|
|
59
|
-
The ``sipmessage`` project provides a set of Python helpers and structures
|
|
60
|
-
for parsing SIP messages.
|
sipmessage-0.6.2/README.rst
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
sipmessage
|
|
2
|
-
==========
|
|
3
|
-
|
|
4
|
-
|license| |version| |tests| |coverage| |docs|
|
|
5
|
-
|
|
6
|
-
.. |license| image:: https://img.shields.io/pypi/l/sipmessage.svg
|
|
7
|
-
:target: https://pypi.python.org/pypi/sipmessage
|
|
8
|
-
:alt: License
|
|
9
|
-
|
|
10
|
-
.. |version| image:: https://img.shields.io/pypi/v/sipmessage.svg
|
|
11
|
-
:target: https://pypi.python.org/pypi/sipmessage
|
|
12
|
-
:alt: Version
|
|
13
|
-
|
|
14
|
-
.. |tests| image:: https://github.com/spacinov/sipmessage/workflows/tests/badge.svg
|
|
15
|
-
:target: https://github.com/spacinov/sipmessage/actions
|
|
16
|
-
:alt: Tests
|
|
17
|
-
|
|
18
|
-
.. |coverage| image:: https://img.shields.io/codecov/c/github/spacinov/sipmessage.svg
|
|
19
|
-
:target: https://codecov.io/gh/spacinov/sipmessage
|
|
20
|
-
:alt: Coverage
|
|
21
|
-
|
|
22
|
-
.. |docs| image:: https://readthedocs.org/projects/sipmessage/badge/?version=latest
|
|
23
|
-
:target: https://sipmessage.readthedocs.io/
|
|
24
|
-
:alt: Documentation
|
|
25
|
-
|
|
26
|
-
The ``sipmessage`` project provides a set of Python helpers and structures
|
|
27
|
-
for parsing SIP messages.
|
sipmessage-0.6.2/docs/index.rst
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
sipmessage
|
|
2
|
-
==========
|
|
3
|
-
|
|
4
|
-
.. image:: https://img.shields.io/pypi/l/sipmessage.svg
|
|
5
|
-
:target: https://pypi.python.org/pypi/sipmessage
|
|
6
|
-
:alt: License
|
|
7
|
-
|
|
8
|
-
.. image:: https://img.shields.io/pypi/v/sipmessage.svg
|
|
9
|
-
:target: https://pypi.python.org/pypi/sipmessage
|
|
10
|
-
:alt: Version
|
|
11
|
-
|
|
12
|
-
.. image:: https://github.com/spacinov/sipmessage/workflows/tests/badge.svg
|
|
13
|
-
:target: https://github.com/spacinov/sipmessage/actions
|
|
14
|
-
:alt: Tests
|
|
15
|
-
|
|
16
|
-
.. image:: https://img.shields.io/codecov/c/github/spacinov/sipmessage.svg
|
|
17
|
-
:target: https://codecov.io/gh/spacinov/sipmessage
|
|
18
|
-
:alt: Coverage
|
|
19
|
-
|
|
20
|
-
The ``sipmessage`` project provides a set of Python helpers and structures
|
|
21
|
-
for parsing SIP messages.
|
|
22
|
-
|
|
23
|
-
API Reference
|
|
24
|
-
-------------
|
|
25
|
-
|
|
26
|
-
.. toctree::
|
|
27
|
-
:maxdepth: 2
|
|
28
|
-
|
|
29
|
-
messages
|
|
30
|
-
headers
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: sipmessage
|
|
3
|
-
Version: 0.6.2
|
|
4
|
-
Summary: Pure python parsing of SIP messages and headers
|
|
5
|
-
Author-email: Spacinov Engineering <opensource@spacinov.com>
|
|
6
|
-
License-Expression: BSD-2-Clause
|
|
7
|
-
Project-URL: Homepage, https://sipmessage.readthedocs.io/
|
|
8
|
-
Project-URL: Documentation, https://sipmessage.readthedocs.io/
|
|
9
|
-
Project-URL: Repository, https://github.com/spacinov/sipmessage
|
|
10
|
-
Project-URL: Issues, https://github.com/spacinov/sipmessage/issues
|
|
11
|
-
Keywords: SIP,RFC3261
|
|
12
|
-
Classifier: Development Status :: 4 - Beta
|
|
13
|
-
Classifier: Intended Audience :: Developers
|
|
14
|
-
Classifier: Intended Audience :: System Administrators
|
|
15
|
-
Classifier: Intended Audience :: Telecommunications Industry
|
|
16
|
-
Classifier: Operating System :: OS Independent
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
-
Classifier: Topic :: Communications :: Telephony
|
|
22
|
-
Classifier: Typing :: Typed
|
|
23
|
-
Requires-Python: >=3.10
|
|
24
|
-
Description-Content-Type: text/x-rst
|
|
25
|
-
License-File: LICENSE
|
|
26
|
-
Provides-Extra: dev
|
|
27
|
-
Requires-Dist: check-manifest; extra == "dev"
|
|
28
|
-
Requires-Dist: coverage; extra == "dev"
|
|
29
|
-
Requires-Dist: mypy; extra == "dev"
|
|
30
|
-
Requires-Dist: pyroma; extra == "dev"
|
|
31
|
-
Requires-Dist: ruff; extra == "dev"
|
|
32
|
-
Dynamic: license-file
|
|
33
|
-
|
|
34
|
-
sipmessage
|
|
35
|
-
==========
|
|
36
|
-
|
|
37
|
-
|license| |version| |tests| |coverage| |docs|
|
|
38
|
-
|
|
39
|
-
.. |license| image:: https://img.shields.io/pypi/l/sipmessage.svg
|
|
40
|
-
:target: https://pypi.python.org/pypi/sipmessage
|
|
41
|
-
:alt: License
|
|
42
|
-
|
|
43
|
-
.. |version| image:: https://img.shields.io/pypi/v/sipmessage.svg
|
|
44
|
-
:target: https://pypi.python.org/pypi/sipmessage
|
|
45
|
-
:alt: Version
|
|
46
|
-
|
|
47
|
-
.. |tests| image:: https://github.com/spacinov/sipmessage/workflows/tests/badge.svg
|
|
48
|
-
:target: https://github.com/spacinov/sipmessage/actions
|
|
49
|
-
:alt: Tests
|
|
50
|
-
|
|
51
|
-
.. |coverage| image:: https://img.shields.io/codecov/c/github/spacinov/sipmessage.svg
|
|
52
|
-
:target: https://codecov.io/gh/spacinov/sipmessage
|
|
53
|
-
:alt: Coverage
|
|
54
|
-
|
|
55
|
-
.. |docs| image:: https://readthedocs.org/projects/sipmessage/badge/?version=latest
|
|
56
|
-
:target: https://sipmessage.readthedocs.io/
|
|
57
|
-
:alt: Documentation
|
|
58
|
-
|
|
59
|
-
The ``sipmessage`` project provides a set of Python helpers and structures
|
|
60
|
-
for parsing SIP messages.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|