<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    I applied the patches to master branch. One seemed to be in the
    reverse order (diff between file.new and file.old instead of diff
    between file.old and file.new), can you double-check if that is ok?
    If fine, then I will backport to 3.1 branch as well.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    On 8/10/11 1:44 PM, Daniel-Constantin Mierla wrote:
    <blockquote cite="mid:4E426F2B.7070000@gmail.com" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      Hi Laura,<br>
      <br>
      thanks, I will apply the patches soon.<br>
      <br>
      Cheers,<br>
      Daniel<br>
      <br>
      On 8/10/11 12:32 PM, laura testi wrote:
      <blockquote
cite="mid:CAHFjjJPUBg-YzNms6hoawGxgEYwktug=pme4n7KZyAXLAqgh5g@mail.gmail.com"
        type="cite">
        <pre wrap="">Hi Daniel,
please find the attached diff files and the files patched.

Best Regards,
Laura

On Tue, Aug 9, 2011 at 4:34 PM, Daniel-Constantin Mierla
<a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:miconda@gmail.com">&lt;miconda@gmail.com&gt;</a> wrote:
</pre>
        <blockquote type="cite">
          <pre wrap="">Hi Laura,

thanks for the patches. I will apply them. Can you attach the patches as
files instead of pasting them inline, so I can just download them from email
and apply? The mail client breaks the withe-spacing and will take me some
time to align them.

Cheers,
Daniel

On 8/8/11 6:00 PM, laura testi wrote:
</pre>
          <blockquote type="cite">
            <pre wrap="">Thank you very much for your reply.

Finally we have successfully configure the xmpp gateway to work (both
presence and IM) with another kamailio server which provide SIP
REGISTRAR/PROXY/PRESENCE (with integrated xcap function).

The key points are to put the server address parameter of presence and
pua_xmpp module to the gateway itself instead of the main Presence
Server of the SIP/SIMPLE domains. But the outbound_proxy of the xmpp
module must point to the main PROXY server of the SIP/SIMPLE domains.
The outbound_proxy of pua is not specify, so it point itself.

following are this part of the configuration:
modparam("xmpp", "outbound_proxy", "&lt;main_proxy_uri&gt;")
modparam("presence", "server_address", <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="sip:10.10.5.210:5060">"sip:10.10.5.210:5060"</a>)
modparam("pua_xmpp", "server_address", <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="sip:10.10.5.210:5060">"sip:10.10.5.210:5060"</a>)

Now it works fine withe some bugs:
- xmpp add sip contact: ok
- sip add xmpp contact: ok
- xmpp see the sip contact presence: ok
- sip see the xmpp contact presence: ok
- sip IM to xmpp: ok
- xmpp IM to sip: ok

the bugs we found are following:
- the online/offline status is ok in both direction (SIP&lt;--&gt; &nbsp;XMPP)
- other status (away/busy) is not ok from XMPP to SIP
- busy status is not ok from SIP to XMPP
- each time XMPP contact change the status, triger a new SUBSCRIBE in xmpp
&nbsp; gateway which generate multiple same subscriptions with different callid
&nbsp; in both active_watchers and pua tables. This also makes multiple
multiple NOTIFY
&nbsp; generation from the main Presence Server to GW when the SIP contact
change
&nbsp; it's status

We have make the following patches in the pua_xmpp module that fix the
above bugs. Hope it can help.

-------------------------------------------------------------------------------------------------------------------------
# diff -u simple2xmpp.c.orig simple2xmpp.c
--- simple2xmpp.c.orig &nbsp;2011-08-05 16:11:55.000000000 +0200
+++ simple2xmpp.c &nbsp; &nbsp; &nbsp; 2011-08-08 14:57:25.000000000 +0200
@@ -87,7 +87,7 @@
&nbsp; &nbsp; &nbsp; &nbsp; if(msg-&gt;to-&gt;parsed != NULL)
&nbsp; &nbsp; &nbsp; &nbsp; {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pto = (struct to_body*)msg-&gt;to-&gt;parsed;
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LM_ERR("'To' header ALREADY
PARSED:&lt;%.*s&gt;\n",pto-&gt;uri.len,pto-&gt;uri.s);
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LM_DBG("'To' header ALREADY
PARSED:&lt;%.*s&gt;\n",pto-&gt;uri.len,pto-&gt;uri.s);
&nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; else
&nbsp; &nbsp; &nbsp; &nbsp; {
@@ -415,7 +415,8 @@
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; goto error;
&nbsp; &nbsp; &nbsp; &nbsp; }

- &nbsp; &nbsp; &nbsp; if(xmlStrcasecmp((unsigned char*)note, (unsigned char*)"away")==
0)
+ &nbsp; &nbsp; &nbsp; if((xmlStrcasecmp((unsigned char*)note, (unsigned char*)"away")==
0)||
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (xmlStrcasecmp((unsigned char*)note, (unsigned
char*)"On the phone")== 0))
&nbsp; &nbsp; &nbsp; &nbsp; {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; new_node = xmlNewChild(xmpp_root, NULL, BAD_CAST "show",
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BAD_CAST "away");
@@ -456,12 +457,14 @@
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LM_ERR("while adding node:
idle\n");
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; goto error;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else */
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }*/
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if((xmlStrcasecmp((unsigned char*)note,
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (unsigned char*)"dnd")== 0)||
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (xmlStrcasecmp((unsigned
char*)note,
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (unsigned char*)"do
not disturb")== 0))
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (unsigned char*)"do
not disturb")== 0)||
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (xmlStrcasecmp((unsigned
char*)note,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (unsigned char*)"Busy (DND)")==
0))
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; new_node =
xmlNewChild(xmpp_root, NULL, BAD_CAST "show",
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BAD_CAST "dnd");
@@ -471,6 +474,8 @@
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; goto error;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LM_DBG("Not Found Status\n");


&nbsp; &nbsp; &nbsp; &nbsp; /* adding status node */




-------------------------------------------------------------------------------------------------------------------------
# diff -u xmpp2simple.c.orig xmpp2simple.c
--- xmpp2simple.c.orig &nbsp;2011-08-05 12:37:48.000000000 +0200
+++ xmpp2simple.c &nbsp; &nbsp; &nbsp; 2011-08-08 15:51:56.000000000 +0200
@@ -76,13 +76,13 @@
&nbsp; &nbsp; &nbsp; &nbsp; {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LM_DBG("type attribut not present\n");
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; build_publish(pres_node, -1);
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(presence_subscribe(pres_node, 3600, XMPP_SUBSCRIBE)&lt;
&nbsp;0)
+ &nbsp; &nbsp; &nbsp; /* &nbsp; &nbsp; &nbsp;if(presence_subscribe(pres_node, 3600, XMPP_SUBSCRIBE)&lt;
&nbsp;0)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LM_ERR("when sending subscribe for
presence");
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlFree(pres_type);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; goto error;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
-
+ &nbsp; &nbsp; &nbsp; */

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /* send subscribe after publish because in xmpp
subscribe message
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* comes only when a new contact is inserted in buddy list
*/
@@ -161,6 +161,8 @@
&nbsp; &nbsp; &nbsp; &nbsp; char* type= NULL;
&nbsp; &nbsp; &nbsp; &nbsp; char* status= NULL;

+
+
&nbsp; &nbsp; &nbsp; &nbsp; LM_DBG("start\n");

&nbsp; &nbsp; &nbsp; &nbsp; entity=(char*)pkg_malloc(7+ strlen(uri)*sizeof(char));
@@ -243,13 +245,13 @@
&nbsp; &nbsp; &nbsp; &nbsp; if(show_cont)
&nbsp; &nbsp; &nbsp; &nbsp; {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(strcmp(show_cont, "xa")== 0)
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; status= "not available";
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; status= "Away";
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(strcmp(show_cont, "chat")== 0)
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; status= "free for chat";
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; status= "Online";
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(strcmp(show_cont, "dnd")== 0)
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; status= "do not disturb";
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; status= "Busy (DND)";
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; status= show_cont;
&nbsp; &nbsp; &nbsp; &nbsp; }
@@ -264,8 +266,8 @@
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; goto error;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; node = xmlNewChild(root_node, NULL, BAD_CAST "note",
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BAD_CAST status_cont);
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; node = xmlNewChild(tuple_node, NULL, BAD_CAST "note",
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BAD_CAST status);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(node== NULL)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LM_ERR("while adding node\n");
@@ -273,8 +275,8 @@
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; }else
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(show_cont)
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; node = xmlNewChild(root_node, NULL, BAD_CAST
"note",
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; node = xmlNewChild(tuple_node, NULL, BAD_CAST
"note",
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BAD_CAST status);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(node== NULL)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
@@ -295,23 +297,6 @@
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; goto error;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; node= &nbsp;xmlNewChild(person_node, NULL, BAD_CAST
"activities",
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BAD_CAST 0);
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(node== NULL)
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LM_ERR("while adding node\n");
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; goto error;
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
-
-
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if( xmlNewChild(person_node, NULL, BAD_CAST "note",
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BAD_CAST status )== NULL)
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LM_ERR("while adding node\n");
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; goto error;
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
-
-
&nbsp; &nbsp; &nbsp; &nbsp; }












On Mon, Aug 1, 2011 at 12:10 PM, Daniel-Constantin Mierla
<a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:miconda@gmail.com">&lt;miconda@gmail.com&gt;</a> &nbsp;wrote:
</pre>
            <blockquote type="cite">
              <pre wrap="">Hello,

On 7/29/11 10:32 AM, laura testi wrote:
</pre>
              <blockquote type="cite">
                <pre wrap="">Hi all,
we are trying to setup a kamailio presence server in SIP/SIMPLE domain
to interwork with XMPP domains including the GTalk (see the config
below). The architecture is like this:
- SIP/SIMPLE server: kamailio3.14 with full configuration with XCAP
integration
- XMPP Gateway: another kamailio server + ejabberd server
&nbsp; &nbsp; - component mode
&nbsp; &nbsp; - xmpp moduleL: outbound proxy to the Kamailio SIP/SIMPLE server
&nbsp; &nbsp; - pua_xmpp: no outbound proxy?
- XMPP server: ejabberd

The users from XMPP domain can add the SIP account and see the
presence of the SIP users, but not vice versa. The chat from both
directions works fine.

in the Presence Server, we have configured the kamailio with XCAP
integration. We have the following doubts:
- does pua_xmpp/pua modules need the xcap integration for the presence
integration with xmpp domains?
</pre>
              </blockquote>
              <pre wrap="">no, there is no requirement of xcap for sip-xmpp presence gatewaying.
</pre>
              <blockquote type="cite">
                <pre wrap="">&nbsp; because to use xcap for presence authorization rules, it needs the
sip clients support the xcap
- does pua_xmpp/pua support xcap? otherwise how to works?
</pre>
              </blockquote>
              <pre wrap="">This mechanism of auth rules in SIP is not compatible with XMPP, afaik.
In
xmpp they have in-band (using XMPP) transfer of the buddy list, unlike in
SIMPLE where is XCAP over HTTP -- it is more like end-to-end presence
model
from early sip specifications.


</pre>
              <blockquote type="cite">
                <pre wrap="">- in case of multiple SIP/SIMPLE presence server, how we can configure
the server_address of
&nbsp; pua_xmpp and presence parameter in xmpp gw?
</pre>
              </blockquote>
              <pre wrap="">Either use many instances or, as workaround, somehow route the traffic to
itself or other instance in order to re-write some headers.

Cheers,
Daniel


</pre>
              <blockquote type="cite">
                <pre wrap="">Can you help us to clarify the doubts please?

Many thanks in advanced!

Best Regards,
Laura


PS: following are the main configuration of the xmpp GW:


---------------------------------------------------------------------------------------------
...
modparam("xmpp", "domain_separator", "*")
modparam("xmpp", "backend", "component")
modparam("xmpp", "gateway_domain", "&lt;mygwdomain&gt;")
modparam("xmpp", "xmpp_domain", "&lt;mygwdomain&gt;")
modparam("xmpp", "xmpp_host", "127.0.0.1")
modparam("xmpp", "xmpp_password", "secret")
modparam("xmpp", "outbound_proxy", "&lt;my oubound proxy uri&gt;")
modparam("pua", "outbound_proxy", "&lt;my outbound proxy uri&gt;")
modparam("pua", "update_period", 60)
modparam("pua", "default_expires", 1200)
modparam("presence", "server_address", "&lt;my presence server uri&gt;")
modparam("pua_xmpp", "server_address", "&lt;my presence server uri&gt;")



route{
&nbsp; route(REQINIT);
&nbsp; t_check_trans();

&nbsp;if (uri =~ "<a moz-do-not-send="true" class="moz-txt-link-freetext" href="sip:.+@.*">sip:.+@.*</a>&lt;myxmppdomain&gt;") {
&nbsp; &nbsp; route(PRESENCE);
&nbsp; &nbsp; if ($rU==$null)
&nbsp; &nbsp; {
&nbsp; &nbsp; &nbsp; # request with no Username in RURI
&nbsp; &nbsp; &nbsp; sl_send_reply("484","Address Incomplete");
&nbsp; &nbsp; &nbsp; exit;
&nbsp; &nbsp; }
&nbsp; &nbsp; route(CHAT);
&nbsp; }

&nbsp;xlog("L_INFO", "*** xmpp: unhandled message type\n");
&nbsp;t_reply("503", "Service unavailable");
&nbsp;return;

}

...

route[CHAT] {
&nbsp; &nbsp; &nbsp; &nbsp;if(!is_method("MESSAGE"))
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return;

&nbsp; &nbsp; &nbsp; &nbsp;if (!t_newtran()) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sl_reply_error();
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit;
&nbsp; &nbsp; &nbsp; &nbsp;}

&nbsp; &nbsp; &nbsp; &nbsp;xlog("L_INFO", "*** xmpp-handled MESSAGE message.");
&nbsp; &nbsp; &nbsp; &nbsp;if ($cT=~"^text/plain") {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (xmpp_send_message()) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;t_reply("200", "Accepted");
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} else {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;t_reply("404", "Not found");
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}
&nbsp; &nbsp; &nbsp; &nbsp;} else {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xlog("L_INFO", "*** xmpp-handled MESSAGE, ignoring not
text
messages");
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;t_reply("200", "Accepted");
&nbsp; &nbsp; &nbsp; &nbsp;}

&nbsp; &nbsp; &nbsp; &nbsp;t_release();
&nbsp; &nbsp; &nbsp; &nbsp;exit;
}

route[PRESENCE] {
&nbsp; if(!is_method("PUBLISH|SUBSCRIBE|NOTIFY"))
&nbsp; &nbsp; return;

&nbsp; # create new transaction to catch retransmissions
&nbsp; if (!t_newtran())
&nbsp; {
&nbsp; &nbsp; sl_reply_error();
&nbsp; &nbsp; exit;
&nbsp; }

&nbsp; if( is_method("NOTIFY"))
&nbsp; {
&nbsp; &nbsp; xlog("L_INFO", "*** xmpp-handled NOTIFY message.");
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(pua_xmpp_notify())
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;t_reply("200", "OK");
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;t_release();
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit;
&nbsp; } else if( is_method("SUBSCRIBE"))
&nbsp; &nbsp; &nbsp; &nbsp;{
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xlog("L_INFO", "*** xmpp-handled SUBSCRIBE message.\n");
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;handle_subscribe();
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if($(hdr(Event))== "presence")
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pua_xmpp_req_winfo("$ruri", "$hdr(Expires)");
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;t_release();
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit;
&nbsp;} else if(is_method("PUBLISH"))
&nbsp;{
&nbsp; &nbsp; handle_publish();
&nbsp; &nbsp; t_release();
&nbsp; &nbsp; exit;
&nbsp;}
}

...

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
              </blockquote>
              <pre wrap="">--
Daniel-Constantin Mierla -- <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
Kamailio Advanced Training, Oct 10-13, Berlin: <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://asipto.com/u/kat">http://asipto.com/u/kat</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://linkedin.com/in/miconda">http://linkedin.com/in/miconda</a> -- <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://twitter.com/miconda">http://twitter.com/miconda</a>


</pre>
            </blockquote>
            <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
          </blockquote>
          <pre wrap="">--
Daniel-Constantin Mierla -- <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
Kamailio Advanced Training, Oct 10-13, Berlin: <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://asipto.com/u/kat">http://asipto.com/u/kat</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://linkedin.com/in/miconda">http://linkedin.com/in/miconda</a> -- <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://twitter.com/miconda">http://twitter.com/miconda</a>

</pre>
        </blockquote>
        <pre wrap="">&gt;</pre>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a></pre>
      </blockquote>
      <br>
      <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
Kamailio Advanced Training, Oct 10-13, Berlin: <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://asipto.com/u/kat">http://asipto.com/u/kat</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://linkedin.com/in/miconda">http://linkedin.com/in/miconda</a> -- <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://twitter.com/miconda">http://twitter.com/miconda</a></pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</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>