Module: sip-router
Branch: master
Commit: 59c31fe72e95d60f42752bfcae3a18563b2c9700
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=59c31fe…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Fri Feb 12 14:03:24 2010 +0100
dispatcher(k): basic framework for load dispatching
- a lightweight system to do a fair distrubution based on load
- no dependency on dialog, by using an internal table of active calls
with minimal info, to keep the module suitable for small devices and
have good performances
- not completed, requires xavp support for a compact info structure to
be carried in transaction for each failover step
---
modules_k/dispatcher/dispatch.c | 94 ++++++++++++-
modules_k/dispatcher/dispatch.h | 6 +
modules_k/dispatcher/dispatcher.c | 10 ++
modules_k/dispatcher/ds_ht.c | 278 +++++++++++++++++++++++++++++++++++++
modules_k/dispatcher/ds_ht.h | 67 +++++++++
5 files changed, 453 insertions(+), 2 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=59c…
Module: sip-router
Branch: sr_3.0
Commit: 385ce10271569852982007ebb927d2b6a5e5af40
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=385ce10…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Mon Feb 15 13:25:03 2010 +0100
Merge remote branch 'origin/tmp/k3.0_sr_backports' into sr_3.0
* origin/tmp/k3.0_sr_backports:
modules/mediaproxy: properly fix the IP in the RTCP line
utils/kamctl: removed unsupported commands to manage lcr gateways and routes
cfg.y: fix warnings introduced in previous commit
core: added forward()
Makefile: MEMDBG var to control mem debugging mode
---
Module: sip-router
Branch: tmp/k3.0_sr_backports
Commit: c80f76803d771997d33a4b26f7249e6888103c12
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c80f768…
Author: Juha Heinanen <jh(a)tutpro.com>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Thu Feb 11 22:22:12 2010 +0200
modules/mediaproxy: properly fix the IP in the RTCP line
- Properly fix the IP in the RTCP line (if present in the SDP). Patch
provided by Saul Ibarra Corretge.
(cherry picked from commit 2a95f9bf915cfc3cf11374f9b8f0f547d4eb4955)
(cherry picked from commit ef10212404b9bc5489683fc7429fee40b3495994)
---
modules/mediaproxy/mediaproxy.c | 37 +++++++++++++++++++++++++++++++++++++
1 files changed, 37 insertions(+), 0 deletions(-)
diff --git a/modules/mediaproxy/mediaproxy.c b/modules/mediaproxy/mediaproxy.c
index acedf5b..ff633ba 100644
--- a/modules/mediaproxy/mediaproxy.c
+++ b/modules/mediaproxy/mediaproxy.c
@@ -127,6 +127,7 @@ typedef struct {
str type; // stream type (`audio', `video', `image', ...)
str ip;
str port;
+ str rtcp_ip; // pointer to the rtcp IP if explicitly specified by stream
str rtcp_port; // pointer to the rtcp port if explicitly specified by stream
str direction;
Bool local_ip; // true if the IP is locally defined inside this media stream
@@ -827,6 +828,34 @@ get_rtcp_port_attribute(str *block)
}
+// will return the rtcp IP of the stream in the given block
+// if defined by the stream, otherwise will return {NULL, 0}.
+static str
+get_rtcp_ip_attribute(str *block)
+{
+ str zone, tokens[4], undefined = {NULL, 0};
+ char *ptr;
+ int count;
+
+ ptr = find_line_starting_with(block, "a=rtcp:", False);
+
+ if (!ptr)
+ return undefined;
+
+ zone.s = ptr + 7;
+ zone.len = findendline(zone.s, block->s + block->len - zone.s) - zone.s;
+
+ count = get_str_tokens(&zone, tokens, 4);
+
+ if (count != 4) {
+ LM_ERR("invalid `a=rtcp' line in SDP body\n");
+ return undefined;
+ }
+
+ return tokens[3];
+}
+
+
// will return the ip address present in a `c=' line in the given block
// returns: -1 on error, 0 if not found, 1 if found
static int
@@ -1073,6 +1102,7 @@ get_session_info(str *sdp, SessionInfo *session)
session->streams[i].local_ip = 1;
}
+ session->streams[i].rtcp_ip = get_rtcp_ip_attribute(&block);
session->streams[i].rtcp_port = get_rtcp_port_attribute(&block);
session->streams[i].direction = get_direction_attribute(&block, &session->direction);
}
@@ -1491,6 +1521,13 @@ use_media_proxy(struct sip_msg *msg, char *dialog_id)
}
}
+ if (stream.rtcp_ip.len > 0) {
+ if (!replace_element(msg, &stream.rtcp_ip, &tokens[0])) {
+ LM_ERR("failed to replace RTCP IP in media stream number %d\n", i+1);
+ return -1;
+ }
+ }
+
if (stream.local_ip && !isnulladdr(stream.ip)) {
if (!replace_element(msg, &stream.ip, &tokens[0])) {
LM_ERR("failed to replace IP address in media stream number %d\n", i+1);