[SR-Users] pua_xmpp questions

laura testi lau.testi at gmail.com
Fri Jul 29 10:32:05 CEST 2011


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
    - component mode
    - xmpp moduleL: outbound proxy to the Kamailio SIP/SIMPLE server
    - 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?
  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?
- in case of multiple SIP/SIMPLE presence server, how we can configure
the server_address of
  pua_xmpp and presence parameter in xmpp gw?

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", "<mygwdomain>")
modparam("xmpp", "xmpp_domain", "<mygwdomain>")
modparam("xmpp", "xmpp_host", "127.0.0.1")
modparam("xmpp", "xmpp_password", "secret")
modparam("xmpp", "outbound_proxy", "<my oubound proxy uri>")
modparam("pua", "outbound_proxy", "<my outbound proxy uri>")
modparam("pua", "update_period", 60)
modparam("pua", "default_expires", 1200)
modparam("presence", "server_address", "<my presence server uri>")
modparam("pua_xmpp", "server_address", "<my presence server uri>")



route{
  route(REQINIT);
  t_check_trans();
	
 if (uri =~ "sip:.+ at .*<myxmppdomain>") {
    route(PRESENCE);
    if ($rU==$null)
    {
      # request with no Username in RURI
      sl_send_reply("484","Address Incomplete");
      exit;
    }
    route(CHAT);
  }

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

}

...

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

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

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

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

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

...



More information about the sr-users mailing list