Re: [SR-Users] no publish from pua/pua_mi to outbound proxy

2011-09-12 Thread Daniel-Constantin Mierla

Hi Juha,

have had any time to try the patch I sent? Thinking of committing it, 
but no presence server environment at hand for me to try it quickly...


Thanks,
Daniel

On 9/7/11 6:59 PM, Daniel-Constantin Mierla wrote:

Hello,

On 8/30/11 7:43 AM, Juha Heinanen wrote:

Daniel-Constantin Mierla writes:

In the xmlrpc command, there was an etag value, have you tried 
with '.'

as etag?

i haven't tried with . etag yet.  i'll try that tomorrow.

mi pua publish from different UAs on same presentity seems to
work ok, when UAs always use . as tag param.
based on a quick look over the code, allowing any etag should be 
possible by just removing the condition of an existing presentity when 
etag value is given and provide the etag to building PUBLISH headers. 
But is has to be tested, since I had no testbed setup for such case.


I am attaching the patch, would be great if you can test and report 
the results. Please check if a new record is inserted in the table 
when 200 ok comes to such publish.


Thanks,
Daniel



___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


--
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

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] no publish from pua/pua_mi to outbound proxy

2011-09-12 Thread Juha Heinanen
Daniel-Constantin Mierla writes:

 have had any time to try the patch I sent? Thinking of committing it, 
 but no presence server environment at hand for me to try it quickly...

daniel,

sorry, i forgot about it.  is it really a good idea to allow any etag?
would it be better to require that etag matches if given and is not .?
i was able to solve my problem by always using ., when there are more
than one source that can issue publish for the same presentity.

-- juha

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] no publish from pua/pua_mi to outbound proxy

2011-09-12 Thread Daniel-Constantin Mierla

Hello,

On 9/12/11 9:47 AM, Juha Heinanen wrote:

Daniel-Constantin Mierla writes:


have had any time to try the patch I sent? Thinking of committing it,
but no presence server environment at hand for me to try it quickly...

daniel,

sorry, i forgot about it.  is it really a good idea to allow any etag?
based on your previous emails, looked like useful when publishing is 
done from different points, personally I haven't come to such needs.



would it be better to require that etag matches if given and is not .?
i was able to solve my problem by always using ., when there are more
than one source that can issue publish for the same presentity.
By using ., the presence server will create a new e-tag, right? It is 
not an update to an existing presence document, but creation of a new one.


Perhaps the best would be to me able to control this matching, to force 
or not when etag is present. From code point of view, even there is no 
record in PUA matching the etag, the publish is sent and added in PUA 
table only in case of 200ok. So, if there is no etag match on server 
side, then the return code should be 412 (iirc atm), so no new record 
added in pua.
All seemed to be fine, anyhow, ultimately we can leave the patch for 3.3 
if you don't need it and nobody else wants it for the moment -- I can 
upload it on tracker for availability.


Cheers,
Daniel

--
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


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] no publish from pua/pua_mi to outbound proxy

2011-09-12 Thread Juha Heinanen
Daniel-Constantin Mierla writes:

 By using ., the presence server will create a new e-tag, right? It is 
 not an update to an existing presence document, but creation of a new
 one.

yes, it is considered a new presence document, which replaces an old one
if any.  same as if a single ua crashes and is restarted: it will issue
a publish without etag.

 Perhaps the best would be to me able to control this matching, to force 
 or not when etag is present. From code point of view, even there is no 
 record in PUA matching the etag, the publish is sent and added in PUA 
 table only in case of 200ok. So, if there is no etag match on server 
 side, then the return code should be 412 (iirc atm), so no new record 
 added in pua.

yes, error code should be returned if an etag is present in publish,
which does not match what presence server expects.

 All seemed to be fine, anyhow, ultimately we can leave the patch for 3.3 
 if you don't need it and nobody else wants it for the moment -- I can 
 upload it on tracker for availability.

if others don't have other opinions, lets put the patch on hold.

-- juha

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] no publish from pua/pua_mi to outbound proxy

2011-09-07 Thread Daniel-Constantin Mierla

Hello,

On 8/30/11 7:43 AM, Juha Heinanen wrote:

Daniel-Constantin Mierla writes:


In the xmlrpc command, there was an etag value, have you tried with '.'
as etag?

i haven't tried with . etag yet.  i'll try that tomorrow.

mi pua publish from different UAs on same presentity seems to
work ok, when UAs always use . as tag param.
based on a quick look over the code, allowing any etag should be 
possible by just removing the condition of an existing presentity when 
etag value is given and provide the etag to building PUBLISH headers. 
But is has to be tested, since I had no testbed setup for such case.


I am attaching the patch, would be great if you can test and report the 
results. Please check if a new record is inserted in the table when 200 
ok comes to such publish.


Thanks,
Daniel

--
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

diff --git a/modules_k/pua/send_publish.c b/modules_k/pua/send_publish.c
index 3523cbc..4c9c07f 100644
--- a/modules_k/pua/send_publish.c
+++ b/modules_k/pua/send_publish.c
@@ -425,11 +425,13 @@ int send_publish( publ_info_t* publ )

presentity= search_htable(pres, hash_code);
 
+#if 0
if(publ-etag  presentity== NULL)
{
lock_release(HashT-p_records[hash_code].lock);
return 418;
}
+#endif
 
if(publ-flag  INSERT_TYPE)
{
@@ -537,8 +539,10 @@ send_publish:
 
if(publ-flag  UPDATE_TYPE)
LM_DBG(etag:%.*s\n, etag.len, etag.s);
-   str_hdr = publ_build_hdr((publ-expires 0)?3600:publ-expires, ev, 
publ-content_type, 
-   (publ-flag  UPDATE_TYPE)?etag:NULL, 
publ-extra_headers, (body)?1:0);
+   str_hdr = publ_build_hdr((publ-expires 0)?3600:publ-expires, ev,
+   publ-content_type,
+   (publ-flag  UPDATE_TYPE)?etag:publ-etag, 
publ-extra_headers,
+   (body)?1:0);
 
if(str_hdr == NULL)
{
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] no publish from pua/pua_mi to outbound proxy

2011-08-29 Thread Juha Heinanen
i started to test sr presence and for some reason sr does not send out
any publish request when i issue one via pua_mi.

i have in route [xmlrpc_requests]:

xlog(L_INFO, Handling XMLRPC $rm from $si with body 
$(rb{re.subst,/[\n\r\t]//g})\n);
set_reply_no_connect();
set_reply_close();
dispatch_rpc();

syslog shows that sr receives xmlrpc request:

Aug 29 19:42:13 sip /usr/sbin/pres-serv[2118]: INFO: Handling XMLRPC
POST from 127.0.0.1 with body ?xml 
version='1.0'?methodCallmethodNamemi/methodNameparamsparamvaluestringpua_publish/string/value/paramparamvaluestringsip:j...@vm.test.fi/string/value/paramparamvalueint7776000/int/value/paramparamvaluestringmessage-summary/string/value/paramparamvaluestringapplication/simple-message-summary/string/value/paramparamvaluestring./string/value/paramparamvaluestringa.1313821931.6178.2.0/string/value/paramparamvaluestringP-Flags:
0/string/value/paramparamvaluestringMessages-Waiting:yesVoice-Message:
 1/1 (0/0)/string/value/param/params/methodCall

and wireshark shows that sr xmlrpc server responds to it with 200 ok.
but after than nothing happens, i.e., according to wireshark no publish
request is sent out.  i have pua and pua_mi modules loaded and outbound
proxy defined:

modparam(pua, outbound_proxy, sip:127.0.0.1:5082)

there is no error messages in syslog.  any idea why sr does not send
publish to outbound proxy?  this used to work with opensips.

-- juha

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] no publish from pua/pua_mi to outbound proxy

2011-08-29 Thread Juha Heinanen
Juha Heinanen writes:

 pua/send_publish() function and it spits out 418 in this piece of code:
 
   presentity= search_htable(pres, hash_code);
   if(publ-etag  presentity== NULL)
   {
   lock_release(HashT-p_records[hash_code].lock);
   return 418;
   }
 
 any idea, how this hash table gets its contents, because looks like
 send_publish() does not find presentity sip:j...@vm.test.f although it
 exists in presentity db table?

if pua module gets hash table contents from pua table, it is in my case
empty. i tested again the same setup in my opensips presence server
environment, and pua publish worked fine.  has anyone succeeded with sr
pua send_publish?

-- juha

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] no publish from pua/pua_mi to outbound proxy

2011-08-29 Thread Daniel-Constantin Mierla

Hello,

On 8/29/11 8:49 PM, Juha Heinanen wrote:

Juha Heinanen writes:


pua/send_publish() function and it spits out 418 in this piece of code:

presentity= search_htable(pres, hash_code);
if(publ-etag  presentity== NULL)
{
lock_release(HashT-p_records[hash_code].lock);
return 418;
}

any idea, how this hash table gets its contents, because looks like
send_publish() does not find presentity sip:j...@vm.test.f although it
exists in presentity db table?

if pua module gets hash table contents from pua table, it is in my case
empty.
looking at the xmlrpc command content, I see the E-Tag value set, for 
the first publish, shouldn't it be empty and the presence server returns 
the value to be used later for updates?


At the first sight, the condition in the C piece of code above reads 
like: if the etag value is publish command is set, there must be a 
presentity structure.


Cheers,
Daniel

--
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


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] no publish from pua/pua_mi to outbound proxy

2011-08-29 Thread Juha Heinanen
Daniel-Constantin Mierla writes:

 looking at the xmlrpc command content, I see the E-Tag value set, for 
 the first publish, shouldn't it be empty and the presence server returns 
 the value to be used later for updates?

daniel,

my app that sends mi pua publish, takes etag from presentity table (if
presentity exists there) and then places it in mi pua publish command.
this works in opensips.

 At the first sight, the condition in the C piece of code above reads 
 like: if the etag value is publish command is set, there must be a 
 presentity structure.

this is how i interpret it too.  perhaps in case of sr, my app needs to
get it from pua table instead or always use . as etag value.

-- juha

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] no publish from pua/pua_mi to outbound proxy

2011-08-29 Thread Daniel-Constantin Mierla



On 8/29/11 10:06 PM, Juha Heinanen wrote:

Daniel-Constantin Mierla writes:


looking at the xmlrpc command content, I see the E-Tag value set, for
the first publish, shouldn't it be empty and the presence server returns
the value to be used later for updates?

daniel,

my app that sends mi pua publish, takes etag from presentity table (if
presentity exists there) and then places it in mi pua publish command.


The presentity table is built when a PUBLISH is received, did you sent 
another PUBLISH before so that you have a record in this table? Or how 
was it added in this table so that you could get the etag value?



At the first sight, the condition in the C piece of code above reads
like: if the etag value is publish command is set, there must be a
presentity structure.

this is how i interpret it too.  perhaps in case of sr, my app needs to
get it from pua table instead or always use . as etag value.
In the xmlrpc command, there was an etag value, have you tried with '.' 
as etag?


Cheers,
Daniel

--
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


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] no publish from pua/pua_mi to outbound proxy

2011-08-29 Thread Juha Heinanen
Daniel-Constantin Mierla writes:

 The presentity table is built when a PUBLISH is received, did you sent 
 another PUBLISH before so that you have a record in this table? Or how 
 was it added in this table so that you could get the etag value?

there are several sources that can send publish for user's voicemail
box.  for example, user can listen voicemails by calling to his/her
voicemail box and in that case publish is send by sems.  another
possibility is that use listens voicemail on web page and in that case
web app sends the publish.  in both cases, the app first checks from
presentity table which etag to use, because it has no way to know that
some other app has sent publish for the same presentity in the
meantime.

 In the xmlrpc command, there was an etag value, have you tried with '.' 
 as etag?

i haven't tried with . etag yet.  i'll try that tomorrow.

-- juha

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] no publish from pua/pua_mi to outbound proxy

2011-08-29 Thread Daniel-Constantin Mierla



On 8/29/11 10:23 PM, Juha Heinanen wrote:

Daniel-Constantin Mierla writes:


The presentity table is built when a PUBLISH is received, did you sent
another PUBLISH before so that you have a record in this table? Or how
was it added in this table so that you could get the etag value?

there are several sources that can send publish for user's voicemail
box.  for example, user can listen voicemails by calling to his/her
voicemail box and in that case publish is send by sems.  another
possibility is that use listens voicemail on web page and in that case
web app sends the publish.  in both cases, the app first checks from
presentity table which etag to use, because it has no way to know that
some other app has sent publish for the same presentity in the
meantime.
OK, I see, so in this case the condition in should be relaxed to allow 
sending publish with etag even there is no presentity in pua table.


Cheers,
Daniel



In the xmlrpc command, there was an etag value, have you tried with '.'
as etag?

i haven't tried with . etag yet.  i'll try that tomorrow.

-- juha


--
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


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] no publish from pua/pua_mi to outbound proxy

2011-08-29 Thread Juha Heinanen
Daniel-Constantin Mierla writes:

  In the xmlrpc command, there was an etag value, have you tried with '.'
  as etag?
  i haven't tried with . etag yet.  i'll try that tomorrow.

mi pua publish from different UAs on same presentity seems to
work ok, when UAs always use . as tag param.

-- juha

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users