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

Gnaneshwar Gatla GGatla at InTouchHealth.com
Fri Apr 20 01:53:25 CEST 2012


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/20120419/7e386944/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rls-test.pcap
Type: application/octet-stream
Size: 54993 bytes
Desc: rls-test.pcap
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20120419/7e386944/attachment-0001.obj>


More information about the sr-users mailing list