diff --git a/README.md b/README.md index e2b48bcaa..5c464a78e 100644 --- a/README.md +++ b/README.md @@ -556,6 +556,26 @@ then the start-up sequence might look like this: With this setup, the SIP proxy can choose which instance of *rtpengine* to talk to and thus which local interface to use by sending its control messages to either port 2223 or port 2224. +REDIS Database interaction +------------------------- + +Rtpengine is able to write call details in redis database and retore the calls from the same database. +To configure the redis parameters have a look on -r/-R, -z/-Z, -w/-W parameters. + +The three REDIS params could be specified in rtpengine's config file: +* REDIS -> specify the redis database for both read and write ops; expected role of redis is checked to be master and won't start if it is not +* REDIS_READ -> specify the redis database for read ops; expected role of redis may be any, master or slave +* REDIS_WRITE -> specify the redis database for write ops; expected role of redis could be any, master or slave + +One can specify combinations of REDIS/REDIS_READ/WRITE at the same time. For example: +* REDIS=IP1 -> will use IP1 for read and write operations +* REDIS=IP1, REDIS_READ=IP2 -> will use IP1 for write and IP2 for read operations +* REDIS=IP1, REDIS_WRITE=IP2 -> will use IP1 for read and IP2 for write operations +* REDIS=IP1, REDIS_READ=IP2, REDIS_WRITE=IP3 -> will use IP2 for read and IP3 for write operations +* REDIS_READ=IP1, REDIS_WRITE=IP2 -> will use IP1 for read and IP2 for write operations +* REDIS_READ=IP1 -> will use IP1 for read operations; write operations are ignored +* REDIS_WRITE=IP1 -> will use IP1 for write operations; read operations are ignored + The *ng* Control Protocol ========================= diff --git a/daemon/call.c b/daemon/call.c index a90a3c34c..9e53dee99 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -1823,8 +1823,8 @@ void call_destroy(struct call *c) { mutex_lock(&m->totalstats_interval.managed_sess_lock); m->totalstats.managed_sess_crt--; - m->totalstats_interval.managed_sess_min = MIN(m->totalstats_interval.managed_sess_crt, - m->totalstats_interval.managed_sess_min); + m->totalstats_interval.managed_sess_min = MIN(m->totalstats_interval.managed_sess_min, + m->totalstats.managed_sess_crt); mutex_unlock(&m->totalstats_interval.managed_sess_lock); if (!ret) diff --git a/daemon/main.c b/daemon/main.c index ac23aab5d..a5a19637e 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -598,7 +598,7 @@ no_kernel: gettimeofday(&redis_stop, NULL); // print redis restore duration - redis_diff += timeval_diff(&redis_start, &redis_stop) / 1000.0; + redis_diff += timeval_diff(&redis_stop, &redis_start) / 1000.0; ilog(LOG_INFO, "Redis restore time = %.0lf ms", redis_diff); gettimeofday(&ctx->m->latest_graphite_interval_start, NULL); diff --git a/debian/changelog b/debian/changelog index d65d926c0..6d59de0d0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,52 @@ +ngcp-rtpengine (4.3.0.0+0~mr4.3.0.0) unstable; urgency=medium + + [ Frederic-Philippe Metz ] + * [10f6e51] Replaced sprintf by snprintf for cdrbuffer + * [8219921] Extended callid space for list_* output + + [ smititelu ] + * [c406e6d] Some ICE NULL checks + * [637f9f9] Add logging related to kernelization and strict-source flag - master branch + * [4b92d14] Allow more than 65536 open files + * [c44c35a] Add 'rtpengine-ctl list maxsessions' command + * [00bb10b] Add 'rtpengine-ctl set maxsessions X' command + * [012bcc4] Add 'rtpengine-ctl list maxopenfiles' command + * [06b1293] Update rtpengine-ctl util + * [c969ab9] Change maxsessions feature behaviour + * [32a4299] Update README.md for --max-sessions + * [0309123] Update README with REDIS details + + [ Camille Oudot ] + * [fad4074] allow non-root users to control the kernel module + * [5a8f5c3] add possibility to choose rtpengine process user + * [88ce85e] remove kernel module uid/gid global switch + * [6f6a703] add option to set the group owning /proc/rtpengine + * [548b710] disable procfs uid/gid for kernels prior to 3.10 + + [ Richard Fuchs ] + * [99a3faf] MT#15289 add "reset" flag to un-learn certain parameters + * [ed75c99] fix a memory leak + * [1a67331] fix compiler warnings + * [28d877b] remove superfluous ice agent warning + * [2cff49b] support reset flag in ng-client + * [1c6eec4] additional DTLS debug log messages + * [59a69f0] Improve DTLS packet processing + * [cae0b4b] compile fix for debug builds + * [afa46a4] use `reset` flag to also reset and restart ICE agents + * [6d3865b] Mass update - manual merge of rfuchs/socket-rework branch + * [6b5c4e8] Mass update for non-daemon code (see `6d3865b`) + * [31d28a3] MT#16783 support via-branch matching in `delete` messages + * [cd34dde] fix missing redis expiry times + * [cb53218] fix incomplete dialogue association when initial offer contains to-tag + + [ Lucian Balaceanu ] + * [41fa252] Replacing redis hashkeys with -CALLID_IDX instead of -POINTER + * [8ee14e5] Fixing managed_sess_min interval statistic. + + [ Sipwise Jenkins Builder ] + + -- Sipwise Jenkins Builder Wed, 16 Dec 2015 09:33:26 +0100 + ngcp-rtpengine (4.2.0.0+0~mr4.2.0.0) unstable; urgency=medium [ Stefan Mititelu ] diff --git a/debian/copyright b/debian/copyright index bad3fe81c..a5e3ea237 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,35 +1,36 @@ -Upstream Author: The Sipwise Team - http://sipwise.com -Copyright: 2007-2013, Sipwise GmbH, Austria +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Source: https://www.sipwise.com/ +Upstream-Contact: Sipwise Development Team + +Files: * +Copyright: + Copyright © 2007-2015 Sipwise GmbH, Austria License: GPL-3+ with OpenSSL exception - This program is free software; you can redistribute it - and/or modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 3 of the License, or (at your option) any later - version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. . - In addition, as a special exception, the author of this - program gives permission to link the code of its - release with the OpenSSL project's "OpenSSL" library (or - with modified versions of it that use the same license as - the "OpenSSL" library), and distribute the linked - executables. You must obey the GNU General Public - License in all respects for all of the code used other - than "OpenSSL". If you modify this file, you may extend - this exception to your version of the file, but you are - not obligated to do so. If you do not wish to do so, - delete this exception statement from your version. + In addition, as a special exception, the copyright holders give + permission to link the code of this release with the OpenSSL project's + "OpenSSL" library (or with modified versions of it that use the same + license as the "OpenSSL" library), and distribute the linked executables. . - This program is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied - warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the GNU General Public License for more - details. + You must obey the GNU General Public License in all respects for all + of the code used other than "OpenSSL". If you modify file(s) with this + exception, you may extend this exception to your version of the file(s), + but you are not obligated to do so. If you do not wish to do so, + delete this exception statement from your version. If you delete + this exception statement from all source files in the program, then + also delete it here. . - You should have received a copy of the GNU General Public - License along with this package; if not, write to the Free - Software Foundation, Inc., 51 Franklin St, Fifth Floor, - Boston, MA 02110-1301 USA + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. . - On Debian systems, the full text of the GNU General Public - License version 3 can be found in the file - `/usr/share/common-licenses/GPL-3'. + You should have received a copy of the GNU General Public License + along with this program. If not, see . +Comment: + On Debian systems, the full text of the GNU General Public License + version 3 can be found in the file '/usr/share/common-licenses/GPL-3'. diff --git a/debian/ngcp-rtpengine-daemon.default b/debian/ngcp-rtpengine-daemon.default index f204ab19b..fab2f2510 100644 --- a/debian/ngcp-rtpengine-daemon.default +++ b/debian/ngcp-rtpengine-daemon.default @@ -32,3 +32,4 @@ TABLE=0 # GRAPHITE_INTERVAL=60 # GRAPHITE_PREFIX=myownprefix # MAX_SESSIONS=5000 +# CREATE_IPTABLES_CHAIN=no diff --git a/debian/ngcp-rtpengine-daemon.init b/debian/ngcp-rtpengine-daemon.init index ca7f5a7af..7fbabc63f 100755 --- a/debian/ngcp-rtpengine-daemon.init +++ b/debian/ngcp-rtpengine-daemon.init @@ -126,16 +126,24 @@ case "$1" in ip6tables -X mediaproxy 2> /dev/null rmmod xt_MEDIAPROXY 2>/dev/null - iptables -N rtpengine 2> /dev/null - iptables -D INPUT -j rtpengine 2> /dev/null - iptables -I INPUT -j rtpengine - iptables -D rtpengine -p udp -j RTPENGINE --id "$TABLE" 2>/dev/null - iptables -I rtpengine -p udp -j RTPENGINE --id "$TABLE" - ip6tables -N rtpengine 2> /dev/null - ip6tables -D INPUT -j rtpengine 2> /dev/null - ip6tables -I INPUT -j rtpengine - ip6tables -D rtpengine -p udp -j RTPENGINE --id "$TABLE" 2>/dev/null - ip6tables -I rtpengine -p udp -j RTPENGINE --id "$TABLE" + if [ "$CREATE_IPTABLES_CHAIN" != "no" ]; then + iptables -N rtpengine 2> /dev/null + iptables -D INPUT -j rtpengine 2> /dev/null + iptables -I INPUT -j rtpengine + ip6tables -N rtpengine 2> /dev/null + ip6tables -D INPUT -j rtpengine 2> /dev/null + ip6tables -I INPUT -j rtpengine + fi + if iptables -C INPUT -j rtpengine 1> /dev/null 2> /dev/null && iptables -n --list rtpengine 1> /dev/null 2> /dev/null; then + iptables -D rtpengine -p udp -j RTPENGINE --id "$TABLE" 2>/dev/null + iptables -I rtpengine -p udp -j RTPENGINE --id "$TABLE" + ip6tables -D rtpengine -p udp -j RTPENGINE --id "$TABLE" 2>/dev/null + ip6tables -I rtpengine -p udp -j RTPENGINE --id "$TABLE" + else + echo "" + echo "Missing rtpengine iptables chain - not starting" + exit 0 + fi set -e fi start-stop-daemon --start --quiet --pidfile $PIDFILE \ @@ -213,20 +221,26 @@ case "$1" in ip6tables -F mediaproxy 2> /dev/null ip6tables -X mediaproxy 2> /dev/null rmmod xt_MEDIAPROXY 2>/dev/null - - iptables -D INPUT -j rtpengine 2> /dev/null - iptables -D rtpengine -p udp -j RTPENGINE --id "$TABLE" 2>/dev/null - ip6tables -D INPUT -j rtpengine 2> /dev/null - ip6tables -D rtpengine -p udp -j RTPENGINE --id "$TABLE" 2>/dev/null rmmod xt_RTPENGINE 2>/dev/null - modprobe xt_RTPENGINE - iptables -N rtpengine 2> /dev/null - iptables -I INPUT -j rtpengine - iptables -I rtpengine -p udp -j RTPENGINE --id "$TABLE" - ip6tables -N rtpengine 2> /dev/null - ip6tables -I INPUT -j rtpengine - ip6tables -I rtpengine -p udp -j RTPENGINE --id "$TABLE" + if [ "$CREATE_IPTABLES_CHAIN" != "no" ]; then + iptables -D INPUT -j rtpengine 2> /dev/null + ip6tables -D INPUT -j rtpengine 2> /dev/null + iptables -N rtpengine 2> /dev/null + iptables -I INPUT -j rtpengine + ip6tables -N rtpengine 2> /dev/null + ip6tables -I INPUT -j rtpengine + fi + if iptables -C INPUT -j rtpengine 1> /dev/null 2> /dev/null && iptables -n --list rtpengine 1> /dev/null 2> /dev/null; then + ip6tables -D rtpengine -p udp -j RTPENGINE --id "$TABLE" 2>/dev/null + iptables -D rtpengine -p udp -j RTPENGINE --id "$TABLE" 2>/dev/null + iptables -I rtpengine -p udp -j RTPENGINE --id "$TABLE" + ip6tables -I rtpengine -p udp -j RTPENGINE --id "$TABLE" + else + echo "" + echo "Missing rtpengine iptables chain - not starting" + exit 0 + fi set -e fi start-stop-daemon --start --quiet --pidfile \ diff --git a/utils/images/RTPengine-Redis-DB-Model.graphml b/utils/images/RTPengine-Redis-DB-Model.graphml new file mode 100644 index 000000000..b425cdbb3 --- /dev/null +++ b/utils/images/RTPengine-Redis-DB-Model.graphml @@ -0,0 +1,894 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + REDIS-DB + + + + + + + + + + + + + + + + + Key + + + + + + + Value + + + + + + + NUM_SFD + + + + + + + NUM_STREAM + + + + + + + NUM_STREAM + + + + + + + NUM_TAG + + + + + + + NUM_TAG + + + + + + + NUM_TAG + + + + + + + NUM_MEDIA + + + + + + + NUM_MEDIA + + + + + + + NUM_MEDIA + + + + + + + + NUM_MAP + + + + + + + NUM_MAP + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SET: calls + + + + + + + + + + + + + + + + 1) "1-28893@192.168.12.3" + + + + + + + + + + + + + + + + HASH: call-1-28893@192.168.12.3 + + + + + + + + + + + + + + + + 1) "created" + 2) "1450198647" + 3) "last_signal" + 4) "1450198647" + 5) "tos" + 6) "4" + 7) "deleted" + 8) "0" + 9) "num_sfds" +10) "4" +11) "num_streams" +12) "4" +13) "num_medias" +14) "2" +15) "num_tags" +16) "2" +17) "num_maps" +18) "2" +19) "ml_deleted" +20) "0" +21) "created_from" +22) "10.25.1.9:49651" +23) "created_from_addr" +24) "10.25.1.9" + + + + + + + + + + + + + + + + HASH: sfd-1-28893@192.168.12.3-0 +HASH: sfd-1-28893@192.168.12.3-1 +HASH: sfd-1-28893@192.168.12.3-%NUM_SFD + + + + + + + + + + + + + + + + 1) "pref_family" +2) "IP4" +3) "localport" +4) "8192" +5) "logical_intf" +6) "default" +7) "local_intf_uid" +8) "0" +9) "stream" +10) "0" + + + + + + + + + + + + + + + + + HASH: stream-1-28893@192.168.12.3-%NUM_STREAM + + + + + + + + + + + + + + + + 1) "media" + 2) "0" + 3) "sfd" + 4) "0" + 5) "rtp_sink" + 6) "2" + 7) "rtcp_sink" + 8) "4294967295" + 9) "rtcp_sibling" +10) "1" +11) "last_packet" +12) "1450198647" +13) "ps_flags" +14) "1114368" +15) "endpoint" +16) "192.168.12.3:6087" +17) "advertised_endpoint" +18) "192.168.12.3:6087" +19) "stats-packets" +20) "0" +21) "stats-bytes" +22) "0" +23) "stats-errors" +24) "0" + + + + + + + + + + + + + + + + LIST: stream_sfds-1-28893@192.168.12.3-%NUM_STREAM + + + + + + + + + + + + + + + + 1) "0" + + + + + + + + + + + + + + + + HASH: tag-1-28893@192.168.12.3-%NUM_TAG + + + + + + + + + + + + + + + + 1) "created" +2) "1450198647" +3) "active" +4) "0" +5) "deleted" +6) "0" +7) "tag" +8) "1" + + + + + + + + + + + + + + + + LIST: other_tags-1-28893@192.168.12.3-%NUM_TAG + + + + + + + + + + + + + + + + 1) "1" + + + + + + + + + + + + + + + + LIST: medias-1-28893@192.168.12.3-%NUM_TAG + + + + + + + + + + + + + + + + 1) "1" + + + + + + + + + + + + + + + + HASH: media-1-28893@192.168.12.3-%NUM_MEDIA + + + + + + + + + + + + + + + + 1) "tag" + 2) "1" + 3) "index" + 4) "1" + 5) "type" + 6) "audio" + 7) "protocol" + 8) "RTP/AVP" + 9) "desired_family" +10) "IP4" +11) "sdes_in_tag" +12) "0" +13) "sdes_out_tag" +14) "0" +15) "logical_intf" +16) "default" +17) "media_flags" +18) "2162702" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LIST: streams-1-28893@192.168.12.3-%NUM_MEDIA + + + + + + + + + + + + + + + + 1) "0" +2) "1" + + + + + + + + + + + + + + + + LIST: maps-1-28893@192.168.12.3-%NUM_MEDIA + + + + + + + + + + + + + + + + 1) "0" + + + + + + + + + + + + + + + + HASH: map-1-28893@192.168.12.3-%NUM_MAP + + + + + + + + + + + + + + + + 1) "wildcard" + 2) "0" + 3) "num_ports" + 4) "2" + 5) "intf_preferred_family" + 6) "IP4" + 7) "logical_intf" + 8) "default" + 9) "endpoint" +10) "192.168.12.3:6087" + + + + + + + + + + + + + + + + LIST: map_sfds-1-28893@192.168.12.3-%NUM_MAP + + + + + + + + + + + + + + + + 1) "loc-0" +2) "2" +3) "3" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/utils/images/RTPengine-Redis-DB-Model.jpg b/utils/images/RTPengine-Redis-DB-Model.jpg new file mode 100644 index 000000000..f92b52d53 Binary files /dev/null and b/utils/images/RTPengine-Redis-DB-Model.jpg differ