Hello,
any reason to use "deleted" for subs.reason?
Also, (status==1) condition is supposed to check for ACTIVE_STATUS?
I adapted a bit your patch based on available defines/functions -- see
it next and let me know if your was intended to behave differently. If
all ok, I will commit to devel and backport to 3.1.x.
# git diff
diff --git a/modules_k/presence/presence.c b/modules_k/presence/presence.c
index df1a4ac..e97df6c 100644
--- a/modules_k/presence/presence.c
+++ b/modules_k/presence/presence.c
@@ -728,6 +728,14 @@ int pres_update_status(subs_t subs, str reason,
db_key_t* q
query_vals[q_wuser_col].val.str_val= subs.from_user;
query_vals[q_wdomain_col].val.str_val= subs.from_domain;
+ /* if status is no longer ACTIVE, switch to terminated */
+ if(subs.status!=status && status==ACTIVE_STATUS)
+ {
+ subs.status = TERMINATED_STATUS;
+ subs.reason.s = get_status_str(TERMINATED_STATUS);
+ subs.reason.len = strlen(subs.reason.s);
+ }
+
update_vals[u_status_col].val.int_val= subs.status;
update_vals[u_reason_col].val.str_val= subs.reason;
Cheers,
Daniel
On 7/6/11 3:39 PM, laura testi wrote:
It's for v3.1.4. But I think the problem is also
in devel.
# diff -u presence.c.orig presence.c.patch
------ cut here ---------------
--- presence.c.orig 2011-06-10 15:35:49.000000000 +0200
+++ presence.c.patch 2011-06-17 18:44:05.000000000 +0200
@@ -712,6 +712,13 @@
(reason.s && subs.reason.s && strncmp(reason.s,
subs.reason.s,
reason.len)))
{
+ if(subs.status!=status && status==1)
+ {
+ subs.status= TERMINATED_STATUS;
+ subs.reason.s= "deleted";
+ subs.reason.len= 7;
+ }
+
/* update in watchers_table */
query_vals[q_wuser_col].val.str_val= subs.from_user;
query_vals[q_wdomain_col].val.str_val= subs.from_domain;
--------- end cut ------------------------------
#
On Wed, Jul 6, 2011 at 2:23 PM, sip-router <admin(a)sip-router.org
<mailto:admin@sip-router.org>> wrote:
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#133 - kamailio 3.1.3 Presence + XCAP problem, is it a bug?
User who did this - Daniel-Constantin Mierla (miconda)
----------
Can you send the unified diff, ie., taken as:
diff -u presence.c.orig presence.c.patch
Is it for v3.1.x or devel?
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=133#comment2…
<http://sip-router.org/tracker/index.php?do=details&task_id=133#comment235>
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.
_______________________________________________
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