<p>Hello Luis <a class="user-mention" data-hovercard-user-id="770988" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/lazedo">@lazedo</a><br>
I found that kamailio is send BLF events to already disconnected Call-ID <code>bafd2f3d-d3a9-4c7d-be75-10fca3f358ca</code>.<br>
Please looks packets 123, 125, 127, 196, 198.<br>
And relevant CDR from kazoo</p>
<pre><code>[root@node0 ~]# curl -s -S  'https://cust.ai.co.uk/v2/accounts/a9f80a9e89baec870641c904b45e8bdd/cdrs/201804-bafd2f3d-d3a9-4c7d-be75-10fca3f358ca'  -H 'X-Auth-Token: XXXXX' | jq -j '.data'
{
  "custom_channel_vars": {
    "account_id": "a9f80a9e89baec870641c904b45e8bdd",
    "authorizing_id": "dfa492e672c1c67d9c84d27415507a9f",
    "authorizing_type": "device",
    "bridge_id": "cad39f1f-be0f-1236-dba9-0242ac110006",
    "ecallmgr_node": "ecallmgr@kazoo-app02.cloudpbx.ai.co.uk",
    "inception": "442030263206@cust.ai.co.uk",
    "owner_id": "1ac8f140e6bf1662ca0c901a04e93b07",
    "realm": "ai.cust.ai.co.uk",
    "username": "user_x4a5hv"
  },
  "to": "201@ai.cust.ai.co.uk",
  "timestamp": 63691318804,
  "switch_url": "sip:mod_sofia@31.28.75.195:11000",
  "switch_uri": "sip:31.28.75.195:11000",
  "switch_nodename": "freeswitch@freeswitch01.cloudpbx.ai.co.uk",
  "ringing_seconds": "0",
  "request": "user_x4a5hv@ai.cust.ai.co.uk",
  "presence_id": "201@ai.cust.ai.co.uk",
  "other_leg_direction": "inbound",
  "other_leg_destination_number": "442030263206",
  "other_leg_caller_id_number": "03333444466",
  "other_leg_caller_id_name": "03333444466",
  "other_leg_call_id": "cad39f1f-be0f-1236-dba9-0242ac110006",
  "media_server": "freeswitch01.cloudpbx.ai.co.uk",
  "local_sdp": "v=0\r\no=FreeSWITCH 1524078566 1524078567 IN IP4 31.28.75.195\r\ns=FreeSWITCH\r\nc=IN IP4 31.28.75.195\r\nt=0 0\r\nm=audio 21038 RTP/AVP 0 101 13\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:101 telephone-event/8000\r\na=fmtp:101 0-16\r\na=rtcp:21039 IN IP4 31.28.75.195\r\na=rtpmap:13 CN/8000\r\na=ptime:20\r\na=sendrecv\r\n",
  "hangup_code": "sip:900",
  "hangup_cause": "NORMAL_UNSPECIFIED",
  "from": "03333444466@ai.cust.ai.co.uk",
  "duration_seconds": "0",
  "custom_sip_headers": {
    "x_kazoo_invite_format": "username",
    "x_kazoo_aor": "sip:user_x4a5hv@ai.cust.ai.co.uk"
  },
  "channel_state": "REPORTING",
  "channel_name": "sofia/sipinterface_1/user_x4a5hv@ai.cust.ai.co.uk",
  "channel_created_time": 1524099604028605,
  "channel_call_state": "HANGUP",
  "caller_id_number": "03333444466",
  "caller_id_name": "03333444466",
  "callee_id_number": "+442030263201",
  "callee_id_name": "Henry Merrett",
  "call_direction": "outbound",
  "billing_seconds": "0",
  "call_id": "bafd2f3d-d3a9-4c7d-be75-10fca3f358ca",
  "node": "ecallmgr@kazoo-app01.cloudpbx.ai.co.uk",
  "msg_id": "1524099604028605",
  "event_name": "CHANNEL_DESTROY",
  "event_category": "call_event",
  "app_version": "4.0.0",
  "app_name": "ecallmgr",
  "interaction_id": "63691318785-9b1a9e0e",
  "interaction_key": "9b1a9e0e",
  "interaction_time": 63691318785,
  "id": "201804-bafd2f3d-d3a9-4c7d-be75-10fca3f358ca"
}
</code></pre>
<p>This call is <code>outbound</code> (b-leg) and disconnected with error <code>NORMAL_UNSPECIFIED</code> finished about 3 weeks ago. Call <code>billing_seconds</code> and <code>duration_seconds</code> is 0.</p>
<p>As you can see in this pcap kamailio not get any events from <code>ecallmgr</code> related to Call-ID <code>bafd2f3d-d3a9-4c7d-be75-10fca3f358ca</code> this is mean dialog state is maintained inside kamailio.<br>
I will try locate Call-ID <code>bafd2f3d-d3a9-4c7d-be75-10fca3f358ca</code> in sqlite dump file.</p>

<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/issues/1489#issuecomment-387961065">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZTpHLIK6Yhx-44JSoxla4tS0JqK3ks5tw9h2gaJpZM4S7yny">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36ZXwMr9zwpbrxio99e88L818MHnFbks5tw9h2gaJpZM4S7yny.gif" height="1" width="1" alt="" /></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/issues/1489#issuecomment-387961065"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue 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":"@sergey-safarov in #1489: Hello Luis @lazedo \r\nI found that kamailio is send BLF events to already disconnected Call-ID `bafd2f3d-d3a9-4c7d-be75-10fca3f358ca`.\r\nPlease looks packets 123, 125, 127, 196, 198.\r\nAnd relevant CDR from kazoo\r\n```\r\n[root@node0 ~]# curl -s -S  'https://cust.ai.co.uk/v2/accounts/a9f80a9e89baec870641c904b45e8bdd/cdrs/201804-bafd2f3d-d3a9-4c7d-be75-10fca3f358ca'  -H 'X-Auth-Token: XXXXX' | jq -j '.data'\r\n{\r\n  \"custom_channel_vars\": {\r\n    \"account_id\": \"a9f80a9e89baec870641c904b45e8bdd\",\r\n    \"authorizing_id\": \"dfa492e672c1c67d9c84d27415507a9f\",\r\n    \"authorizing_type\": \"device\",\r\n    \"bridge_id\": \"cad39f1f-be0f-1236-dba9-0242ac110006\",\r\n    \"ecallmgr_node\": \"ecallmgr@kazoo-app02.cloudpbx.ai.co.uk\",\r\n    \"inception\": \"442030263206@cust.ai.co.uk\",\r\n    \"owner_id\": \"1ac8f140e6bf1662ca0c901a04e93b07\",\r\n    \"realm\": \"ai.cust.ai.co.uk\",\r\n    \"username\": \"user_x4a5hv\"\r\n  },\r\n  \"to\": \"201@ai.cust.ai.co.uk\",\r\n  \"timestamp\": 63691318804,\r\n  \"switch_url\": \"sip:mod_sofia@31.28.75.195:11000\",\r\n  \"switch_uri\": \"sip:31.28.75.195:11000\",\r\n  \"switch_nodename\": \"freeswitch@freeswitch01.cloudpbx.ai.co.uk\",\r\n  \"ringing_seconds\": \"0\",\r\n  \"request\": \"user_x4a5hv@ai.cust.ai.co.uk\",\r\n  \"presence_id\": \"201@ai.cust.ai.co.uk\",\r\n  \"other_leg_direction\": \"inbound\",\r\n  \"other_leg_destination_number\": \"442030263206\",\r\n  \"other_leg_caller_id_number\": \"03333444466\",\r\n  \"other_leg_caller_id_name\": \"03333444466\",\r\n  \"other_leg_call_id\": \"cad39f1f-be0f-1236-dba9-0242ac110006\",\r\n  \"media_server\": \"freeswitch01.cloudpbx.ai.co.uk\",\r\n  \"local_sdp\": \"v=0\\r\\no=FreeSWITCH 1524078566 1524078567 IN IP4 31.28.75.195\\r\\ns=FreeSWITCH\\r\\nc=IN IP4 31.28.75.195\\r\\nt=0 0\\r\\nm=audio 21038 RTP/AVP 0 101 13\\r\\na=rtpmap:0 PCMU/8000\\r\\na=rtpmap:101 telephone-event/8000\\r\\na=fmtp:101 0-16\\r\\na=rtcp:21039 IN IP4 31.28.75.195\\r\\na=rtpmap:13 CN/8000\\r\\na=ptime:20\\r\\na=sendrecv\\r\\n\",\r\n  \"hangup_code\": \"sip:900\",\r\n  \"hangup_cause\": \"NORMAL_UNSPECIFIED\",\r\n  \"from\": \"03333444466@ai.cust.ai.co.uk\",\r\n  \"duration_seconds\": \"0\",\r\n  \"custom_sip_headers\": {\r\n    \"x_kazoo_invite_format\": \"username\",\r\n    \"x_kazoo_aor\": \"sip:user_x4a5hv@ai.cust.ai.co.uk\"\r\n  },\r\n  \"channel_state\": \"REPORTING\",\r\n  \"channel_name\": \"sofia/sipinterface_1/user_x4a5hv@ai.cust.ai.co.uk\",\r\n  \"channel_created_time\": 1524099604028605,\r\n  \"channel_call_state\": \"HANGUP\",\r\n  \"caller_id_number\": \"03333444466\",\r\n  \"caller_id_name\": \"03333444466\",\r\n  \"callee_id_number\": \"+442030263201\",\r\n  \"callee_id_name\": \"Henry Merrett\",\r\n  \"call_direction\": \"outbound\",\r\n  \"billing_seconds\": \"0\",\r\n  \"call_id\": \"bafd2f3d-d3a9-4c7d-be75-10fca3f358ca\",\r\n  \"node\": \"ecallmgr@kazoo-app01.cloudpbx.ai.co.uk\",\r\n  \"msg_id\": \"1524099604028605\",\r\n  \"event_name\": \"CHANNEL_DESTROY\",\r\n  \"event_category\": \"call_event\",\r\n  \"app_version\": \"4.0.0\",\r\n  \"app_name\": \"ecallmgr\",\r\n  \"interaction_id\": \"63691318785-9b1a9e0e\",\r\n  \"interaction_key\": \"9b1a9e0e\",\r\n  \"interaction_time\": 63691318785,\r\n  \"id\": \"201804-bafd2f3d-d3a9-4c7d-be75-10fca3f358ca\"\r\n}\r\n```\r\nThis call is `outbound` (b-leg) and disconnected with error `NORMAL_UNSPECIFIED` finished about 3 weeks ago. Call `billing_seconds` and `duration_seconds` is 0.\r\n\r\nAs you can see in this pcap kamailio not get any events from `ecallmgr` related to Call-ID `bafd2f3d-d3a9-4c7d-be75-10fca3f358ca` this is mean dialog state is maintained inside kamailio.\r\nI will try locate Call-ID `bafd2f3d-d3a9-4c7d-be75-10fca3f358ca` in sqlite dump file.\r\n"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1489#issuecomment-387961065"}}}</script>
<script type="application/ld+json">{"@type":"MessageCard","@context":"http://schema.org/extensions","hideOriginalBody":"false","originator":"37567f93-e2a7-4e2a-ad37-a9160fc62647","title":"Re: [kamailio/kamailio] kazoo: wrong BLF when used application/dialog-info+xml (#1489)","sections":[{"text":"","activityTitle":"**sergey-safarov**","activityImage":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","activitySubtitle":"@sergey-safarov","facts":[]}],"potentialAction":[{"name":"Add a comment","@type":"ActionCard","inputs":[{"isMultiLine":true,"@type":"TextInput","id":"IssueComment","isRequired":false}],"actions":[{"name":"Comment","@type":"HttpPOST","target":"https://api.github.com","body":"{\"commandName\":\"IssueComment\",\"repositoryFullName\":\"kamailio/kamailio\",\"issueId\":1489,\"IssueComment\":\"{{IssueComment.value}}\"}"}]},{"name":"Close issue","@type":"HttpPOST","target":"https://api.github.com","body":"{\"commandName\":\"IssueClose\",\"repositoryFullName\":\"kamailio/kamailio\",\"issueId\":1489}"},{"targets":[{"os":"default","uri":"https://github.com/kamailio/kamailio/issues/1489#issuecomment-387961065"}],"@type":"OpenUri","name":"View on GitHub"},{"name":"Unsubscribe","@type":"HttpPOST","target":"https://api.github.com","body":"{\"commandName\":\"MuteNotification\",\"threadId\":317663730}"}],"themeColor":"26292E"}</script>