<p>this commit broke presence for us. we use NSQ + presence, after a phone reboots and we send a NOTIFY with confirmed state, presence module sends a NOTIFY with terminated state.<br>
please revert this commit. see the log and SIP packet below:</p>

<pre><code>Nov  3 09:23:52 /usr/local/sbin/kamailio[26288]: INFO: <script>: park+6001@troubleshoot.testdomain.com|log|payload {"Call-ID":"park+6001@troubleshoot.testdomain.com","Event-Category":"presence","Event-Name":"update","Event-Package":"dialog","Expires":"1","From":"sip:park+6001@troubleshoot.testdomain.com","From-User":"park+6001","From-Realm":"troubleshoot.testdomain.com","To":"sip:testuser@troubleshoot.testdomain.com","To-User":"testuser","To-Realm":"troubleshoot.testdomain.com","State":"confirmed"}
Nov  3 09:23:52 /usr/local/sbin/kamailio[26288]: INFO: <script>: park+6001@troubleshoot.testdomain.com|log|received dialog update for sip:park+6001@troubleshoot.testdomain.com state confirmed
Nov  3 09:23:53 /usr/local/sbin/kamailio[26284]: INFO: presence [notify.c:1634]: send_notify_request(): NOTIFY sip:testuser@troubleshoot.testdomain.com via sip:testuser@8.1.2.90:25279;transport=tcp on behalf of sip:park+6001@troubleshoot.testdomain.com for event dialog : 46ed33b5954833366fb4eda1d08f6bb7
</code></pre>

<pre><code>
                                                            |NOTIFY sip:testuser@8.1.2.90:25279;transport=tcp SIP/2.0
            6.7.8.219:5055           8.1.2.90:2527          |Via: SIP/2.0/TCP 6.7.8.219:5055;branch=z9hG4bKb0d.16516795000000000000000000000000.0
          ----------+---------          ----------+---------|To: <sip:testuser@troubleshoot.testdomain.com>;tag=EBF86DE1-F194FBC6
                    |           NOTIFY            |         |From: <sip:park+6001@troubleshoot.testdomain.com>;tag=3d72448f6ec66ad72d4fe275f33a4e85-bf81
  09:23:53.007063   | --------------------------> |         |CSeq: 3 NOTIFY
        +0.007681   |           200 OK            |         |Call-ID: 46ed33b5954833366fb4eda1d08f6bb7
  09:23:53.014744   | <-------------------------- |         |Content-Length: 285
                    |                             |         |User-Agent: kamailio (5.0.0-dev7 (x86_64/linux))
                    |                             |         |Max-Forwards: 70
                    |                             |         |Event: dialog
                    |                             |         |Contact: <sip:6.7.8.219:5055;transport=tcp>
                    |                             |         |Subscription-State: active;expires=3491
                    |                             |         |Content-Type: application/dialog-info+xml
                    |                             |         |
                    |                             |         |<?xml version="1.0"?>
                    |                             |         |<dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="3" state="full" entity="sip:park+6001@troubleshoot.testdomain.com">
                    |                             |         |  <dialog id="615293b33c62dec073e05d9421e9f48b" direction="recipient">
                    |                             |         |    <state>terminated</state>
                    |                             |         |  </dialog>
                    |                             |         |</dialog-info>
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/pull/809#issuecomment-258195982">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZSpjpjg3sABUOEaLKJynS9XmMRcxks5q6gvbgaJpZM4KNYFy">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZZgbkuYG3BKIad32cYlioTDYj-E4ks5q6gvbgaJpZM4KNYFy.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/809#issuecomment-258195982"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@eschmidbauer in #809: this commit broke presence for us. we use NSQ + presence, after a phone reboots and we send a NOTIFY with confirmed state, presence module sends a NOTIFY with terminated state.\r\nplease revert this commit. see the log and SIP packet below:\r\n\r\n```\r\nNov  3 09:23:52 /usr/local/sbin/kamailio[26288]: INFO: \u003cscript\u003e: park+6001@troubleshoot.testdomain.com|log|payload {\"Call-ID\":\"park+6001@troubleshoot.testdomain.com\",\"Event-Category\":\"presence\",\"Event-Name\":\"update\",\"Event-Package\":\"dialog\",\"Expires\":\"1\",\"From\":\"sip:park+6001@troubleshoot.testdomain.com\",\"From-User\":\"park+6001\",\"From-Realm\":\"troubleshoot.testdomain.com\",\"To\":\"sip:testuser@troubleshoot.testdomain.com\",\"To-User\":\"testuser\",\"To-Realm\":\"troubleshoot.testdomain.com\",\"State\":\"confirmed\"}\r\nNov  3 09:23:52 /usr/local/sbin/kamailio[26288]: INFO: \u003cscript\u003e: park+6001@troubleshoot.testdomain.com|log|received dialog update for sip:park+6001@troubleshoot.testdomain.com state confirmed\r\nNov  3 09:23:53 /usr/local/sbin/kamailio[26284]: INFO: presence [notify.c:1634]: send_notify_request(): NOTIFY sip:testuser@troubleshoot.testdomain.com via sip:testuser@8.1.2.90:25279;transport=tcp on behalf of sip:park+6001@troubleshoot.testdomain.com for event dialog : 46ed33b5954833366fb4eda1d08f6bb7\r\n```\r\n\r\n```\r\n\r\n                                                            |NOTIFY sip:testuser@8.1.2.90:25279;transport=tcp SIP/2.0\r\n            6.7.8.219:5055           8.1.2.90:2527          |Via: SIP/2.0/TCP 6.7.8.219:5055;branch=z9hG4bKb0d.16516795000000000000000000000000.0\r\n          ----------+---------          ----------+---------|To: \u003csip:testuser@troubleshoot.testdomain.com\u003e;tag=EBF86DE1-F194FBC6\r\n                    |           NOTIFY            |         |From: \u003csip:park+6001@troubleshoot.testdomain.com\u003e;tag=3d72448f6ec66ad72d4fe275f33a4e85-bf81\r\n  09:23:53.007063   | --------------------------\u003e |         |CSeq: 3 NOTIFY\r\n        +0.007681   |           200 OK            |         |Call-ID: 46ed33b5954833366fb4eda1d08f6bb7\r\n  09:23:53.014744   | \u003c-------------------------- |         |Content-Length: 285\r\n                    |                             |         |User-Agent: kamailio (5.0.0-dev7 (x86_64/linux))\r\n                    |                             |         |Max-Forwards: 70\r\n                    |                             |         |Event: dialog\r\n                    |                             |         |Contact: \u003csip:6.7.8.219:5055;transport=tcp\u003e\r\n                    |                             |         |Subscription-State: active;expires=3491\r\n                    |                             |         |Content-Type: application/dialog-info+xml\r\n                    |                             |         |\r\n                    |                             |         |\u003c?xml version=\"1.0\"?\u003e\r\n                    |                             |         |\u003cdialog-info xmlns=\"urn:ietf:params:xml:ns:dialog-info\" version=\"3\" state=\"full\" entity=\"sip:park+6001@troubleshoot.testdomain.com\"\u003e\r\n                    |                             |         |  \u003cdialog id=\"615293b33c62dec073e05d9421e9f48b\" direction=\"recipient\"\u003e\r\n                    |                             |         |    \u003cstate\u003eterminated\u003c/state\u003e\r\n                    |                             |         |  \u003c/dialog\u003e\r\n                    |                             |         |\u003c/dialog-info\u003e\r\n```"}],"action":{"name":"View Pull Request","url":"https://github.com/kamailio/kamailio/pull/809#issuecomment-258195982"}}}</script>