Menu Close

Extending IMS base platform with simple Presence service build over Kamailio AS

In this article we describe how to extend the base Kamailio IMS platform (as is described here) with simple presence service realized over Kamailio SIP server.

Prerequisities

Topology prerequisities

  • Functional IMS platform (as is described here in our case).
  • Functional Kamailio SIP presence server configured with Mysql (as is described for example here) and IM and presence service (as is described here).
    • Note: Do not use authorization as it is described inside of the article about Kamailio and Mysql (do not define directive WITH_AUTH).
    • do not enable registrar service on your Kamailio presence server.
    • alias parameter, defined for our kamamilio presence server, is ims1.sip.uniza.sk, the same as the domain zone name of our IMS.

Note: As a good idea seems to install SIREMIS over Kamailio presence AS (as is for example described here).

DNS preparation

We have to define FQDN name of our Presence server, A record should be enough. In our case it is:

kam-presence    IN      A       158.193.139.36

 FQDN = kam-presence.ims1.sip.uniza.sk

HSS configuration

Edit default service profile which is inserted in the HSS server to point server out on your presence server, here kam-presence.ims1.sip.uniza.sk. So, go to your HSS server (here hss.ims1.sip.uniza.sk), and log in. From the top level menu choose services, and from the left menu under Applcaition servers choose Search, then click on the Search button

then choose default_as by clicking on

and edit field inside of the red square to pointing the service on your presence server, then save…

Then set your IMPUs (public identities) to use the default service profile (default_sp). This profile forwards all PUBLISH and SUBSCRIBE messages to the Presence Application Server.

For default_as are other setting (as Trigger points, IFC, IFC sets.) preconfigured.

Tests

Setting up IMS client

1) Registering client to the SIMPLE AS

   158.193.152.64    158.193.139.40    158.193.139.41    158.193.139.42    158.193.139.36
    client           pcscf.ims1        icscf.ims1        scsfc.ims1        kam-presence.ims1(AS)
    |                 |                 |                 |                 |
1 : |U----REGISTER--->|                 |                 |                 |
2 : |                 |U----REGISTER--->|                 |                 |
3 : |                 |                 |U----REGISTER--->|                 |
4 : |                 |                 |<-401 Unauthori-U|                 |
5 : |                 |<-401 Unauthori-U|                 |                 |
6 : |<-401 Unauthori-U|                 |                 |                 |
7 : |U----REGISTER--->|                 |                 |                 |
8 : |                 |U----REGISTER--->|                 |                 |
9 : |                 |                 |U----REGISTER--->|                 |
10: |                 |                 |<-200 OK - SAR -U|                 |
11: |                 |<-200 OK - SAR -U|                 |                 |
12: |<-200 OK - SAR -U|                 |                 |                 |
13: |U---SUBSCRIBE--->|                 |                 |                 |
14: |U----PUBLISH---->|                 |                 |                 |
15: |                 |U------------SUBSCRIBE------------>|                 |
16: |                 |U-------------PUBLISH------------->|                 |
17: |                 |<-200 Subscription to REG saved/S-U|                 |
18: |<-200 Subscript-U|                 |                 |                 |
19: |                 |                 |                 |U----PUBLISH---->|
20: |                 |                 |                 |<-200 OK/PUBLIS-U|
21: |                 |<----------200 OK/PUBLISH---------U|                 |
22: |<-200 OK/PUBLIS-U|                 |                 |                 |
23: |                 |<--------------NOTIFY-------------U|                 |
24: |<-----NOTIFY----U|                 |                 |                 |
25: |U-200 OK/NOTIFY->|                 |                 |                 |
26: |                 |U----------200 OK/NOTIFY---------->|                 |
27: |                 |U---SUBSCRIBE--->|                 |                 |
28: |                 |                 |U---SUBSCRIBE--->|                 |
29: |                 |                 |<-200 Subscript-U|                 |
30: |                 |<-200 Subscript-U|                 |                 |
31: |                 |<--------------NOTIFY-------------U|                 |
32: |                 |U-200 OK - P-CSCF|processed notif->|                 |

2) Registering two SIP clients to presence server, a complete call flow sniff

palo@ims1 is adding the user segi@ims1 to his contact list.

158.193.152.64      158.193.139.40      158.193.139.42      158.193.139.36
    |                   |                   |                   |
1 : |U----SUBSCRIBE---->|                   |                   |
2 : |                   |U----SUBSCRIBE---->|                   |
3 : |                   |                   |U----SUBSCRIBE---->|
4 : |                   |                   |<-202 OK/SUBSCRIB-U|
5 : |                   |                   |<------NOTIFY-----U|
6 : |                   |<-202 OK/SUBSCRIB-U|                   |
7 : |<-202 OK/SUBSCRIB-U|                   |                   |
8 : |                   |<------NOTIFY-----U|                   |
9 : |<------NOTIFY-----U|                   |                   |
10: |U--200 OK/NOTIFY-->|                   |                   |
11: |                   |U--200 OK/NOTIFY-->|                   |
12: |                   |                   |U--200 OK/NOTIFY-->|

3) More complex scenario, two users add itself to their contact lists and changing theri status to busy

user palo@ims1.sip.uniza.sk is adding of user segi@ims1.sip.uniza.sk to his contact list, segi@ims1 is changing his status to busy.

user segi is then adding of user palo@ims1.sip.uniza.sk to his contact list, palo@ims1 is changing his status to busy.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.