Module: sip-router
Branch: master
Commit: aa7b306e24ba1c9b5bdb4e18b88cfc74ad00733b
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=aa7b306…
Author: Marius Zbihlei <marius.zbihlei(a)1and1.ro>
Committer: Marius Zbihlei <marius.zbihlei(a)1and1.ro>
Date: Thu Jun 23 11:42:53 2011 +0300
modules_k/presence : Added parameter to allow disabling of sending an initial empty NOTIFY by presence, as this confused some CPEs
Default is enabled, so behavior is left the existing one. Sending of the NOTIFY (carrying the initial/default state) is left now to the application.
---
modules_k/presence/README | 63 +++++++++++++++++++----------
modules_k/presence/doc/presence_admin.xml | 21 ++++++++++
modules_k/presence/presence.c | 2 +
modules_k/presence/presence.h | 1 +
modules_k/presence/subscribe.c | 2 +-
5 files changed, 66 insertions(+), 23 deletions(-)
diff --git a/modules_k/presence/README b/modules_k/presence/README
index 51ae45e..4384d71 100644
--- a/modules_k/presence/README
+++ b/modules_k/presence/README
@@ -47,8 +47,9 @@ Juha Heinanen
3.12. db_mode (int)
3.13. subs_htable_size (int)
3.14. pres_htable_size (int)
- 3.15. enable_sphere_check (int)
- 3.16. timeout_rm_subs (int)
+ 3.15. send_fast_notify (int)
+ 3.16. enable_sphere_check (int)
+ 3.17. timeout_rm_subs (int)
4. Exported Functions
@@ -99,13 +100,14 @@ Juha Heinanen
1.12. Set db_mode parameter
1.13. Set subs_htable_size parameter
1.14. Set pres_htable_size parameter
- 1.15. Set enable_sphere_check parameter
- 1.16. Set timeout_rm_subs parameter
- 1.17. handle_publish usage
- 1.18. handle_subscribe usage
- 1.19. pres_auth_status usage
- 1.20. pres_refresh_watchers usage
- 1.21. pres_update_watchers usage
+ 1.15. Set send_fast_notify parameter
+ 1.16. Set enable_sphere_check parameter
+ 1.17. Set timeout_rm_subs parameter
+ 1.18. handle_publish usage
+ 1.19. handle_subscribe usage
+ 1.20. pres_auth_status usage
+ 1.21. pres_refresh_watchers usage
+ 1.22. pres_update_watchers usage
2.1. presence_api_t structure
Chapter 1. Admin Guide
@@ -134,8 +136,9 @@ Chapter 1. Admin Guide
3.12. db_mode (int)
3.13. subs_htable_size (int)
3.14. pres_htable_size (int)
- 3.15. enable_sphere_check (int)
- 3.16. timeout_rm_subs (int)
+ 3.15. send_fast_notify (int)
+ 3.16. enable_sphere_check (int)
+ 3.17. timeout_rm_subs (int)
4. Exported Functions
@@ -220,8 +223,9 @@ Chapter 1. Admin Guide
3.12. db_mode (int)
3.13. subs_htable_size (int)
3.14. pres_htable_size (int)
- 3.15. enable_sphere_check (int)
- 3.16. timeout_rm_subs (int)
+ 3.15. send_fast_notify (int)
+ 3.16. enable_sphere_check (int)
+ 3.17. timeout_rm_subs (int)
3.1. db_url(str)
@@ -401,7 +405,22 @@ modparam("presence", "subs_htable_size", 11)
modparam("presence", "pres_htable_size", 11)
...
-3.15. enable_sphere_check (int)
+3.15. send_fast_notify (int)
+
+ This parameter enables or disables the sending of an initial empty
+ NOTIFY after a SUBSCRIBE/reSUBSCRIBE. This caused problems for MWI
+ application, because some CPEs (like Samsung) fail to understand an
+ empty NOTIFY to an message-summary event. This parameter is enabled by
+ default, thus addering to the standard.
+
+ Default value is “1 ”.
+
+ Example 1.15. Set send_fast_notify parameter
+...
+modparam("presence", "send_fast_notify", 0)
+...
+
+3.16. enable_sphere_check (int)
This parameter is a flag that should be set if permission rules include
sphere checking. The sphere information is expected to be present in
@@ -411,12 +430,12 @@ modparam("presence", "pres_htable_size", 11)
Default value is “0 ”.
- Example 1.15. Set enable_sphere_check parameter
+ Example 1.16. Set enable_sphere_check parameter
...
modparam("presence", "enable_sphere_check", 1)
...
-3.16. timeout_rm_subs (int)
+3.17. timeout_rm_subs (int)
This parameter is a flag that should be set if subscriptions should be
removed from the active_watchers when a NOTIFY times out. RFC3265
@@ -426,7 +445,7 @@ modparam("presence", "enable_sphere_check", 1)
Default value is “1”.
- Example 1.16. Set timeout_rm_subs parameter
+ Example 1.17. Set timeout_rm_subs parameter
...
modparam("presence", "timeout_rm_subs", 0)
...
@@ -459,7 +478,7 @@ modparam("presence", "timeout_rm_subs", 0)
The module sends an appropriate stateless reply in all cases.
- Example 1.17. handle_publish usage
+ Example 1.18. handle_publish usage
...
if(is_method("PUBLISH"))
{
@@ -485,7 +504,7 @@ modparam("presence", "timeout_rm_subs", 0)
The module sends an appropriate stateless reply in all cases.
- Example 1.18. handle_subscribe usage
+ Example 1.19. handle_subscribe usage
...
if(method=="SUBSCRIBE")
handle_subscribe();
@@ -502,7 +521,7 @@ if(method=="SUBSCRIBE")
This function can be used from REQUEST_ROUTE.
- Example 1.19. pres_auth_status usage
+ Example 1.20. pres_auth_status usage
...
if (method=="MESSAGE") {
pres_auth_status("$fu", $ru");
@@ -533,7 +552,7 @@ if (method=="MESSAGE") {
This function can be used from ANY_ROUTE.
- Example 1.20. pres_refresh_watchers usage
+ Example 1.21. pres_refresh_watchers usage
...
pres_refresh_watchers("sip:test@kamailio.org", "presence", 1);
...
@@ -551,7 +570,7 @@ pres_refresh_watchers("sip:test@kamailio.org", "presence", 1);
This function can be used from ANY_ROUTE.
- Example 1.21. pres_update_watchers usage
+ Example 1.22. pres_update_watchers usage
...
pres_update_watchers("sip:test@kamailio.org", "presence");
...
diff --git a/modules_k/presence/doc/presence_admin.xml b/modules_k/presence/doc/presence_admin.xml
index b2a1629..49c8730 100644
--- a/modules_k/presence/doc/presence_admin.xml
+++ b/modules_k/presence/doc/presence_admin.xml
@@ -359,6 +359,27 @@ modparam("presence", "pres_htable_size", 11)
</example>
</section>
<section>
+ <title><varname>send_fast_notify</varname> (int)</title>
+ <para>
+ This parameter enables or disables the sending of an initial empty NOTIFY after a SUBSCRIBE/reSUBSCRIBE.
+ This caused problems for MWI application, because some CPEs (like Samsung) fail to understand an empty
+ NOTIFY to an message-summary event. This parameter is enabled by default, thus addering to the standard.
+ </para>
+ <para>
+ <emphasis>Default value is <quote>1 </quote>.
+ </emphasis>
+ </para>
+ <example>
+ <title>Set <varname>send_fast_notify</varname> parameter</title>
+ <programlisting format="linespecific">
+...
+modparam("presence", "send_fast_notify", 0)
+...
+ </programlisting>
+ </example>
+ </section>
+
+ <section>
<title><varname>enable_sphere_check</varname> (int)</title>
<para>
This parameter is a flag that should be set if permission rules include
diff --git a/modules_k/presence/presence.c b/modules_k/presence/presence.c
index d211b53..8dd866c 100644
--- a/modules_k/presence/presence.c
+++ b/modules_k/presence/presence.c
@@ -137,6 +137,7 @@ int dbmode = 0;
int fallback2db = 0;
int sphere_enable= 0;
int timeout_rm_subs = 1;
+int send_fast_notify = 1;
int phtable_size= 9;
phtable_t* pres_htable;
@@ -177,6 +178,7 @@ static param_export_t params[]={
{ "fallback2db", INT_PARAM, &fallback2db},
{ "enable_sphere_check", INT_PARAM, &sphere_enable},
{ "timeout_rm_subs", INT_PARAM, &timeout_rm_subs},
+ { "send_fast_notify", INT_PARAM, &send_fast_notify},
{0,0,0}
};
diff --git a/modules_k/presence/presence.h b/modules_k/presence/presence.h
index 88520f3..16e5177 100644
--- a/modules_k/presence/presence.h
+++ b/modules_k/presence/presence.h
@@ -75,6 +75,7 @@ extern int max_expires;
extern int dbmode;
extern int sphere_enable;
extern int timeout_rm_subs;
+extern int send_fast_notify;
extern int shtable_size;
extern shtable_t subs_htable;
diff --git a/modules_k/presence/subscribe.c b/modules_k/presence/subscribe.c
index d37518a..3fb1668 100644
--- a/modules_k/presence/subscribe.c
+++ b/modules_k/presence/subscribe.c
@@ -607,7 +607,7 @@ int update_subscription(struct sip_msg* msg, subs_t* subs, int to_tag_gen,
}
*sent_reply= 1;
- if(notify(subs, NULL, NULL, 0 )< 0)
+ if(send_fast_notify && (notify(subs, NULL, NULL, 0 )< 0))
{
LM_ERR("sending notify request\n");
goto error;
Hello,
let's keep the list on cc so other devs can participate and have idea of
what is going on ...
On 8/11/11 9:26 AM, Tristan Bruns wrote:
> Hello Daniel,
>
> I tried using the message parser and textops to add the headers to the
> message but failed, probably because I did not manage to create a
> sip_msg struct that append_hf would update. (It worked when I used an
> existing sip_msg struct, [e.g. the one from sip_trace()] but not all
> trace-functions had access to a sip_msg [e.g. trace_sl_*])
Indeed, the functions for storing the message don't have the sip_msg
struct available. I was referring to parsing of received messages (the
mirrored traffic from other kamailios), where would be safer to use the
parser -- if there will be another proxy in between mirroring proxy and
storage proxy, it can add headers in between the X-Siptrace-...,
breaking the read.
Anyhow, that is very unlikely -- for the I will go with your patches and
update afterwards, when it is more time for it.
Cheers,
Daniel
>
> After that, I did not consider to use the message parser to extract
> the headers.
>
> Regards, Tristan
>
>
> Am 09.08.2011 16:26, schrieb Daniel-Constantin Mierla:
>> Hi Tristan,
>>
>> I was looking at the patches and the only thing I want to discuss is
>> related to the operations with headers.
>>
>> You don't use the internal SIP parser, with it you can get the end of
>> headers position as well as you can iterate through the list of
>> headers and match by name, then take the body and fill local variables.
>>
>> In the patches (3/5) you use sscanf(...). I would go for using the
>> parser, since it is safer in long term. Do you had any special reason
>> to go with own kind of parser for SIP and headers?
>>
>> Cheers,
>> Daniel
>>
>> On 8/5/11 10:17 AM, Tristan Bruns wrote:
>>> Hello OpenSER/Kamailio developers,
>>>
>>> we implemented some additional features in siptrace.
>>> The main objective was to have multiple kamailios send duplicates
>>> of sent/received packets to one logging server (also running kamailio).
>>> We did not just set db_url to the logging server because of
>>> performance concerns.
>>>
>>> The attached patches contain our commits.
>>> I hope that you find them useful.
>>>
>>> Viele Grüße / Best regards,
>>> Tristan Bruns (DECOIT GmbH)
>>>
>>>
>>>
>>> 0001-modules_k-siptrace-separately-store-to-db-and-or-sen.patch
>>> modules_k/siptrace: separately store to db and/or send duplicate
>>>
>>> 0002-modules_k-siptrace-Add-trace_to_database-configurati.patch
>>> modules_k/siptrace: Add trace_to_database configuration parameter
>>>
>>> Adding configuration parameter to disable writing to the
>>> database.
>>> We can use this to only duplicate the SIP messages without
>>> storing
>>> them in our database.
>>>
>>> 0003-modules_k-siptrace-Add-x-headers-feature.patch
>>> modules_k/siptrace: Add "x-headers" feature
>>>
>>> The "x-headers" feature stores the fromip, toip, method and
>>> direction in the message body (using X-* headers). This allows to
>>> transmit them using duplicate_uri from one kamailio to an other.
>>>
>>> 0004-modules_k-siptrace-Add-column-time_us.patch
>>> modules_k/siptrace: Add column time_us
>>>
>>> 0005-modules_k-siptrace-Add-time-to-x-headers.patch
>>> modules_k/siptrace: Add time to x-headers
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> sr-dev mailing list
>>> sr-dev(a)lists.sip-router.org
>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>>
>> --
>> Daniel-Constantin Mierla --http://www.asipto.com
>> Kamailio Advanced Training, Oct 10-13, Berlin:http://asipto.com/u/kat
>> http://linkedin.com/in/miconda -- http://twitter.com/miconda
>
--
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Oct 10-13, Berlin: http://asipto.com/u/kathttp://linkedin.com/in/miconda -- http://twitter.com/miconda
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task is now closed:
FS#126 - 3.x dialog module: dialogs stay in database when in "shutdown only" mode
User who did this - Timo Reimann (tr)
Reason for closing: Fixed
Additional comments about closing: Fixed in master (commit 76fc55be0) with proposed solution (clear table after loading dialogs during startup).
To be shipped in SR 3.2.
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=126
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.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#126 - 3.x dialog module: dialogs stay in database when in "shutdown only" mode
User who did this - Henning Westerholt (henningw)
----------
As discussed, I think option 2) with a database clearing directly after the de-serialization on startup is the best option.
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=126#comment251
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.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#126 - 3.x dialog module: dialogs stay in database when in "shutdown only" mode
User who did this - Timo Reimann (tr)
----------
Finally, I came to analyze the issue: The reason why it doesn't work is that on dialog module startup, any database-related functionality during run-time is prohibited if the database mode is SHUTDOWN. For that mode, however, there is no code to clear the database after startup; the dialog-processing code in dlg_handlers.c relies on the assumption that dialogs can be deleted from the database during run-time which is not possible in SHUTDOWN mode. This is pretty much what Henning already discovered in the original mailing list thread under
http://lists.kamailio.org/pipermail/users/2009-December/025811.html
The possible fixes are also there:
(1) Make database removal possible during run-time
(2) Clear the database either prior to serializing during shutdown or after de-serializing during startup.
My personal preference goes towards (2) to have SHUTDOWN mode behave as expected: Access the database only when needed to serialize/de-serialize dialogs without any run-time requirements.
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=126#comment250
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.