Normally, the REGISTER and PUBLISH are sent separately. In our solution, it is not needed, we should send only a „single” REGISTER with some „publish info”. A custom SIP header (PresenceInReg) is defined in REGISTER which contains the presence information. Here is an example:
<br>

<br>
REGISTER sips:example.com:443 SIP/2.0
<br>
Via: SIP/2.0/TLS 192.168.1.100;branch=z9hG4bK-524287-1---ec449f7fc5b0af2a;rport
<br>
Max-Forwards: 70
<br>
PresenceInReg: device;open;&lt;status&gt;&lt;state&gt;online&lt;/state&gt;&lt;message&gt;normal&lt;/message&gt;&lt;/status&gt;
<br>
Contact: <sip:1111111111@192.168.1.100;transport=tls>;+sip.instance="785722228"
<br>
To: "Andrea Máté"<sips:11111111@sip01.crypttalk.com:443>
<br>
From: "Andrea Máté"<sips:11111111@sip01.crypttalk.com:443>;tag=f4a82829
<br>
Call-ID: fWmDgP_8wJvQAKTM_b4ajw..
<br>
CSeq: 27 REGISTER
<br>
Expires: 800
<br>
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, UPDATE, INFO, MESSAGE, REFER, NOTIFY, SUBSCRIBE, REGISTER
<br>
Supported: norefersub, replaces, eventlist
<br>
User-Agent: Example_UA
<br>
Authorization: Digest username="1975539839",realm="example.com",nonce="VWwOB1VsDNsw7TW7jHJhrpX40TfhJA7t",uri="sips:example.com:443",response="78ab5f7a36c8ddae6f69c5262e240d8b",algorithm=MD5
<br>
X-CT-PushInfo: I;iNRvcCqBGqLeprCFaA7P+jrNwg2q+VYZ20FPw3Rv5hU=;hu;Ringing-Ringtone_long.wav,im.wav,ct_autoreject.wav
<br>
Content-Length: 0
<br>

<br>

<br>
Peter
<br>
From: Daniel-Constantin Mierla [mailto:notifications@github.com]
<br>
Sent: Monday, June 1, 2015 10:13 AM
<br>
To: kamailio/kamailio
<br>
Cc: Péter Barabás
<br>
Subject: Re: [kamailio] Adding publish in registration functionality, sending "closed" NOTIFY when presense has expired (#177)
<br>

<br>

<br>
What do you mean by "a single but extended REGISTER request"? Can you give an example of such REGISTER request?
<br>

<br>

<br>
Reply to this email directly or view it on GitHub<https://github.com/kamailio/kamailio/pull/177#issuecomment-107355252>.
<br>


<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/kamailio/kamailio/pull/177#issuecomment-107360743">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZRg884XtdCHDx7zPsmZNWq-qAbuBks5oPA7mgaJpZM4EruDX.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
  <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
    <link itemprop="url" href="https://github.com/kamailio/kamailio/pull/177#issuecomment-107360743"></link>
    <meta itemprop="name" content="View Pull Request"></meta>
  </div>
  <meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>