Pre-Submission Checklist

Type Of Change

Checklist:

Description

Right now the presence_reginfo module does not perform any aggregation on presentities from the same AoR. While this is generally ok for new notifies driven by new publishes, when a new subscription is received only the most recent presentity is notified. This PR adds a new parameter, disabled by default to preserve compatibility, which merges all presentities for the same AoR into a single document.

For example, two registrations from the same AoR will create the following document:

<reginfo xmlns="urn:ietf:params:xml:ns:reginfo" version="23" state="full">
  <registration aor="sip:user2@example.com" id="0x7f9b6bbf9cf8" state="active">
    <contact id="0x7f9b6bbf3ea8" state="active" event="created" expires="300" callid="23439394725296-103541137625012@192.168.10.130" cseq="38" received="" path="&lt;sip:172.23.42.1;lr;received=sip:uac.public.ip:60015;r2=on&gt;,&lt;sip:kamailio.public.ip;lr;received=sip:uac.public.ip:60015;r2=on&gt;" user_agent="MyUA 1.2.3.4">
      <uri>sip:user2@192.168.10.130:5060</uri>
    </contact>
  </registration>
  <registration aor="sip:user2@example.com" id="0x7f46836f63b8" state="active">
    <contact id="0x7f46836f64e0" state="active" event="refreshed" expires="300" callid="15796302815379-26687127665413@192.168.10.130" cseq="38" received="" path="&lt;sip:172.23.42.1;lr;received=sip:uac.public.ip:5099;r2=on&gt;,&lt;sip:kamailio.public.ip;lr;received=sip:uac.public.ip:5099;r2=on&gt;" user_agent="MyUA 1.2.3.4">
      <uri>sip:user2@192.168.10.130:5099</uri>
    </contact>
  </registration>
</reginfo>

Example of a body with two registrations with different bodies:

<?xml version="1.0"?>
<reginfo xmlns="urn:ietf:params:xml:ns:reginfo" version="21" state="full">
  <registration aor="sip:user2@example.com" id="0x7f9b6bc55540" state="terminated"/>
  <registration aor="sip:user2@example.com" id="0x7f46836f63b8" state="active">
    <contact id="0x7f46836f64e0" state="active" event="refreshed" expires="300" callid="15796302815379-26687127665413@192.168.10.130" cseq="36" received="" path="&lt;sip:172.23.42.1;lr;received=sip:uac.public.ip:5099;r2=on&gt;,&lt;sip:kamailio.public.ip;lr;received=sip:uac.public.ip:5099;r2=on&gt;" user_agent="MyUA 1.2.3.4">
      <uri>sip:user2@192.168.10.130:5099</uri>
    </contact>
  </registration>
</reginfo>

What is maybe missing: if the aor and id are the same on different presentities (is possible ?) we should not put it twice in the same body, because aor+id identify an unique registration.

Most of the code has been adapted from presence_dialoginfo so I have preserved the original authors, too.
Since is a bit complex PR (for me, at least) I'm begging for a in deep review ;)


You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/3240

Commit Summary

File Changes

(6 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <kamailio/kamailio/pull/3240@github.com>