-
Notifications
You must be signed in to change notification settings - Fork 564
/
README
203 lines (148 loc) · 6.91 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
B2B SDP De-Multiplexer Module
__________________________________________________________
Table of Contents
1. Admin Guide
1.1. Overview
1.2. Use Cases
1.3. Dependencies
1.3.1. OpenSIPS Modules
1.3.2. External Libraries or Applications
1.4. Exported Parameters
1.4.1. client_bye_mode (string)
1.5. Exported Functions
1.5.1. b2b_sdp_demux(URI[, [headers][, streams]])
2. Contributors
2.1. By Commit Statistics
2.2. By Commit Activity
3. Documentation
3.1. Contributors
List of Tables
2.1. Top contributors by DevScore^(1), authored commits^(2) and
lines added/removed^(3)
2.2. Most recently active contributors^(1) to this module
List of Examples
1.1. Set client_bye_mode parameter
1.2. Use b2b_sdp_demux() to handle an audio SIPREC call
Chapter 1. Admin Guide
1.1. Overview
This module provides the logic to convert a multi-stream SDP
call, to multiple calls, each containing a subset of streams
from the initial call. The module only handles the SIP
signalling part of the call, without interfering with the media
of the call, which will flow end-to-end. The only manipulation
it does is at the SDP level to disable the media-streams that
are not being used downstream.
The logic is implemented on top of the B2B module, and
de-multiplexes a B2B server (the initial call with multiple
streams) to multiple B2B clients (with their own streams
subset). In-dialog requests that come from the initial caller
will be forked towards each client, and their replies
aggregated back to the caller. The other side in-dialog
requests are forwarded to the caller as if only their stream
had changed. When a call is terminated from the client side,
the module can have different behaviors, according to the
client_bye_mode parameter.
1.2. Use Cases
A common scenario where this module can become useful is when
configuring OpenSIPS as a SIPREC SRS proxy. Using this module
you can receive on one side SIPREC INVITEs, which usually have
two or more SDP streams (one for each call/conference
participants), and split/de-multiplex each stream in a new call
downstream, usually towards a media server that is able to do
call recording. This way the media server will have to handle
calls that contain a single media stream.
Another use case is balancing multiple streams to different
media servers. For example, if you are offering both audio and
video services, you can split a two-stream call (with an audio
and video stream) to two different calls, and send them to be
processed by different servers. This way you may have separated
audio-dedicated processing media servers, as well as
video-dedicated one. Of course, this can be achieved if you can
process the streams separately, for example for recording.
1.3. Dependencies
1.3.1. OpenSIPS Modules
The following modules must be loaded before this module:
* B2B_ENTITIES - Back-2-Back module used for handing server
and client side calls.
1.3.2. External Libraries or Applications
The following libraries or applications must be installed
before running OpenSIPS with this module loaded:
* None.
1.4. Exported Parameters
1.4.1. client_bye_mode (string)
This parameter indicates how a BYE coming from the client side
should be treated in the context of the upstream call.
Possible values are:
* disable - when a client terminates its call, the module
will simply disable the media streams associated with its
call, resulting in a re-INVITE upstream.
* terminate - when one client terminates its call, the module
will terminate all other calls, including the upstream one.
* disable-terminate - same as disable, except that when the
final stream is disabled, instead of a re-INVITE with all
streams disabled, the module sends a BYE upstream.
Default value is “disable”.
Example 1.1. Set client_bye_mode parameter
...
modparam("b2b_sdp_demux", "client_bye_mode", "terminate")
...
1.5. Exported Functions
1.5.1. b2b_sdp_demux(URI[, [headers][, streams]])
Engages the B2B SDP De-Multiplexing scenario for the calls it
has been triggered on.
Parameters:
* URI (string) - the URI where to send the newly generated
calls
* headers (AVP, optional) - an AVP containing multiple
values, each index corresponding to one of the new calls
generated by the function. The number of values in the AVP
should be equal to the number of calls resulted, otherwise
it may lead to an unexpected behavior. If missing, no extra
headers will be added.
* streams (AVP, optional) - an AVP containing multiple
values, each value indicating the media stream index that
should be used for the current client. If multiple streams
should be used for a single call, they should be specified
comma-separated (i.e. 0,2). The number of AVP values
represent the number of calls generated downstream. If the
parameter is missing, a call will be generated for each
stream present in the initial call.
This function can be used only from request route.
Example 1.2. Use b2b_sdp_demux() to handle an audio SIPREC call
...
if (!has_totag() && is_method("INVITE")) {
$avp(headers) = "X-Leg: caller\r\n");
$avp(headers) = "X-Leg: callee\r\n");
b2b_sdp_demux("sip:media@localhost", $avp(headers));
}
...
Chapter 2. Contributors
2.1. By Commit Statistics
Table 2.1. Top contributors by DevScore^(1), authored
commits^(2) and lines added/removed^(3)
Name DevScore Commits Lines ++ Lines --
1. Razvan Crainea (@razvancrainea) 81 50 2768 438
(1) DevScore = author_commits + author_lines_added /
(project_lines_added / project_commits) + author_lines_deleted
/ (project_lines_deleted / project_commits)
(2) including any documentation-related commits, excluding
merge commits. Regarding imported patches/code, we do our best
to count the work on behalf of the proper owner, as per the
"fix_authors" and "mod_renames" arrays in
opensips/doc/build-contrib.sh. If you identify any
patches/commits which do not get properly attributed to you,
please submit a pull request which extends "fix_authors" and/or
"mod_renames".
(3) ignoring whitespace edits, renamed files and auto-generated
files
2.2. By Commit Activity
Table 2.2. Most recently active contributors^(1) to this module
Name Commit Activity
1. Razvan Crainea (@razvancrainea) May 2021 - Aug 2022
(1) including any documentation-related commits, excluding
merge commits
Chapter 3. Documentation
3.1. Contributors
Last edited by: Razvan Crainea (@razvancrainea).
Documentation Copyrights:
Copyright © 2021-2022 Five9 Inc.