Hello all,
I just commited changes without naming the commit as from you expected
(missing <module_path> at the beginning). The changes are composed of:
(main commit)
-http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7b4567c4cc4611ee32e403b41f53ed9a34ce9727
(just a fix)
-http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c110823321b3da0fc8286308fe8851f3c06835ff
Next commits will be all right again.
Bye Sven
Module: sip-router
Branch: master
Commit: c014f8b02eba3ef08195a22269bbd3c9e9670b30
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c014f8b…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Date: Thu Feb 23 23:09:21 2012 +0000
modules_k/rls: Added modparam to limit the number of back-end subscribes
- Specifically, the number of back-end subscribes per RLS subscribe is limited
- By default there is no limit
- Useful to help prevent a Kamailio server being overloaded when subscribers
have huge contact lists.
---
modules_k/rls/README | 32 ++++++++++++++++++++++++++------
modules_k/rls/doc/rls_admin.xml | 24 ++++++++++++++++++++++++
modules_k/rls/rls.c | 2 ++
modules_k/rls/rls.h | 1 +
modules_k/rls/subscribe.c | 11 +++++++++++
5 files changed, 64 insertions(+), 6 deletions(-)
diff --git a/modules_k/rls/README b/modules_k/rls/README
index e2d2ef9..d9da04f 100644
--- a/modules_k/rls/README
+++ b/modules_k/rls/README
@@ -45,6 +45,7 @@ Anca-Maria Vamanu
3.20. max_notify_body_length (int)
3.21. fetch_rows (integer)
3.22. disable_remote_presence (integer)
+ 3.23. max_backend_subs (integer)
4. Functions
@@ -80,9 +81,10 @@ Anca-Maria Vamanu
1.20. Set max_notify_body_length parameter
1.21. Set fetch_rows parameter
1.22. Set disable_remote_presence parameter
- 1.23. rls_handle_subscribe usage
- 1.24. rls_handle_notify usage
- 1.25. rls_update_subs usage
+ 1.23. Set max_backend_subscribes parameter
+ 1.24. rls_handle_subscribe usage
+ 1.25. rls_handle_notify usage
+ 1.26. rls_update_subs usage
Chapter 1. Admin Guide
@@ -118,6 +120,7 @@ Chapter 1. Admin Guide
3.20. max_notify_body_length (int)
3.21. fetch_rows (integer)
3.22. disable_remote_presence (integer)
+ 3.23. max_backend_subs (integer)
4. Functions
@@ -198,6 +201,7 @@ Chapter 1. Admin Guide
3.20. max_notify_body_length (int)
3.21. fetch_rows (integer)
3.22. disable_remote_presence (integer)
+ 3.23. max_backend_subs (integer)
3.1. db_url(str)
@@ -488,6 +492,22 @@ modparam("rls", "fetch_rows", 1000)
modparam("rls", "disable_remote_presence", 1)
...
+3.23. max_backend_subs (integer)
+
+ When set to a non-zero value RLS will limit the number of back-end
+ SUBSCRIBEs for each RLS SUBSCRIBE to this value. Leaving this at the
+ default of zero means no limit. When people have large contact lists
+ RLS will make lots of back-end subscriptions. This can easily overload
+ a system. This option allows you to limit the number of back-end
+ SUBSCRIBEs to help prevent overload.
+
+ Default value is 0
+
+ Example 1.23. Set max_backend_subscribes parameter
+...
+modparam("rls", "max_backend_subscribes", 30)
+...
+
4. Functions
4.1. rls_handle_subscribe()
@@ -503,7 +523,7 @@ modparam("rls", "disable_remote_presence", 1)
This function can be used from REQUEST_ROUTE.
- Example 1.23. rls_handle_subscribe usage
+ Example 1.24. rls_handle_subscribe usage
...
For presence and rls on the same machine:
modparam("rls", "to_presence_code", 10)
@@ -531,7 +551,7 @@ For rls only:
This function can be used from REQUEST_ROUTE.
- Example 1.24. rls_handle_notify usage
+ Example 1.25. rls_handle_notify usage
...
if(method=="NOTIFY")
rls_handle_notify();
@@ -550,7 +570,7 @@ if(method=="NOTIFY")
This function can be used from ANY_ROUTE.
- Example 1.25. rls_update_subs usage
+ Example 1.26. rls_update_subs usage
...
Within event_route[xhttp:request]:
case "PUT":
diff --git a/modules_k/rls/doc/rls_admin.xml b/modules_k/rls/doc/rls_admin.xml
index 72f1606..3bad25f 100644
--- a/modules_k/rls/doc/rls_admin.xml
+++ b/modules_k/rls/doc/rls_admin.xml
@@ -560,6 +560,30 @@ modparam("rls", "disable_remote_presence", 1)
</programlisting>
</example>
</section>
+ <section>
+ <title><varname>max_backend_subs</varname> (integer)</title>
+ <para>
+ When set to a non-zero value RLS will limit the number of back-end
+ SUBSCRIBEs for each RLS SUBSCRIBE to this value.
+ Leaving this at the default of zero means no limit.
+ When people have large contact lists RLS will make lots of back-end
+ subscriptions. This can easily overload a system. This option allows
+ you to limit the number of back-end SUBSCRIBEs to help prevent overload.
+ </para>
+ <para>
+ <emphasis>
+ Default value is 0
+ </emphasis>
+ </para>
+ <example>
+ <title>Set <varname>max_backend_subscribes</varname> parameter</title>
+ <programlisting format="linespecific">
+...
+modparam("rls", "max_backend_subscribes", 30)
+...
+</programlisting>
+ </example>
+ </section>
</section>
diff --git a/modules_k/rls/rls.c b/modules_k/rls/rls.c
index 1d64e26..be28c10 100644
--- a/modules_k/rls/rls.c
+++ b/modules_k/rls/rls.c
@@ -185,6 +185,7 @@ str rls_outbound_proxy = {0, 0};
int rls_fetch_rows = 500;
int rls_disable_remote_presence = 0;
+int rls_max_backend_subs = 0;
/** module functions */
@@ -235,6 +236,7 @@ static param_export_t params[]={
{ "expires_offset", INT_PARAM, &rls_expires_offset },
{ "fetch_rows", INT_PARAM, &rls_fetch_rows },
{ "disable_remote_presence",INT_PARAM, &rls_disable_remote_presence },
+ { "max_backend_subs", INT_PARAM, &rls_max_backend_subs },
{0, 0, 0 }
};
diff --git a/modules_k/rls/rls.h b/modules_k/rls/rls.h
index 05f5ffb..8bb7a8a 100644
--- a/modules_k/rls/rls.h
+++ b/modules_k/rls/rls.h
@@ -104,6 +104,7 @@ extern int rls_max_notify_body_len;
extern int rls_expires_offset;
extern int rls_disable_remote_presence;
+extern int rls_max_backend_subs;
extern gen_lock_t *rls_update_subs_lock;
diff --git a/modules_k/rls/subscribe.c b/modules_k/rls/subscribe.c
index eee4941..c1b73a8 100644
--- a/modules_k/rls/subscribe.c
+++ b/modules_k/rls/subscribe.c
@@ -864,6 +864,11 @@ int send_resource_subs(char* uri, void* param)
return 1;
}
+ /* Silently drop subscribes over the limit - will print a single warning
+ later */
+ if (rls_max_backend_subs > 0 && ++counter > rls_max_backend_subs)
+ return 1;
+
((subs_info_t*)param)->pres_uri = &pres_uri;
((subs_info_t*)param)->remote_target = &pres_uri;
return pua_send_subscribe((subs_info_t*)param);
@@ -917,6 +922,8 @@ int resource_subscriptions(subs_t* subs, xmlNodePtr xmlnode)
s.extra_headers = &extra_headers;
s.internal_update_flag = subs->internal_update_flag;
+
+ counter = 0;
if(process_list_and_exec(xmlnode, subs->from_user, subs->from_domain,
send_resource_subs, (void*)(&s))<0)
@@ -925,6 +932,10 @@ int resource_subscriptions(subs_t* subs, xmlNodePtr xmlnode)
goto error;
}
+ if (rls_max_backend_subs > 0 && counter > rls_max_backend_subs)
+ LM_WARN("%.*s has too many contacts. Max: %d, has: %d\n",
+ wuri.len, wuri.s, rls_max_backend_subs, counter);
+
pkg_free(wuri.s);
pkg_free(did_str.s);
Module: sip-router
Branch: master
Commit: d4396716a7f0c0472f37e4ce7c39e04394925583
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d439671…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Date: Thu Feb 23 22:56:46 2012 +0000
core: Setting max_while_loops to zero now allows infinite loops
- I wanted to be able to have a Kamailio process running a configuration route
all the time (sleeping itself using usleep). To do this I use rtimer to
create a mode one timer (with timeout of one second - so the route is run
very shortly after Kamailio starts).
- In the route for this timer I had a while(1) loop, but the max_while_loops
(defaulting to 100) meant that the loop wasn't really infinite.
- Now setting max_while_loops to zero disables the infinite loop check.
---
action.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/action.c b/action.c
index 6d22bf2..e044f65 100644
--- a/action.c
+++ b/action.c
@@ -1401,7 +1401,9 @@ match_cleanup:
ret=1;
while(!(flags & (BREAK_R_F|RETURN_R_F|EXIT_R_F)) &&
(rval_expr_eval_int(h, msg, &v, rve) == 0) && v){
- i++;
+ if (cfg_get(core, core_cfg, max_while_loops) > 0)
+ i++;
+
if (unlikely(i > cfg_get(core, core_cfg, max_while_loops))){
LOG(L_ERR, "ERROR: runaway while (%d, %d): more then"
" %d loops\n",
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
A new Flyspray task has been opened. Details are below.
User who did this - Reda Aouad (reda.aouad)
Attached to Project - sip-router
Summary - call_control() automatically engages mediaproxy on every call
Task Type - Bug Report
Category - Module
Status - Unconfirmed
Assigned To -
Operating System - Linux
Severity - Low
Priority - Normal
Reported Version - Development
Due in Version - Undecided
Due Date - Undecided
Details - Kamailio Version: 3.2.0
Modules: call_control, mediaproxy
Hi,
When I use the function call_control( ) of the call_control module, it automatically engages mediaproxy for every call, even if postpaid and doesn't fall under its control, if it finds the mediaproxy module loaded. If the mediaproxy module is not loaded, call_control doesn't even try to engage it.
I need mediaproxy for NAT traversal in some cases, but don't want it to be engaged on every call.
For testing, my cfg file has a simple call to the call_control() function in request_route for the moment, and no call at all to any function from the mediaproxy module, which is loaded.
I have written about the problem in the OpenSips mailing list:
http://lists.opensips.org/pipermail/users/2012-February/020752.html
It seems that the issue is not in the CallControl application, and is not a wanted behavior. They previously had this issue, which was related to the dialog module as they say, but fixed it in the latest version of OpenSips.
The impact is, as you may guess, a heavier, not wanted load on the mediaproxy server.
Thanks for looking into the issue
Reda
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=205
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
Hi,
I'd like to add the possibility to define the Path value for ul_add
command. Looking at the code in modules_k/usrloc/ul_mi.c:496, the param
6 is unused:
/* unused value (param 6) FIXME */
node = node->next;
What was that supposed to be? The socket? Can I reuse it for the path
value or should I append it at the end?
Andreas