|
@@ -1,6 +1,6 @@
|
|
|
-/* $Id$
|
|
|
- *
|
|
|
+/*
|
|
|
* Copyright (C) 2003-2008 Sippy Software, Inc., http://www.sippysoft.com
|
|
|
+ * Copyright (C) 2014-2015 Sipwise GmbH, http://www.sipwise.com
|
|
|
*
|
|
|
* This file is part of Kamailio, a free SIP server.
|
|
|
*
|
|
@@ -17,152 +17,6 @@
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
- *
|
|
|
- * History:
|
|
|
- * ---------
|
|
|
- * 2003-10-09 nat_uac_test introduced (jiri)
|
|
|
- *
|
|
|
- * 2003-11-06 nat_uac_test permitted from onreply_route (jiri)
|
|
|
- *
|
|
|
- * 2003-12-01 unforce_rtp_proxy introduced (sobomax)
|
|
|
- *
|
|
|
- * 2004-01-07 RTP proxy support updated to support new version of the
|
|
|
- * RTP proxy (20040107).
|
|
|
- *
|
|
|
- * force_rtp_proxy() now inserts a special flag
|
|
|
- * into the SDP body to indicate that this session already
|
|
|
- * proxied and ignores sessions with such flag.
|
|
|
- *
|
|
|
- * Added run-time check for version of command protocol
|
|
|
- * supported by the RTP proxy.
|
|
|
- *
|
|
|
- * 2004-01-16 Integrated slightly modified patch from Tristan Colgate,
|
|
|
- * force_rtp_proxy function with IP as a parameter (janakj)
|
|
|
- *
|
|
|
- * 2004-01-28 nat_uac_test extended to allow testing SDP body (sobomax)
|
|
|
- *
|
|
|
- * nat_uac_test extended to allow testing top Via (sobomax)
|
|
|
- *
|
|
|
- * 2004-02-21 force_rtp_proxy now accepts option argument, which
|
|
|
- * consists of string of chars, each of them turns "on"
|
|
|
- * some feature, currently supported ones are:
|
|
|
- *
|
|
|
- * `a' - flags that UA from which message is received
|
|
|
- * doesn't support symmetric RTP;
|
|
|
- * `l' - force "lookup", that is, only rewrite SDP when
|
|
|
- * corresponding session is already exists in the
|
|
|
- * RTP proxy. Only makes sense for SIP requests,
|
|
|
- * replies are always processed in "lookup" mode;
|
|
|
- * `i' - flags that message is received from UA in the
|
|
|
- * LAN. Only makes sense when RTP proxy is running
|
|
|
- * in the bridge mode.
|
|
|
- *
|
|
|
- * force_rtp_proxy can now be invoked without any arguments,
|
|
|
- * as previously, with one argument - in this case argument
|
|
|
- * is treated as option string and with two arguments, in
|
|
|
- * which case 1st argument is option string and the 2nd
|
|
|
- * one is IP address which have to be inserted into
|
|
|
- * SDP (IP address on which RTP proxy listens).
|
|
|
- *
|
|
|
- * 2004-03-12 Added support for IPv6 addresses in SDPs. Particularly,
|
|
|
- * force_rtp_proxy now can work with IPv6-aware RTP proxy,
|
|
|
- * replacing IPv4 address in SDP with IPv6 one and vice versa.
|
|
|
- * This allows creating full-fledged IPv4<->IPv6 gateway.
|
|
|
- * See 4to6.cfg file for example.
|
|
|
- *
|
|
|
- * Two new options added into force_rtp_proxy:
|
|
|
- *
|
|
|
- * `f' - instructs nathelper to ignore marks inserted
|
|
|
- * by another nathelper in transit to indicate
|
|
|
- * that the session is already goes through another
|
|
|
- * proxy. Allows creating chain of proxies.
|
|
|
- * `r' - flags that IP address in SDP should be trusted.
|
|
|
- * Without this flag, nathelper ignores address in the
|
|
|
- * SDP and uses source address of the SIP message
|
|
|
- * as media address which is passed to the RTP proxy.
|
|
|
- *
|
|
|
- * Protocol between nathelper and RTP proxy in bridge
|
|
|
- * mode has been slightly changed. Now RTP proxy expects SER
|
|
|
- * to provide 2 flags when creating or updating session
|
|
|
- * to indicate direction of this session. Each of those
|
|
|
- * flags can be either `e' or `i'. For example `ei' means
|
|
|
- * that we received INVITE from UA on the "external" network
|
|
|
- * network and will send it to the UA on "internal" one.
|
|
|
- * Also possible `ie' (internal->external), `ii'
|
|
|
- * (internal->internal) and `ee' (external->external). See
|
|
|
- * example file alg.cfg for details.
|
|
|
- *
|
|
|
- * 2004-03-15 If the rtp proxy test failed (wrong version or not started)
|
|
|
- * retry test from time to time, when some *rtpproxy* function
|
|
|
- * is invoked. Minimum interval between retries can be
|
|
|
- * configured via rtpproxy_disable_tout module parameter (default
|
|
|
- * is 60 seconds). Setting it to -1 will disable periodic
|
|
|
- * rechecks completely, setting it to 0 will force checks
|
|
|
- * for each *rtpproxy* function call. (andrei)
|
|
|
- *
|
|
|
- * 2004-03-22 Fix assignment of rtpproxy_retr and rtpproxy_tout module
|
|
|
- * parameters.
|
|
|
- *
|
|
|
- * 2004-03-22 Fix get_body position (should be called before get_callid)
|
|
|
- * (andrei)
|
|
|
- *
|
|
|
- * 2004-03-24 Fix newport for null ip address case (e.g onhold re-INVITE)
|
|
|
- * (andrei)
|
|
|
- *
|
|
|
- * 2004-09-30 added received port != via port test (andrei)
|
|
|
- *
|
|
|
- * 2004-10-10 force_socket option introduced (jiri)
|
|
|
- *
|
|
|
- * 2005-02-24 Added support for using more than one rtp proxy, in which
|
|
|
- * case traffic will be distributed evenly among them. In addition,
|
|
|
- * each such proxy can be assigned a weight, which will specify
|
|
|
- * which share of the traffic should be placed to this particular
|
|
|
- * proxy.
|
|
|
- *
|
|
|
- * Introduce failover mechanism, so that if SER detects that one
|
|
|
- * of many proxies is no longer available it temporarily decreases
|
|
|
- * its weight to 0, so that no traffic will be assigned to it.
|
|
|
- * Such "disabled" proxies are periodically checked to see if they
|
|
|
- * are back to normal in which case respective weight is restored
|
|
|
- * resulting in traffic being sent to that proxy again.
|
|
|
- *
|
|
|
- * Those features can be enabled by specifying more than one "URI"
|
|
|
- * in the rtpproxy_sock parameter, optionally followed by the weight,
|
|
|
- * which if absent is assumed to be 1, for example:
|
|
|
- *
|
|
|
- * rtpproxy_sock="unix:/foo/bar=4 udp:1.2.3.4:3456=3 udp:5.6.7.8:5432=1"
|
|
|
- *
|
|
|
- * 2005-02-25 Force for pinging the socket returned by USRLOC (bogdan)
|
|
|
- *
|
|
|
- * 2005-03-22 support for multiple media streams added (netch)
|
|
|
- *
|
|
|
- * 2005-07-11 SIP ping support added (bogdan)
|
|
|
- *
|
|
|
- * 2005-07-14 SDP origin (o=) IP may be also changed (bogdan)
|
|
|
- *
|
|
|
- * 2006-03-08 fix_nated_sdp() may take one more param to force a specific IP;
|
|
|
- * force_rtp_proxy() accepts a new flag 's' to swap creation/
|
|
|
- * confirmation between requests/replies;
|
|
|
- * add_rcv_param() may take as parameter a flag telling if the
|
|
|
- * parameter should go to the contact URI or contact header;
|
|
|
- * (bogdan)
|
|
|
- * 2006-03-28 Support for changing session-level SDP connection (c=) IP when
|
|
|
- * media-description also includes connection information (bayan)
|
|
|
- * 2007-04-13 Support multiple sets of rtpproxies and set selection added
|
|
|
- * (ancuta)
|
|
|
- * 2007-04-26 Added some MI commands:
|
|
|
- * nh_enable_ping used to enable or disable natping
|
|
|
- * nh_enable_rtpp used to enable or disable a specific rtp proxy
|
|
|
- * nh_show_rtpp used to display information for all rtp proxies
|
|
|
- * (ancuta)
|
|
|
- * 2007-05-09 New function start_recording() allowing to start recording RTP
|
|
|
- * session in the RTP proxy (Carsten Bock - ported from SER)
|
|
|
- * 2007-09-11 Separate timer process and support for multiple timer processes
|
|
|
- * (bogdan)
|
|
|
- * 2008-12-12 Support for RTCP attribute in the SDP
|
|
|
- * (Min Wang/BASIS AudioNet - ported from SER)
|
|
|
- * 2010-08-05 Core SDP parser integrated into nathelper (osas)
|
|
|
- * 2010-10-08 Removal of deprecated force_rtp_proxy and swap flag (osas)
|
|
|
*/
|
|
|
|
|
|
#include <sys/types.h>
|