[SR-Users] How does RLS work with kamailio.

Gnaneshwar Gatla GGatla at InTouchHealth.com
Thu May 17 03:33:40 CEST 2012


Hello,
I have partly fixed this, I was using an incorrect xml format and missing usage of pua module. It took a little more than debugging to find this out.
Now I have run into this new issue.

I have implemented a presence + rls + xcap server:
When client subscribes for RLS, kamailio Notifies with resourcelist for the client. The pua within the server does backend subscribtions.
These backend subscribtions are responded with 202 Accepted replies.
When the resources in the contact list change their presence information the pua generates NOTIFIY with subscription state: pending.
Rls module does not reply back.

Kamailio does not return from the following command.

if(is_method("NOTIFY"))
{
                xlog("handle notify");
              rls_handle_notify();
                xlog("notify was handled");
              exit;
};

Thank you for looking into this.
Regards
Gnani
From: Gnaneshwar Gatla
Sent: Thursday, April 19, 2012 4:53 PM
To: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users Mailing List
Cc: Cody Herzog
Subject: How does RLS work with kamailio.

Hello,

I'm trying to implement RLS with integrated XCAP server. I have successfully run the Kamailio instance with the following snippet.
Since I had no RLS clients available, I have tried to test this with SIPp. The attached pcap trace is the result.

Test:

1.       Send an XCAP signal over http to Kamailio.

2.       Register and subscribe Kamailio.

The test does store the xml received over http in the xcap table in the database. But rls module does not store the data neither in rls_presentity or rls_watcher.
When I sent the Subscribe with sipp, the server throws error that subscription was not found in the database.

I would like to know if I'm doing something wrong to implement this service. Is there any brief tutorial on how to implement this?


Kamailio.cfg snippet:

##Presence
modparam("presence", "server_address", PRESENCE_IP)
modparam("presence", "clean_period", 65)
modparam("presence", "db_update_period", 60)
modparam("presence", "max_expires", 75)
modparam("presence", "fallback2db", 1)

modparam("presence_xml", "db_url", DBURL)
modparam("presence_xml", "force_active", 0)
modparam("presence_xml", "integrated_xcap_server", 1)


##rls modparams
modparam("rls", "db_url", DBURL)
modparam("rls", "waitn_time", 10)
modparam("rls", "integrated_xcap_server", 1)
modparam("rls", "max_notify_body_length", 32000)
modparam("rls", "to_presence_code", 10)
modparam("rls", "server_address", RLS_URI)
modparam("rls", "outbound_proxy", PUA_OUTBOUND_PROXY)
modparam("rls", "xcap_root", XCAP_ROOT)


##XCAP modparams
modparam("xcap_server", "db_url", DBURL)
modparam("xcap_client", "db_url", DBURL)
modparam("xcap_client", "query_period", 50)


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

#!ifdef WITH_PRESENCE
        if (!t_newtran())
        {
                sl_reply_error();
                exit;
        };

        if(is_method("PUBLISH"))
        {
                handle_publish();
                t_release();
        }
        else
        if( is_method("SUBSCRIBE"))
        {
                $var(ret_code)= rls_handle_subscribe();
                xlog("Subscribe: $var(ret_code)");
                if($var(ret_code)== 10)
                               handle_subscribe();
                t_release();
        }
        exit;
#!endif

        # if presence enabled, this part will not be executed
        if (is_method("PUBLISH") || $rU==$null)
        {
                sl_send_reply("404", "Not here");
                exit;
        }
        return;
}

In the [xhttp:request]:
switch($rm) {
                        case "PUT":
                                xcaps_put("$var(uri)", "$hu", "$rb");
                                if($xcapuri(u=>auid)=~"pres-rules")
                                {
                                        xlog("===== xhttp put: refreshing watchers for $var(uri)\n");
                                        pres_update_watchers("$var(uri)", "presence");
                                        pres_refresh_watchers("$var(uri)", "presence", 1);
                                }
                                else if ($xcapuri(u=>auid)=~"resource-lists"
                                           || $xcapuri(u=>auid)=~"rls-services")
                                {
                                        xlog("==== xhttp put: refreshing rls watchers $var(uri)\n");
                                        rls_update_subs("$var(uri)", "presence");
                                }

                                exit;
                        break;



Gnaneshwar Gatla | InTouch Health | Software Developer
6330 Hollister Ave. Goleta CA, 93117 | P: 805.562.8686 ext: 199
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20120516/1c50ce96/attachment.htm>


More information about the sr-users mailing list