Hi,
we are trying to setup a Kamailio as a SIP/SIMPLE presence server for chat based on the guide published in SIP SIMPLE Presence Made Simple with Kamailio 3.1.x on the site: http://kb.asipto.com/kamailio:presence:k31-made-simple.
The OS we are using is Linux RHEL 5.6 x64 and MYSQL as Database.
We found some strange behaviors of the Kamailio basic presence, presence rules functionalities. As suggested in the guide we created 2 users (Alice and Bob) and both the latest jitsi (SIP communicator) to test it. The test scenario is following by using either UDP or TCP protocol:
- Alice add the Bob as a contact
- Bob add the Alice as a contact
- Alice change presence status
- Bob change presence status
- Alice send IM to Bob
- Bob send IM to
- Alice put the status offline
- Bob put the status offlice
First, test the configuration without XCAP server load:
- WITH_XCAPSRV is not defined
- Use implicit presence rule modparam("presence_xml", "force_active", 1) (from my understanding, without xcap we can only use implicit presence rule without any authorization for the subscription
Result:
- Add contact is ok and the presence status is immediately visible (because force_active = 1)
- The change status of the presentity is immediately visible by watcher with the only exception, when the user goes offline, the presentity keeps online in the watcher buddy list, any idea? Can you help me?
Second, test the configuration with XCAP server load and the configuration is the same of the guide:
- WITH_XCAPSRV is defined
- Use implicit presence rule modparam("presence_xml", "force_active", 0)
- modparam("presence_xml", "integrated_xcap_server", 1)
Result:
- When Alice add the Bob as a contact, there is no popup to ask the Bob authorization immediately.
- When Bob change the presence status, Alice dosen’t see the change(offline), but they can exchange IM.
- When Alice goes offline, the popup of the authorization request of the Alice is appear to Bob, Bob accept the request
- When Alice come on line again, the same behavior, Alice always see Bob is online even Bob change his status.
- When Alice goes offline again, the Authorization Request come up again to Bob just like Bob even Bob has accepted the request before. Very strange
When we configured the kamailio with XCAPSRV and enable the xcap also in the SIP communicator as suggested by the guide, we got the following error in /var/log/messages when alice goes online:
Apr 18 16:35:01 kamailio3p1 /usr/sbin/kamailio[7561]: ERROR: <script>: ===== xhttp: resource-lists : sip:alice@10.10.5.214
Apr 18 16:35:01 kamailio3p1 /usr/sbin/kamailio[7561]: ERROR: <script>: ===== xhttp: get sip:alice@10.10.5.214 => /xcap-root/resource-lists/users/ sip:alice@10.10.5.214/index
Apr 18 16:35:01 kamailio3p1 /usr/sbin/kamailio[7562]: ERROR: <script>: ===== xhttp: pres-rules : sip:alice@10.10.5.214
Apr 18 16:35:01 kamailio3p1 /usr/sbin/kamailio[7562]: ERROR: <script>: ===== xhttp: get sip:alice@10.10.5.214 => /xcap-root/pres-rules/users/ sip:alice@10.10.5.214/presrules
The xcap table is empty. Do I need to configure also the xcap table? Or it’s automically done by kamailio presence server?
Any idea? Maybe we have wrong configuration or is it a bug of kamailio?
Thanks and Best Regards, Laura
Hi Laura,
I have recently been testing presence with Kamailio as well.
The change status of the presentity is immediately visible
by watcher with the only exception, when the user goes offline, the presentity keeps online in the watcher buddy list, any idea? Can you help me?
I have had the same issue with clients I was testing with. In my case it turned out to be problems with the client.
You should take a LAN trace from the client side and check that the client logging out is properly updating presence status on log-out. If that is OK, then take a trace on the client still logged in, it could be that the client is receiving the status update but not displaying it.
The xcap table is empty. Do I need to configure also the xcap table? Or it’s automically done by kamailio presence server?
The xcap table will be empty for new subscribers. When the client requests a document (of supported type) from Kamailio that is not on the server it will get a "404 Not Found" response. The client should then create a new document (with sensible defaults for the client) on the server using an HTTP PUT.
If the client requests a document that is not of supported type Kamailio will return a "500 Server Error" response and the client should continue (if it can) without support for that document.
During my testing I came across a client that didn't support HTTP authentication properly, so when Kamailio responded with a 401 the client gave up instead of authenticating. Disabling HTTP authentication (take out the "#!define WITH_XHTTPAUTH" line in kamailio.cfg).
Regards,
Peter