<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello,<br>
<br>
any reason to use "deleted" for subs.reason?<br>
<br>
Also, (status==1) condition is supposed to check for ACTIVE_STATUS?<br>
<br>
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.<br>
<br>
# git diff<br>
<br>
diff --git a/modules_k/presence/presence.c
b/modules_k/presence/presence.c<br>
index df1a4ac..e97df6c 100644<br>
--- a/modules_k/presence/presence.c<br>
+++ b/modules_k/presence/presence.c<br>
@@ -728,6 +728,14 @@ int pres_update_status(subs_t subs, str reason,
db_key_t* q<br>
query_vals[q_wuser_col].val.str_val= subs.from_user;
<br>
query_vals[q_wdomain_col].val.str_val=
subs.from_domain; <br>
<br>
+ /* if status is no longer ACTIVE, switch to
terminated */<br>
+ if(subs.status!=status &&
status==ACTIVE_STATUS)<br>
+ {<br>
+ subs.status = TERMINATED_STATUS;<br>
+ subs.reason.s =
get_status_str(TERMINATED_STATUS);<br>
+ subs.reason.len = strlen(subs.reason.s);<br>
+ }<br>
+<br>
update_vals[u_status_col].val.int_val= subs.status;<br>
update_vals[u_reason_col].val.str_val= subs.reason;<br>
<br>
<br>
Cheers,<br>
Daniel<br>
<br>
On 7/6/11 3:39 PM, laura testi wrote:
<blockquote
cite="mid:CAHFjjJMv5u0W55Ca=rMd1RZ8SL0GjT+jymEnAVvTiSygZ1OcFA@mail.gmail.com"
type="cite">It's for v3.1.4. But I think the problem is also in
devel.<br>
<br>
# diff -u presence.c.orig presence.c.patch<br>
------ cut here ---------------<br>
--- presence.c.orig 2011-06-10 15:35:49.000000000 +0200<br>
+++ presence.c.patch 2011-06-17 18:44:05.000000000 +0200<br>
@@ -712,6 +712,13 @@<br>
(reason.s && subs.reason.s &&
strncmp(reason.s, subs.reason.s,<br>
reason.len)))<br>
{<br>
+ if(subs.status!=status && status==1)<br>
+ {<br>
+ subs.status= TERMINATED_STATUS;<br>
+ subs.reason.s= "deleted";<br>
+ subs.reason.len= 7;<br>
+ }<br>
+<br>
/* update in watchers_table */<br>
query_vals[q_wuser_col].val.str_val=
subs.from_user;<br>
query_vals[q_wdomain_col].val.str_val=
subs.from_domain;<br>
--------- end cut ------------------------------<br>
#<br>
<br>
<br>
<br>
<br>
<br>
<div class="gmail_quote">On Wed, Jul 6, 2011 at 2:23 PM,
sip-router <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:admin@sip-router.org">admin@sip-router.org</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.<br>
<br>
The following task has a new comment added:<br>
<br>
FS#133 - kamailio 3.1.3 Presence + XCAP problem, is it a
bug?<br>
User who did this - Daniel-Constantin Mierla (miconda)<br>
<br>
----------<br>
</div>
Can you send the unified diff, ie., taken as:<br>
<br>
diff -u presence.c.orig presence.c.patch<br>
<br>
Is it for v3.1.x or devel?
<div class="im"><br>
----------<br>
<br>
More information can be found at the following URL:<br>
</div>
<a moz-do-not-send="true"
href="http://sip-router.org/tracker/index.php?do=details&task_id=133#comment235"
target="_blank">http://sip-router.org/tracker/index.php?do=details&task_id=133#comment235</a>
<div>
<div class="h5"><br>
<br>
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.<br>
</div>
</div>
</blockquote>
</div>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
sr-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla -- <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
Kamailio Advanced Training, Oct 10-13, Berlin: <a class="moz-txt-link-freetext" href="http://asipto.com/u/kat">http://asipto.com/u/kat</a>
<a class="moz-txt-link-freetext" href="http://linkedin.com/in/miconda">http://linkedin.com/in/miconda</a> -- <a class="moz-txt-link-freetext" href="http://twitter.com/miconda">http://twitter.com/miconda</a></pre>
</body>
</html>