rtpbench 0.3.0__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.
Files changed (160) hide show
  1. rtpbench-0.3.0/.dockerignore +4 -0
  2. rtpbench-0.3.0/.gitignore +14 -0
  3. rtpbench-0.3.0/Dockerfile +12 -0
  4. rtpbench-0.3.0/LICENSE +202 -0
  5. rtpbench-0.3.0/PKG-INFO +123 -0
  6. rtpbench-0.3.0/README.md +108 -0
  7. rtpbench-0.3.0/carrier/compose.yaml +68 -0
  8. rtpbench-0.3.0/carrier/opensips.cfg +226 -0
  9. rtpbench-0.3.0/carrier/tls.cfg +25 -0
  10. rtpbench-0.3.0/carrier/tls.yaml +9 -0
  11. rtpbench-0.3.0/compose.yaml +55 -0
  12. rtpbench-0.3.0/corpus/README.md +55 -0
  13. rtpbench-0.3.0/corpus/cough-c1-0.wav +0 -0
  14. rtpbench-0.3.0/corpus/cough-c1-1.wav +0 -0
  15. rtpbench-0.3.0/corpus/cough-c2-0.wav +0 -0
  16. rtpbench-0.3.0/corpus/cough-c2-1.wav +0 -0
  17. rtpbench-0.3.0/corpus/cough-man-0.wav +0 -0
  18. rtpbench-0.3.0/corpus/cough-man-1.wav +0 -0
  19. rtpbench-0.3.0/corpus/cough-short-0.wav +0 -0
  20. rtpbench-0.3.0/corpus/cough-short-1.wav +0 -0
  21. rtpbench-0.3.0/corpus/cough-woman_three_times-0.wav +0 -0
  22. rtpbench-0.3.0/corpus/human-en-dr-0.wav +0 -0
  23. rtpbench-0.3.0/corpus/human-en-dr-1.wav +0 -0
  24. rtpbench-0.3.0/corpus/human-en-sc-0.wav +0 -0
  25. rtpbench-0.3.0/corpus/human-en-sc-1.wav +0 -0
  26. rtpbench-0.3.0/corpus/human-en-sc-2.wav +0 -0
  27. rtpbench-0.3.0/corpus/human-es-f012-0.wav +0 -0
  28. rtpbench-0.3.0/corpus/human-es-f012-1.wav +0 -0
  29. rtpbench-0.3.0/corpus/human-es-f012-2.wav +0 -0
  30. rtpbench-0.3.0/corpus/human-es-f016-0.wav +0 -0
  31. rtpbench-0.3.0/corpus/human-es-f016-1.wav +0 -0
  32. rtpbench-0.3.0/corpus/human-es-f016-2.wav +0 -0
  33. rtpbench-0.3.0/corpus/lines/en/interrupt-00.wav +0 -0
  34. rtpbench-0.3.0/corpus/lines/en/interrupt-01.wav +0 -0
  35. rtpbench-0.3.0/corpus/lines/en/interrupt-02.wav +0 -0
  36. rtpbench-0.3.0/corpus/lines/en/interrupt-03.wav +0 -0
  37. rtpbench-0.3.0/corpus/lines/en/prompt-00.wav +0 -0
  38. rtpbench-0.3.0/corpus/lines/en/prompt-01.wav +0 -0
  39. rtpbench-0.3.0/corpus/lines/en/prompt-02.wav +0 -0
  40. rtpbench-0.3.0/corpus/lines/en/prompt-03.wav +0 -0
  41. rtpbench-0.3.0/corpus/lines/en/prompt-04.wav +0 -0
  42. rtpbench-0.3.0/corpus/lines/en/prompt-05.wav +0 -0
  43. rtpbench-0.3.0/corpus/lines/en/prompt-06.wav +0 -0
  44. rtpbench-0.3.0/corpus/lines/en/prompt-07.wav +0 -0
  45. rtpbench-0.3.0/corpus/lines/en/prompt-08.wav +0 -0
  46. rtpbench-0.3.0/corpus/lines/en/prompt-09.wav +0 -0
  47. rtpbench-0.3.0/corpus/lines/en/prompt.wav +0 -0
  48. rtpbench-0.3.0/corpus/lines/en/transfer.wav +0 -0
  49. rtpbench-0.3.0/corpus/lines/en/turn-00.wav +0 -0
  50. rtpbench-0.3.0/corpus/lines/en/turn-01.wav +0 -0
  51. rtpbench-0.3.0/corpus/lines/en/turn-02.wav +0 -0
  52. rtpbench-0.3.0/corpus/lines/en/turn-03.wav +0 -0
  53. rtpbench-0.3.0/corpus/lines/en/turn-04.wav +0 -0
  54. rtpbench-0.3.0/corpus/lines/en/turn-05.wav +0 -0
  55. rtpbench-0.3.0/corpus/lines/en/turn-06.wav +0 -0
  56. rtpbench-0.3.0/corpus/lines/en/turn-07.wav +0 -0
  57. rtpbench-0.3.0/corpus/lines/en/turn-08.wav +0 -0
  58. rtpbench-0.3.0/corpus/lines/en/turn-09.wav +0 -0
  59. rtpbench-0.3.0/corpus/lines/en/turn-10.wav +0 -0
  60. rtpbench-0.3.0/corpus/lines/en/turn-11.wav +0 -0
  61. rtpbench-0.3.0/corpus/tts-ald-bc.wav +0 -0
  62. rtpbench-0.3.0/corpus/tts-ald-long.wav +0 -0
  63. rtpbench-0.3.0/corpus/tts-ald-s03.wav +0 -0
  64. rtpbench-0.3.0/corpus/tts-ald-s07.wav +0 -0
  65. rtpbench-0.3.0/corpus/tts-ald-s11.wav +0 -0
  66. rtpbench-0.3.0/corpus/tts-cori-bc.wav +0 -0
  67. rtpbench-0.3.0/corpus/tts-cori-long.wav +0 -0
  68. rtpbench-0.3.0/corpus/tts-cori-s01.wav +0 -0
  69. rtpbench-0.3.0/corpus/tts-cori-s05.wav +0 -0
  70. rtpbench-0.3.0/corpus/tts-cori-s09.wav +0 -0
  71. rtpbench-0.3.0/corpus/tts-davefx-bc.wav +0 -0
  72. rtpbench-0.3.0/corpus/tts-davefx-long.wav +0 -0
  73. rtpbench-0.3.0/corpus/tts-davefx-s00.wav +0 -0
  74. rtpbench-0.3.0/corpus/tts-davefx-s04.wav +0 -0
  75. rtpbench-0.3.0/corpus/tts-davefx-s08.wav +0 -0
  76. rtpbench-0.3.0/corpus/tts-libritts0-bc.wav +0 -0
  77. rtpbench-0.3.0/corpus/tts-libritts0-long.wav +0 -0
  78. rtpbench-0.3.0/corpus/tts-libritts0-s02.wav +0 -0
  79. rtpbench-0.3.0/corpus/tts-libritts0-s06.wav +0 -0
  80. rtpbench-0.3.0/corpus/tts-libritts0-s10.wav +0 -0
  81. rtpbench-0.3.0/corpus/tts-libritts3-bc.wav +0 -0
  82. rtpbench-0.3.0/corpus/tts-libritts3-long.wav +0 -0
  83. rtpbench-0.3.0/corpus/tts-libritts3-s03.wav +0 -0
  84. rtpbench-0.3.0/corpus/tts-libritts3-s07.wav +0 -0
  85. rtpbench-0.3.0/corpus/tts-libritts3-s11.wav +0 -0
  86. rtpbench-0.3.0/corpus/tts-ljspeech-bc.wav +0 -0
  87. rtpbench-0.3.0/corpus/tts-ljspeech-long.wav +0 -0
  88. rtpbench-0.3.0/corpus/tts-ljspeech-s00.wav +0 -0
  89. rtpbench-0.3.0/corpus/tts-ljspeech-s04.wav +0 -0
  90. rtpbench-0.3.0/corpus/tts-ljspeech-s08.wav +0 -0
  91. rtpbench-0.3.0/corpus/tts-sharvardf-bc.wav +0 -0
  92. rtpbench-0.3.0/corpus/tts-sharvardf-long.wav +0 -0
  93. rtpbench-0.3.0/corpus/tts-sharvardf-s02.wav +0 -0
  94. rtpbench-0.3.0/corpus/tts-sharvardf-s06.wav +0 -0
  95. rtpbench-0.3.0/corpus/tts-sharvardf-s10.wav +0 -0
  96. rtpbench-0.3.0/corpus/tts-sharvardm-bc.wav +0 -0
  97. rtpbench-0.3.0/corpus/tts-sharvardm-long.wav +0 -0
  98. rtpbench-0.3.0/corpus/tts-sharvardm-s01.wav +0 -0
  99. rtpbench-0.3.0/corpus/tts-sharvardm-s05.wav +0 -0
  100. rtpbench-0.3.0/corpus/tts-sharvardm-s09.wav +0 -0
  101. rtpbench-0.3.0/mock/compose.yaml +18 -0
  102. rtpbench-0.3.0/pyproject.toml +67 -0
  103. rtpbench-0.3.0/src/rtpbench/__init__.py +6 -0
  104. rtpbench-0.3.0/src/rtpbench/__main__.py +3 -0
  105. rtpbench-0.3.0/src/rtpbench/agent.py +746 -0
  106. rtpbench-0.3.0/src/rtpbench/analyze.py +520 -0
  107. rtpbench-0.3.0/src/rtpbench/bargein.py +272 -0
  108. rtpbench-0.3.0/src/rtpbench/bench.py +1069 -0
  109. rtpbench-0.3.0/src/rtpbench/caller.py +781 -0
  110. rtpbench-0.3.0/src/rtpbench/capture.py +33 -0
  111. rtpbench-0.3.0/src/rtpbench/cases.py +1989 -0
  112. rtpbench-0.3.0/src/rtpbench/check.py +369 -0
  113. rtpbench-0.3.0/src/rtpbench/cli.py +616 -0
  114. rtpbench-0.3.0/src/rtpbench/clock.py +174 -0
  115. rtpbench-0.3.0/src/rtpbench/detect.py +145 -0
  116. rtpbench-0.3.0/src/rtpbench/g711.py +82 -0
  117. rtpbench-0.3.0/src/rtpbench/pcap.py +106 -0
  118. rtpbench-0.3.0/src/rtpbench/progress.py +184 -0
  119. rtpbench-0.3.0/src/rtpbench/realtime.py +1015 -0
  120. rtpbench-0.3.0/src/rtpbench/report.py +450 -0
  121. rtpbench-0.3.0/src/rtpbench/rtp.py +166 -0
  122. rtpbench-0.3.0/src/rtpbench/sip.py +653 -0
  123. rtpbench-0.3.0/src/rtpbench/speech.py +100 -0
  124. rtpbench-0.3.0/src/rtpbench/speechcal.py +367 -0
  125. rtpbench-0.3.0/src/rtpbench/srtp.py +191 -0
  126. rtpbench-0.3.0/src/rtpbench/tls.py +284 -0
  127. rtpbench-0.3.0/src/rtpbench/voice.py +18 -0
  128. rtpbench-0.3.0/targets/aivc/aivc.ini +25 -0
  129. rtpbench-0.3.0/targets/aivc/compose.yaml +72 -0
  130. rtpbench-0.3.0/targets/aivc/constraints.txt +52 -0
  131. rtpbench-0.3.0/targets/aivc/opensips.cfg +45 -0
  132. rtpbench-0.3.0/targets/ava/ai-agent.yaml +275 -0
  133. rtpbench-0.3.0/targets/ava/ari.conf +7 -0
  134. rtpbench-0.3.0/targets/ava/compose.yaml +128 -0
  135. rtpbench-0.3.0/targets/ava/constraints.txt +75 -0
  136. rtpbench-0.3.0/targets/ava/extensions.conf +10 -0
  137. rtpbench-0.3.0/targets/ava/http.conf +4 -0
  138. rtpbench-0.3.0/targets/ava/pjsip.conf +19 -0
  139. rtpbench-0.3.0/targets/ava/websocket_client.conf +15 -0
  140. rtpbench-0.3.0/targets/livekit/agent.py +111 -0
  141. rtpbench-0.3.0/targets/livekit/compose.yaml +86 -0
  142. rtpbench-0.3.0/targets/livekit/constraints.txt +72 -0
  143. rtpbench-0.3.0/tests/test_bargein.py +111 -0
  144. rtpbench-0.3.0/tests/test_cases.py +626 -0
  145. rtpbench-0.3.0/tests/test_check.py +263 -0
  146. rtpbench-0.3.0/tests/test_cli.py +178 -0
  147. rtpbench-0.3.0/tests/test_clock.py +230 -0
  148. rtpbench-0.3.0/tests/test_images.py +64 -0
  149. rtpbench-0.3.0/tests/test_progress.py +71 -0
  150. rtpbench-0.3.0/tests/test_realtime.py +272 -0
  151. rtpbench-0.3.0/tests/test_report.py +48 -0
  152. rtpbench-0.3.0/tests/test_speech.py +81 -0
  153. rtpbench-0.3.0/tests/test_speechcal.py +103 -0
  154. rtpbench-0.3.0/tests/test_srtp.py +91 -0
  155. rtpbench-0.3.0/tests/test_timing.py +170 -0
  156. rtpbench-0.3.0/tests/test_tls.py +190 -0
  157. rtpbench-0.3.0/tests/test_wheel.py +40 -0
  158. rtpbench-0.3.0/tests/test_wire.py +366 -0
  159. rtpbench-0.3.0/uri/advertise.yaml +7 -0
  160. rtpbench-0.3.0/uri/network.yaml +14 -0
@@ -0,0 +1,4 @@
1
+ *
2
+ !src/rtpbench/*.py
3
+ !*.py
4
+ !corpus/**/*.wav
@@ -0,0 +1,14 @@
1
+ __pycache__/
2
+ .venv*/
3
+ .*_cache/
4
+ dist/
5
+ *.pcap
6
+ *.pcapng
7
+ results/*
8
+ !results/baseline/
9
+ !results/metrology/
10
+ !results/media-path/
11
+ !results/tls-srtp/
12
+ !results/ava/
13
+ !results/aivc-b95f5af/
14
+ !results/retransmit/
@@ -0,0 +1,12 @@
1
+ FROM python:3.14-slim@sha256:a2b82f3c48559aa0a8446d9af49826b6e2b2016f4cd2afabfe6013ec53729170
2
+ RUN apt-get update \
3
+ && apt-get install -y --no-install-recommends iproute2 iptables tcpdump \
4
+ && rm -rf /var/lib/apt/lists/*
5
+ # TLS records and SRTP need AES, which the standard library lacks; pinned as uv.lock pins them
6
+ RUN pip install --no-cache-dir cryptography==50.0.2 cffi==2.1.1 pycparser==3.11
7
+ # the package in the build context: a checkout's src/rtpbench, or an installed rtpbench's own
8
+ # directory (.), which holds this file and the corpus too
9
+ ARG RTPBENCH_SRC=src/rtpbench
10
+ COPY ${RTPBENCH_SRC}/*.py /app/src/rtpbench/
11
+ COPY corpus /app/corpus
12
+ ENV PYTHONPATH=/app/src PYTHONUNBUFFERED=1
rtpbench-0.3.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,123 @@
1
+ Metadata-Version: 2.5
2
+ Name: rtpbench
3
+ Version: 0.3.0
4
+ Summary: Wire-level latency and conformance tests for voice agents over SIP/RTP
5
+ Author-email: Juanjo Aroztegi <juanjo@aroztegi.com>
6
+ License-Expression: Apache-2.0
7
+ License-File: LICENSE
8
+ Requires-Python: >=3.14
9
+ Requires-Dist: cryptography>=50
10
+ Requires-Dist: rich>=15
11
+ Provides-Extra: vad
12
+ Requires-Dist: onnxruntime>=1.31; extra == 'vad'
13
+ Requires-Dist: webrtcvad-wheels>=2.0.14; extra == 'vad'
14
+ Description-Content-Type: text/markdown
15
+
16
+ # rtpbench
17
+
18
+ Wire-level latency and conformance tests for voice agents over SIP/RTP.
19
+
20
+ rtpbench calls a voice agent over SIP, captures the RTP on both ends, and measures turn latency,
21
+ barge-in and SIP behaviour from the packets themselves, on clean and impaired networks
22
+ (`tc netem`). Every measurement carries an error bar calibrated against a reference agent that
23
+ logs the truth, and every case is proven against that agent, passing and failing:
24
+ `rtpbench cases` runs that proof on your host.
25
+
26
+ Status: early; commands and result formats can still change between releases.
27
+
28
+ ## What it found
29
+
30
+ Three open-source ways to put the OpenAI Realtime API on a SIP call, through 24 cases, with and
31
+ without a carrier in front, on a mock engine that holds the AI engine's share of each turn fixed:
32
+
33
+ | | [LiveKit](https://github.com/livekit/sip) | [AI Voice Connector CE](https://github.com/OpenSIPS/opensips-ai-voice-connector-ce) at b95f5af | Asterisk + [AVA](https://github.com/hkjarral/AVA-AI-Voice-Agent-for-Asterisk) |
34
+ | --- | --- | --- | --- |
35
+ | cases failed of 24 | 5, and 2 unsupported | 5, 3 unsupported and 1 inconclusive | 4, and 3 inconclusive |
36
+ | turn latency, clean, p50 | 1833 ms | 1511 ms | 1588 ms |
37
+ | its own media path per turn, p50 | 335 ms | 9 ms | 88 ms |
38
+ | stops for an interruption, clean, p50 | 306 ms | 24 ms | never |
39
+
40
+ The counts take every profile, direct and through the carrier. Run direct only, as
41
+ `target NAME --mock` does by default, LiveKit fails 4: `late-offer` fails only through the
42
+ carrier. All three pass the 3 cases for lost SIP messages, run direct on a clean network.
43
+ Unsupported is an optional feature declined as its RFC allows, with the call unharmed:
44
+ LiveKit refuses DTMF by SIP INFO (405), AI Voice Connector CE refuses it (501) and negotiates no
45
+ RFC 4733 events, and neither takes session timers. LiveKit does negotiate RFC 4733 events, but
46
+ the digit never reaches the engine: a failure.
47
+
48
+ - LiveKit keeps sending audio to a held caller in every kind of hold, AI Voice Connector CE when
49
+ held with `c=0.0.0.0`, and both answer a re-INVITE that changes codec with the old codec. AVA
50
+ sends RTP only while it speaks, so whether its media resumes after a hold cannot be judged.
51
+ - LiveKit's extra latency is its own media path: 326 ms per turn more than AI Voice Connector
52
+ CE's, against 322 ms between their turn latencies.
53
+ - LiveKit's RTP falls 20 ms behind its own timestamps 4 s into every call, so a receiver needs a
54
+ 21 ms jitter buffer for it on a clean network; AI Voice Connector CE's needs 1.1 ms.
55
+ - AI Voice Connector CE delivers the engine's speech sample for sample. LiveKit re-encodes it on
56
+ the way, through its WebRTC room, and on a clean network stretches or cuts a pause by 20-40 ms
57
+ in 6% of answers (10% in a second wave).
58
+ - AVA, as its golden configuration ships, cuts the last 0.8 s of every answer, and it never
59
+ stops for an interruption: it keeps the caller's audio from the engine while it speaks. Over
60
+ AudioSocket under packet loss, the engine sometimes got silence instead of the caller, so 5 more
61
+ cases fail now and then.
62
+ - AI Voice Connector CE's main branch fixed 4 of the 10 cases it failed in the baseline (a failed
63
+ transfer no longer hangs up on the caller; compact headers, a bare `a=ssrc` and SIP over TCP
64
+ are taken), and now declines a DTMF INFO with 501 where it left it unanswered. It still
65
+ refuses an INVITE without SDP and answers no re-INVITE without one.
66
+
67
+ The details, commands, conditions and raw runs are in [the baseline](results/baseline),
68
+ [AI Voice Connector CE at b95f5af](results/aivc-b95f5af), [Asterisk + AVA](results/ava) and
69
+ [lost SIP messages](results/retransmit), and every call's timeline on
70
+ [the results site](https://jjaroztegi.github.io/rtpbench/).
71
+
72
+ Common ways of measuring turn latency have errors of their own: measured inside the agent, a turn
73
+ misses the network (80 ms on an LTE path); an energy rule on a recording reads turns long, by
74
+ 87-110 ms at the median. Each method against the truth: [metrology](results/metrology).
75
+
76
+ ## Quick start
77
+
78
+ Needs Linux, Docker 28 or later with Compose, and [uv](https://docs.astral.sh/uv/). WSL2 runs
79
+ it, but its clock can drift and step by far more than the error bars: read what `calibrate`
80
+ warns about first ([clock steps and rate](docs/calibration.md#clock-steps-and-rate)).
81
+
82
+ ```sh
83
+ uvx rtpbench calibrate --profiles clean --turns 5 # how exactly this host times the wire
84
+ uvx 'rtpbench[vad]' cases # prove every case against the reference agent
85
+ uvx 'rtpbench[vad]' target livekit --mock # a bundled target, no AI account needed
86
+ uvx 'rtpbench[vad]' target sip:agent@host # an agent of your own, the same way
87
+ ```
88
+
89
+ The first three take about 1, 17 and 11 minutes, after pulling about 0.4 GB of Docker images
90
+ (compressed) on first use; every target and the carrier take 1.5 GB
91
+ ([images](docs/README.md#images)). The last needs an agent that answers SIP; [your own
92
+ agent](docs/targets.md#your-own-agent) says what it needs, such as `--network` for one in Docker on
93
+ this host.
94
+
95
+ Each run writes `results/<timestamp>/` with the captures, `summary.md` and, for cases,
96
+ `report.html`: a timeline of every call's SIP, speech and RTP. `rtpbench index` links every run
97
+ under `results/` from `results/index.html`; `rtpbench COMMAND --help` lists a command's options,
98
+ defaults and valid names.
99
+
100
+ ## Documentation
101
+
102
+ - [Calibration](docs/calibration.md): error bars, clock steps, network profiles and their sources
103
+ - [Conformance cases](docs/cases.md): what each case checks
104
+ - [Targets, your own agent, the mock engine and the carrier](docs/targets.md)
105
+ - [CI](docs/ci.md): pass or fail your agent's run against a policy
106
+
107
+ ## Development
108
+
109
+ From a clone, `uv run rtpbench` (`uv run --extra vad rtpbench` for `[vad]`) runs the checkout's
110
+ code, as the docs show it:
111
+
112
+ ```sh
113
+ uv sync
114
+ uv run ruff format && uv run ruff check --fix
115
+ uv run mypy
116
+ uv run pytest
117
+ ```
118
+
119
+ ## Licence
120
+
121
+ Apache-2.0, except `targets/aivc/opensips.cfg`, derived from AI Voice Connector CE's example and
122
+ under its GPL-3.0-or-later, and `targets/ava/ai-agent.yaml`, derived from AVA's golden OpenAI
123
+ configuration and under its MIT licence.
@@ -0,0 +1,108 @@
1
+ # rtpbench
2
+
3
+ Wire-level latency and conformance tests for voice agents over SIP/RTP.
4
+
5
+ rtpbench calls a voice agent over SIP, captures the RTP on both ends, and measures turn latency,
6
+ barge-in and SIP behaviour from the packets themselves, on clean and impaired networks
7
+ (`tc netem`). Every measurement carries an error bar calibrated against a reference agent that
8
+ logs the truth, and every case is proven against that agent, passing and failing:
9
+ `rtpbench cases` runs that proof on your host.
10
+
11
+ Status: early; commands and result formats can still change between releases.
12
+
13
+ ## What it found
14
+
15
+ Three open-source ways to put the OpenAI Realtime API on a SIP call, through 24 cases, with and
16
+ without a carrier in front, on a mock engine that holds the AI engine's share of each turn fixed:
17
+
18
+ | | [LiveKit](https://github.com/livekit/sip) | [AI Voice Connector CE](https://github.com/OpenSIPS/opensips-ai-voice-connector-ce) at b95f5af | Asterisk + [AVA](https://github.com/hkjarral/AVA-AI-Voice-Agent-for-Asterisk) |
19
+ | --- | --- | --- | --- |
20
+ | cases failed of 24 | 5, and 2 unsupported | 5, 3 unsupported and 1 inconclusive | 4, and 3 inconclusive |
21
+ | turn latency, clean, p50 | 1833 ms | 1511 ms | 1588 ms |
22
+ | its own media path per turn, p50 | 335 ms | 9 ms | 88 ms |
23
+ | stops for an interruption, clean, p50 | 306 ms | 24 ms | never |
24
+
25
+ The counts take every profile, direct and through the carrier. Run direct only, as
26
+ `target NAME --mock` does by default, LiveKit fails 4: `late-offer` fails only through the
27
+ carrier. All three pass the 3 cases for lost SIP messages, run direct on a clean network.
28
+ Unsupported is an optional feature declined as its RFC allows, with the call unharmed:
29
+ LiveKit refuses DTMF by SIP INFO (405), AI Voice Connector CE refuses it (501) and negotiates no
30
+ RFC 4733 events, and neither takes session timers. LiveKit does negotiate RFC 4733 events, but
31
+ the digit never reaches the engine: a failure.
32
+
33
+ - LiveKit keeps sending audio to a held caller in every kind of hold, AI Voice Connector CE when
34
+ held with `c=0.0.0.0`, and both answer a re-INVITE that changes codec with the old codec. AVA
35
+ sends RTP only while it speaks, so whether its media resumes after a hold cannot be judged.
36
+ - LiveKit's extra latency is its own media path: 326 ms per turn more than AI Voice Connector
37
+ CE's, against 322 ms between their turn latencies.
38
+ - LiveKit's RTP falls 20 ms behind its own timestamps 4 s into every call, so a receiver needs a
39
+ 21 ms jitter buffer for it on a clean network; AI Voice Connector CE's needs 1.1 ms.
40
+ - AI Voice Connector CE delivers the engine's speech sample for sample. LiveKit re-encodes it on
41
+ the way, through its WebRTC room, and on a clean network stretches or cuts a pause by 20-40 ms
42
+ in 6% of answers (10% in a second wave).
43
+ - AVA, as its golden configuration ships, cuts the last 0.8 s of every answer, and it never
44
+ stops for an interruption: it keeps the caller's audio from the engine while it speaks. Over
45
+ AudioSocket under packet loss, the engine sometimes got silence instead of the caller, so 5 more
46
+ cases fail now and then.
47
+ - AI Voice Connector CE's main branch fixed 4 of the 10 cases it failed in the baseline (a failed
48
+ transfer no longer hangs up on the caller; compact headers, a bare `a=ssrc` and SIP over TCP
49
+ are taken), and now declines a DTMF INFO with 501 where it left it unanswered. It still
50
+ refuses an INVITE without SDP and answers no re-INVITE without one.
51
+
52
+ The details, commands, conditions and raw runs are in [the baseline](results/baseline),
53
+ [AI Voice Connector CE at b95f5af](results/aivc-b95f5af), [Asterisk + AVA](results/ava) and
54
+ [lost SIP messages](results/retransmit), and every call's timeline on
55
+ [the results site](https://jjaroztegi.github.io/rtpbench/).
56
+
57
+ Common ways of measuring turn latency have errors of their own: measured inside the agent, a turn
58
+ misses the network (80 ms on an LTE path); an energy rule on a recording reads turns long, by
59
+ 87-110 ms at the median. Each method against the truth: [metrology](results/metrology).
60
+
61
+ ## Quick start
62
+
63
+ Needs Linux, Docker 28 or later with Compose, and [uv](https://docs.astral.sh/uv/). WSL2 runs
64
+ it, but its clock can drift and step by far more than the error bars: read what `calibrate`
65
+ warns about first ([clock steps and rate](docs/calibration.md#clock-steps-and-rate)).
66
+
67
+ ```sh
68
+ uvx rtpbench calibrate --profiles clean --turns 5 # how exactly this host times the wire
69
+ uvx 'rtpbench[vad]' cases # prove every case against the reference agent
70
+ uvx 'rtpbench[vad]' target livekit --mock # a bundled target, no AI account needed
71
+ uvx 'rtpbench[vad]' target sip:agent@host # an agent of your own, the same way
72
+ ```
73
+
74
+ The first three take about 1, 17 and 11 minutes, after pulling about 0.4 GB of Docker images
75
+ (compressed) on first use; every target and the carrier take 1.5 GB
76
+ ([images](docs/README.md#images)). The last needs an agent that answers SIP; [your own
77
+ agent](docs/targets.md#your-own-agent) says what it needs, such as `--network` for one in Docker on
78
+ this host.
79
+
80
+ Each run writes `results/<timestamp>/` with the captures, `summary.md` and, for cases,
81
+ `report.html`: a timeline of every call's SIP, speech and RTP. `rtpbench index` links every run
82
+ under `results/` from `results/index.html`; `rtpbench COMMAND --help` lists a command's options,
83
+ defaults and valid names.
84
+
85
+ ## Documentation
86
+
87
+ - [Calibration](docs/calibration.md): error bars, clock steps, network profiles and their sources
88
+ - [Conformance cases](docs/cases.md): what each case checks
89
+ - [Targets, your own agent, the mock engine and the carrier](docs/targets.md)
90
+ - [CI](docs/ci.md): pass or fail your agent's run against a policy
91
+
92
+ ## Development
93
+
94
+ From a clone, `uv run rtpbench` (`uv run --extra vad rtpbench` for `[vad]`) runs the checkout's
95
+ code, as the docs show it:
96
+
97
+ ```sh
98
+ uv sync
99
+ uv run ruff format && uv run ruff check --fix
100
+ uv run mypy
101
+ uv run pytest
102
+ ```
103
+
104
+ ## Licence
105
+
106
+ Apache-2.0, except `targets/aivc/opensips.cfg`, derived from AI Voice Connector CE's example and
107
+ under its GPL-3.0-or-later, and `targets/ava/ai-agent.yaml`, derived from AVA's golden OpenAI
108
+ configuration and under its MIT licence.
@@ -0,0 +1,68 @@
1
+ # A carrier between the router and the agent (the reference agent or a target), merged over
2
+ # ../compose.yaml: OpenSIPS as an SBC (stateful proxy with topology hiding) and rtpengine
3
+ # anchoring the media, as real trunks put in front of a PBX. `carrier` owns the network namespace
4
+ # on agentnet, so caller <-> carrier crosses the netem router and carrier <-> agent does not.
5
+ # rtpbench sets RTPBENCH_CARRIER_NEXT to the agent's host (and RTPBENCH_CARRIER_PORT, its SIP
6
+ # port, for an agent outside the stack, which the carrier reaches through Docker's gateway).
7
+ # Paths are relative to the first compose file's directory.
8
+ services:
9
+ carrier:
10
+ image: ${RTPBENCH_IMAGE:?}
11
+ cap_add: [NET_ADMIN]
12
+ init: true
13
+ depends_on: [router]
14
+ networks: [agentnet]
15
+ volumes: ["${RTPBENCH_OUT:?}:/out"]
16
+ command: sh -c 'ip route replace default via $$(getent hosts router | cut -d" " -f1) && exec sleep infinity'
17
+
18
+ carrier-media:
19
+ build:
20
+ # neither build copies a file, but the tag hashes the context's: not the whole repository
21
+ context: ./carrier
22
+ dockerfile_inline: |
23
+ FROM debian:trixie@sha256:913f6706df59a68922d1dd08f78c2476560a8d367897200a6005b00e5f67c2d5
24
+ RUN apt-get update \
25
+ && apt-get install -y --no-install-recommends rtpengine-daemon=12.5.1.31-1 \
26
+ && rm -rf /var/lib/apt/lists/*
27
+ image: ${RTPBENCH_REGISTRY:?}/rtpbench-rtpengine:12.5.1.31${RTPBENCH_BUILD_CARRIER_MEDIA:-}
28
+ network_mode: service:carrier
29
+ depends_on: [carrier]
30
+ # userspace forwarding (no kernel module in a container), media on the agentnet address
31
+ command: >-
32
+ rtpengine --foreground --log-stderr --table=-1 --interface=eth0
33
+ --listen-ng=127.0.0.1:2223 --port-min=30000 --port-max=30999
34
+ healthcheck: # its control socket (127.0.0.1:2223) bound; OpenSIPS disables a relay that
35
+ # does not answer its first ping, for a minute, and calls then bypass it
36
+ test: grep -q ' 0100007F:08AF 00000000:0000 07 ' /proc/net/udp
37
+ interval: 1s
38
+ retries: 20
39
+
40
+ carrier-sip:
41
+ build: # the same OpenSIPS, with its digest authentication and TLS modules (not in the image)
42
+ context: ./carrier
43
+ dockerfile_inline: |
44
+ FROM opensips/opensips:3.6@sha256:81a7fa3c7bdbceaadb7cb869ff7ac3f34efb2d95cd7fecb3b689d7b6b1eb0672
45
+ RUN apt-get update \
46
+ && apt-get install -y --no-install-recommends opensips-auth-modules=3.6.9-1 \
47
+ opensips-tls-module=3.6.9-1 opensips-tls-openssl-module=3.6.9-1 \
48
+ opensips-tlsmgm-module=3.6.9-1 \
49
+ && rm -rf /var/lib/apt/lists/*
50
+ image: ${RTPBENCH_REGISTRY:?}/rtpbench-opensips:3.6.9-1-tls${RTPBENCH_BUILD_CARRIER_SIP:-}
51
+ network_mode: service:carrier
52
+ depends_on:
53
+ carrier-media: {condition: service_healthy}
54
+ volumes: ["./carrier/opensips.cfg:/etc/opensips/opensips.cfg:ro"]
55
+ environment:
56
+ CARRIER_NEXT: ${RTPBENCH_CARRIER_NEXT:?}
57
+ CARRIER_NEXT_PORT: ${RTPBENCH_CARRIER_PORT:-5060}
58
+ CARRIER_NEXT_TRANSPORT: ${RTPBENCH_CARRIER_TRANSPORT:-udp}
59
+ # set, the carrier demands these credentials of the caller, as a trunk may
60
+ CARRIER_AUTH_USER: ${RTPBENCH_CARRIER_AUTH_USER:-}
61
+ CARRIER_AUTH_PASSWORD: ${RTPBENCH_CARRIER_AUTH_PASSWORD:-}
62
+ # set, it answers the agent's challenge with these
63
+ CARRIER_UAC_USER: ${RTPBENCH_CARRIER_UAC_USER:-}
64
+ CARRIER_UAC_PASSWORD: ${RTPBENCH_CARRIER_UAC_PASSWORD:-}
65
+ healthcheck:
66
+ test: opensips-cli -x mi sr_get_status core | grep -q running
67
+ interval: 1s
68
+ retries: 20