root/README

Revision 390, 12.8 kB (checked in by Dan Pascu <dan@ag-projects.com>, 3 months ago)

Removed start_time column from database accounting table

Line 
1
2MediaProxy
3----------
4
5Copyright (c) 2008 AG Projects
6http://ag-projects.com
7
8Authors: Ruud Klaver, Dan Pascu
9
10Home page: http://www.ag-projects.com/MediaProxy.html
11
12
13License
14-------
15
16This software is licensed according to the GNU General Public License
17version 2. See LICENSE file for more details.
18
19For other licensing options please contact sales-request@ag-projects.com
20
21
22Description
23-----------
24
25MediaProxy is a media relay for RTP/RTCP and UDP streams that works in
26tandem with OpenSIPS to provide NAT traversal capability for media streams
27from SIP user agents located behind NAT.
28
29When using MediaProxy, NAT traversal for RTP media will work without any
30settings in the SIP User Agents or the NAT router.
31
32
33Features
34--------
35
36 - Scalability of thousands of calls per server limited only by the Linux
37   kernel networking layer and network interface bandwidth
38 - Supports multiple chained relays as long as each has a public IP
39 - TLS encryption between the relays and dispatcher
40 - T.38 fax support
41 - Graceful shutdown capability
42 - Modular design for custom selection algorithms for the relay location
43 - Automatic load balancing and redundancy among all media relays
44 - Real-time sessions statistics
45 - Configurable IP and UDP port range
46 - Support for any combination of audio and video streams
47 - Ability to use OpenSIPS' MI interface to close a call that did timeout
48 - Radius accounting of IP network traffic
49 - Database accounting of complete media information including all streams,
50   their type, codecs and duration.
51
52
53Background
54-----------
55
56MediaProxy 2.0 is the second generation media relay application which is
57based on a completely new design that allows for major improvements in areas
58such as scalability (an order of magnitude more scalable than previous
59version) and security (communication between relay and dispatcher is
60encrypted).
61
62New features have been added to support call flows related to user mobility
63and fax transmission.
64
65
66Architecture
67------------
68
69MediaProxy consists of a dispatcher and one or more media relays.
70
71The dispatcher component always runs on the same host as OpenSIPS and
72communicates with its mediaproxy module through a UNIX domain socket. The
73relay(s) connect to the dispatcher using TLS. This relay component may be on
74the same or on a different host as OpenSIPS. There may be several relays for
75the dispatcher to choose from and a relay may service more than one
76dispatcher.
77
78When OpenSIPS requests that a call be relayed, the dispatcher will forward
79this request to one of its connected relays, along with some data from the
80SDP. The relay will allocate a set of UDP ports for this session, depending
81on the number of proposed streams. It will inform the dispatcher which ports
82it has allocated so that it may in turn notify the mediaproxy module of
83OpenSIPS, which will replace the relevant parts of the SDP.
84
85The same is done for any SIP messages from the callee, thus all the media
86streams will be sent through the relay. When the session between caller and
87callee has finished, either through a SIP BYE or because the media is no
88longer flowing and has timed out, the relay will send session information to
89the dispatcher, which can store this information using one or more accounting
90modules.
91
92The session information may also be queried using a management interface on
93the dispatcher.
94
95All of this is illustrated in the following diagram:
96
97  +---+                                              +---+
98  |   |   +---------------------+                    |   |
99  |   |   |           SIP Proxy |                    |   |
100  |   |   |  +----------+       |        SIP         |   |
101  |   |<--+->| OpenSIPS |<------+------------------->|   |
102  |   |   |  +----------+       |                    |   |
103  |   |   |       ^             |                    |   |
104  |   |   |       | UNIX socket |                    |   |
105  | C |   |       v             |                    | C |
106  | A |   | +------------+      |   +------------+   | A |
107  | L |   | | Dispatcher |<-----+-->| Management |   | L |
108  | L |   | +------------+  TCP |   |   client   |   | L |
109  | E |   |         ^      /TLS |   +------------+   | E |
110  | R |   |         |           |                    | E |
111  |   |   +---------+-----------+                    |   |
112  |   |             |                                |   |
113  |   |             | TLS                            |   |
114  |   |             v                                |   |
115  |   |      +-------------+           UDP           |   |
116  |   |<---->|    Relay    |<----------------------->|   |
117  |   |      +-------------+        RTP / RTCP       |   |
118  +---+                                              +---+
119
120Please note that the accounting modules are not shown.
121
122
123Compatibility and pre-requisites
124--------------------------------
125
126To run the software, you will need a server running the Linux Operating
127System using a kernel version 2.6.18 or higher that has been compiled with
128connection tracking support (conntrack). Because of this dependency on
129Linux, other operating systems are not supported. This dependency only
130applies to the media relay component. The dispatcher component which runs on
131the same host as OpenSIPS, can run on any platform that has a python
132interpreter and supports the twisted framework.
133
134Communication between the dispatcher and the relays uses TLS encryption and
135requires a set of X509 certificates to work. For more information about this
136please read tls/README which contains information about the sample certificates
137that are included as well as information about how to generate your own.
138
139MediaProxy is meant to be used together with OpenSIPS' mediaproxy module.
140
141This version of MediaProxy (2.0 or higher) cannot be used in combination
142with any version of OpenSIPS older than 1.4 or any components of MediaProxy
143older than 2.0. You must completely upgrade any previous installation of
144OpenSER to OpenSIPS to use this version of MediaProxy.
145
146No STUN or TURN support are required in the clients.
147
148The SIP User Agents must work symmetrically (that is to send and receive
149data on the same port for each stream), which is documented in RFC 4961.
150
151To display the history of the media streams CDRTool 6.5 or higher is
152required.
153
154Some features that were present in the previous version have been removed:
155
156- Support for specifying media relays per domain has been discontinued
157- Support for DNS records has been discontinued
158- Support for asymmetric clients has been discontinued
159- Support for other operating systems than Linux has been discontinued
160  (only for the media relay, as the dispatcher has no such limitation)
161
162For information of how to install MediaProxy, please consult the INSTALL
163file.
164
165
166Operation
167---------
168
169Before the relay is run, please make sure that /proc/sys/net/ipv4/ip_forward
170is set to "1".
171
172Both the dispatcher and the relay should be executed with root privileges.
173With no arguments, both applications will automatically fork into the
174background and log to syslog. They can remain in the foreground and log to
175console when given the --no-fork argument.
176
177The relay can be shut down in two ways. When receiving either an INT or TERM
178signal, the relay will terminate all of its sessions immediately and inform
179the dispatcher that those sessions have expired. When given the HUP signal,
180it will not accept any new sessions from the dispatcher and wait for all of
181the running sessions to expire, thus terminating gracefully.
182
183At the very least a set of TLS credentials is required. Sample certificates
184for this are included in the tls/ subdirectory.
185DO NOT USE THESE IN A PRODUCTION ENVIRONMENT, but only for testing purposes.
186
187For more information about TLS certificates and how to generate your own,
188check the tls/README file.
189
190
191Accounting
192----------
193
194MediaProxy is capable to do additional per call accounting with information
195related to the media streams used by the call. MediaProxy has a modular
196interface to the accounting system, allowing for new modules to be easily
197implemented. Currently it supports database and radius backends. Multiple
198backends can be configured and used simultaneously.
199
200
201Radius accounting
202-----------------
203
204The radius backend logs very basic information about the media streams. The
205limited nature of the logged information is mainly given by the limitations
206imposed by the radius protocol to the data size.
207
208The information sent in the radius packet is shown below:
209
210  Acct-Status-Type = "Update"
211  User-Name = "mediaproxy@default"
212  Acct-Session-Id = call_id
213  Sip-From-Tag = from_tag
214  Sip-To-Tag = to_tag
215  Acct-Session-Time = call duration
216  Acct-Input-Octets = bytes received from caller
217  Acct-Output-Octets = bytes received from callee
218  NAS-IP-Address = media-relay address
219  Sip-User-Agents = caller + callee user agents
220  Sip-Applications = "Audio", "Video", ...
221  Media-Codecs = codecs used by streams (comma separated)
222  Media-Info = "timeout" or ""
223  Acct-Delay-Time = post dial delay (seconds from INVITE to 1st media packet)
224
225
226Database accounting
227-------------------
228
229The database backend logs all the information related to the media streams that
230were created/closed during the whole session. This information is stored as a
231JSON encoded string in a BLOB column in the database, along with the call_id,
232from_tag and to_tag columns that can be used to retrieve the media information
233for a given call. The database table and column names are fully configurable
234in the database section of the configuration file.
235
236The table used to store these records, is automatically created by the media
237dispatcher on startup, if it's not present. For this to happen, the user that
238is configured in the dburi option in the database section, must have the CREATE
239and ALTER rights on the database specified in the same dburi. If this is not
240possible, then the media dispatcher will log an error indicating why it could
241not create the table and also output the table definition that can be used by
242some human operator to manually create the table. However, the recommended
243way is to grant the CREATE and ALTER privileges to the user in the dburi over
244the database specified in the same dburi.
245
246The database module uses SQLObject to access the database, which means it can
247work with a lot of databases, by simply changing the scheme in the dburi.
248Currently the following databases are supported: mysql, postgres, sqlite,
249firebird, maxdb, mssql and sybase.
250
251
252Closing expired calls
253---------------------
254
255Starting with version 2.1.0, MediaProxy supports closing calls for which all
256the media streams did timeout, but for which no BYE was received to close the
257call in the standard way.
258
259This feature will only work, when the OpenSIPS mediaproxy module uses the
260engage_media_proxy() command to start MediaProxy for a given call. In this
261case the mediaproxy module uses the dialog module to keep track of the call
262and can pass the dialog id to the media dispatcher. When a media session is
263expired because all streams did timeout, but no closing request was received
264from the proxy, the media dispatcher will use the dialog id that was received
265from the mediaproxy module, to issue a dlg_end_dlg request into the OpenSIPS'
266MI interface, instructing OpenSIPS to generate the BYEs for the call, closing
267it in a clean way and generating the accounting records.
268
269To use this, the mi_datagram module must be loaded and configured to use a
270UNIX filesystem socket which must also be configured into the OpenSIPS section
271of the MediaProxy configuration as socket_path.
272
273This feature is not available when using the use_media_proxy/end_media_session
274functions in the proxy configuration, because in that case there is no dialog
275that is tracked by the proxy which could be terminated using dlg_end_dlg.
276
277
278Management interface
279--------------------
280
281The management interface will accept commands terminated by \r\n. It will
282return the results of the command, one per line, terminated by an empty
283line (also \r\n terminated).
284
285Currently two commands are supported:
286
287sessions : This will have the dispatcher query all of its connected relays
288           for active sessions. For every sessions it finds it will return
289           one line with a JSON encoded dictionary containing session
290           information.
291
292summary  : This will have the dispatcher present a summary of each of its
293           connected relays. The results are returned as a JSON encoded
294           dictionary, one line per relay.
295
296
297Free support
298------------
299
300MediaProxy is developed and supported by AG Projects. AG Projects offers
301best-effort free support for MediaProxy. "best-effort" means that we try to
302solve the bugs you report or help fix your problems as soon as we can,
303subject to available resources.
304
305You may report bugs or feature request to:
306
307users@lists.opensips.org
308
309A mailing list archive is available at:
310http://lists.opensips.org/cgi-bin/mailman/listinfo/users
311
312
313Commercial support
314------------------
315
316Commercial support options are available by purchasing:
317
3181. Multimedia Service Platform: http://ag-projects.com/Products or
3192. MediaProxy and support: https://secure.dns-hosting.info/buyer_guide.phtml
Note: See TracBrowser for help on using the browser.