<p>Ok <a class="user-mention" data-hovercard-user-id="184809" href="https://github.com/miconda">@miconda</a>,</p>
<p>So let's start with the failover case first.<br>
I start a call on <strong>kamailio1</strong>:<br>
<code>kamcmd> dlg.list { h_entry: 2294 h_id: 5833 ref: 2 call-id: lbiUaRwZR8x3mRiBjxWlJDpqkO9JHTdD from_uri: sip:0409828030@proxy.alex.cloud.evox.it to_uri: sip:390409828030@proxy.alex.cloud.evox.it state: 4 start_ts: 1523361570 init_ts: 1523361570 end_ts: 0 timeout: 1523361757 lifetime: 187 dflags: 643 sflags: 0 iflags: 1 caller: { tag: 2Qp.E4ft3KpSHWbjfHVMI2Q3Jz0wEyxW contact: sip:0409828030@172.16.21.38:55236;ob cseq: 1646 route_set: <sip:172.22.2.58;lr=on;ftag=2Qp.E4ft3KpSHWbjfHVMI2Q3Jz0wEyxW;did=6f8.6b92> socket: udp:172.22.2.57:5060 } callee: { tag: as47e134c0 contact: sip:39390409828030@172.16.201.101:5060 cseq: 0 route_set: <sip:172.22.2.58;lr=on;ftag=2Qp.E4ft3KpSHWbjfHVMI2Q3Jz0wEyxW;did=6f8.7b92> socket: udp:172.22.2.57:5060 } profiles: { } variables: { { ru: sip:39390409828030@carrier1.cloud.evox.it } { du: sip:172.22.2.58:5060 } { cgrSupplier: carrier1.cloud.evox.it } { cgrSuppliers: carrier1.cloud.evox.it,carrier2.cloud.evox.it,carrier3.cloud.evox.it } { cgrCallip: 172.16.21.38 } { cgrDestination: 39390409828030 } { cgrAccount: 0409828030 } { cgrTenant: evox.it } { cgrReqType: *prepaid } { calleeNumber: 39390409828030 } { au: 0409828030 } { authType: subscriber } { cgrSubsystems: "cgr_subsystems":"*resources;*suppliers;*accounts" } { originalSourceIP: 172.16.21.38 } } }</code></p>
<p>I then kill the <strong>kamailio1</strong> and start a new node <strong>kamailio2</strong> with empty dispatcher list. The call is still going on... now client side I do end the call that sends a bye to <strong>kamailio2</strong>, so the new kamailio node does this:<br>
`# -----------------------------------------------------------------------------</p>
<h1>route FOREIGN_DIALOG</h1>
<h1>short description</h1>
<h1>-----------------------------------------------------------------------------</h1>
<p>route[FOREIGN_DIALOG] {<br>
$var(breadcrumbs) = "FOREIGN_DIALOG"; BREADCRUMBS</p>
<p>xlog("L_NOTICE","[f:$fU-t:$tU id:$ci | $rm] Foreign dialog detected for Call-ID: $ci\n");</p>
<p>dlg_db_load_callid($ci);<br>
setflag(FLG_AUTH_PASSED);</p>
<p>if (is_method("BYE")) {<br>
route(CGR_CALL_END);<br>
sl_send_reply("200","OK");<br>
}<br>
exit;<br>
} # end route FOREIGN_DIALOG`</p>
<p>After the call has ended I have this in the dialog inside the kamailio2 node:</p>
<p><code>kamcmd> dlg.list { h_entry: 2294 h_id: 5833 ref: 2 call-id: lbiUaRwZR8x3mRiBjxWlJDpqkO9JHTdD from_uri: sip:0409828030@proxy.alex.cloud.evox.it to_uri: sip:390409828030@proxy.alex.cloud.evox.it state: 4 start_ts: 1523361570 init_ts: 1523361632 end_ts: 0 timeout: 1523361758 lifetime: 188 dflags: 0 sflags: 0 iflags: 1 caller: { tag: 2Qp.E4ft3KpSHWbjfHVMI2Q3Jz0wEyxW contact: sip:0409828030@172.16.21.38:55236;ob cseq: 1646 route_set: <sip:172.22.2.58;lr=on;ftag=2Qp.E4ft3KpSHWbjfHVMI2Q3Jz0wEyxW;did=6f8.6b92> socket: } callee: { tag: as47e134c0 contact: sip:39390409828030@172.16.201.101:5060 cseq: 0 route_set: <sip:172.22.2.58;lr=on;ftag=2Qp.E4ft3KpSHWbjfHVMI2Q3Jz0wEyxW;did=6f8.7b92> socket: } profiles: { } variables: { { originalSourceIP: 172.16.21.38 } { cgrSubsystems: "cgr_subsystems":"*resources;*suppliers;*accounts" } { authType: subscriber } { au: 0409828030 } { calleeNumber: 39390409828030 } { cgrReqType: *prepaid } { cgrTenant: evox.it } { cgrAccount: 0409828030 } { cgrDestination: 39390409828030 } { cgrCallip: 172.16.21.38 } { cgrSuppliers: carrier1.cloud.evox.it,carrier2.cloud.evox.it,carrier3.cloud.evox.it } { cgrSupplier: carrier1.cloud.evox.it } { du: sip:172.22.2.58:5060 } { ru: sip:39390409828030@carrier1.cloud.evox.it } } }</code></p>
<p>This stays in memory on the node and in the DB for 2 minutes after the call has ended and then it is cleared.<br>
Is this behaviour correct? Am I clear enough or do you want me to make a video of what's going on?<br>
Kind regards,<br>
Alex</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you commented.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/1274#issuecomment-380074715">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZXiYdgwsYLcxgAHlVvjO_cJYUzYPks5tnKAPgaJpZM4QAl53">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36Zf2z9I8R7K8xuGCSz8o3Gp1UGOJBks5tnKAPgaJpZM4QAl53.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/1274#issuecomment-380074715"></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":"@alexsosic in #1274: Ok @miconda,\r\n\r\nSo let's start with the failover case first.\r\nI start a call on **kamailio1**:\r\n`kamcmd\u003e dlg.list\r\n{\r\n\th_entry: 2294\r\n\th_id: 5833\r\n\tref: 2\r\n\tcall-id: lbiUaRwZR8x3mRiBjxWlJDpqkO9JHTdD\r\n\tfrom_uri: sip:0409828030@proxy.alex.cloud.evox.it\r\n\tto_uri: sip:390409828030@proxy.alex.cloud.evox.it\r\n\tstate: 4\r\n\tstart_ts: 1523361570\r\n\tinit_ts: 1523361570\r\n\tend_ts: 0\r\n\ttimeout: 1523361757\r\n\tlifetime: 187\r\n\tdflags: 643\r\n\tsflags: 0\r\n\tiflags: 1\r\n\tcaller: {\r\n\t\ttag: 2Qp.E4ft3KpSHWbjfHVMI2Q3Jz0wEyxW\r\n\t\tcontact: sip:0409828030@172.16.21.38:55236;ob\r\n\t\tcseq: 1646\r\n\t\troute_set: \u003csip:172.22.2.58;lr=on;ftag=2Qp.E4ft3KpSHWbjfHVMI2Q3Jz0wEyxW;did=6f8.6b92\u003e\r\n\t\tsocket: udp:172.22.2.57:5060\r\n\t}\r\n\tcallee: {\r\n\t\ttag: as47e134c0\r\n\t\tcontact: sip:39390409828030@172.16.201.101:5060\r\n\t\tcseq: 0\r\n\t\troute_set: \u003csip:172.22.2.58;lr=on;ftag=2Qp.E4ft3KpSHWbjfHVMI2Q3Jz0wEyxW;did=6f8.7b92\u003e\r\n\t\tsocket: udp:172.22.2.57:5060\r\n\t}\r\n\tprofiles: {\r\n\t}\r\n\tvariables: {\r\n\t\t{\r\n\t\t\tru: sip:39390409828030@carrier1.cloud.evox.it\r\n\t\t}\r\n\t\t{\r\n\t\t\tdu: sip:172.22.2.58:5060\r\n\t\t}\r\n\t\t{\r\n\t\t\tcgrSupplier: carrier1.cloud.evox.it\r\n\t\t}\r\n\t\t{\r\n\t\t\tcgrSuppliers: carrier1.cloud.evox.it,carrier2.cloud.evox.it,carrier3.cloud.evox.it\r\n\t\t}\r\n\t\t{\r\n\t\t\tcgrCallip: 172.16.21.38\r\n\t\t}\r\n\t\t{\r\n\t\t\tcgrDestination: 39390409828030\r\n\t\t}\r\n\t\t{\r\n\t\t\tcgrAccount: 0409828030\r\n\t\t}\r\n\t\t{\r\n\t\t\tcgrTenant: evox.it\r\n\t\t}\r\n\t\t{\r\n\t\t\tcgrReqType: *prepaid\r\n\t\t}\r\n\t\t{\r\n\t\t\tcalleeNumber: 39390409828030\r\n\t\t}\r\n\t\t{\r\n\t\t\tau: 0409828030\r\n\t\t}\r\n\t\t{\r\n\t\t\tauthType: subscriber\r\n\t\t}\r\n\t\t{\r\n\t\t\tcgrSubsystems: \"cgr_subsystems\":\"*resources;*suppliers;*accounts\"\r\n\t\t}\r\n\t\t{\r\n\t\t\toriginalSourceIP: 172.16.21.38\r\n\t\t}\r\n\t}\r\n}`\r\n\r\nI then kill the **kamailio1** and start a new node **kamailio2** with empty dispatcher list. The call is still going on... now client side I do end the call that sends a bye to **kamailio2**, so the new kamailio node does this:\r\n`# -----------------------------------------------------------------------------\r\n# route FOREIGN_DIALOG\r\n# short description\r\n# -----------------------------------------------------------------------------\r\nroute[FOREIGN_DIALOG] {\r\n  $var(breadcrumbs) = \"FOREIGN_DIALOG\"; BREADCRUMBS\r\n\r\n  xlog(\"L_NOTICE\",\"[f:$fU-t:$tU id:$ci | $rm] Foreign dialog detected for Call-ID: $ci\\n\");\r\n\r\n  dlg_db_load_callid($ci);\r\n  setflag(FLG_AUTH_PASSED);\r\n\r\n  if (is_method(\"BYE\")) {\r\n    route(CGR_CALL_END);\r\n    sl_send_reply(\"200\",\"OK\");\r\n  }\r\n  exit;\r\n} # end route FOREIGN_DIALOG`\r\n\r\nAfter the call has ended I have this in the dialog inside the kamailio2 node:\r\n\r\n`kamcmd\u003e dlg.list\r\n{\r\n\th_entry: 2294\r\n\th_id: 5833\r\n\tref: 2\r\n\tcall-id: lbiUaRwZR8x3mRiBjxWlJDpqkO9JHTdD\r\n\tfrom_uri: sip:0409828030@proxy.alex.cloud.evox.it\r\n\tto_uri: sip:390409828030@proxy.alex.cloud.evox.it\r\n\tstate: 4\r\n\tstart_ts: 1523361570\r\n\tinit_ts: 1523361632\r\n\tend_ts: 0\r\n\ttimeout: 1523361758\r\n\tlifetime: 188\r\n\tdflags: 0\r\n\tsflags: 0\r\n\tiflags: 1\r\n\tcaller: {\r\n\t\ttag: 2Qp.E4ft3KpSHWbjfHVMI2Q3Jz0wEyxW\r\n\t\tcontact: sip:0409828030@172.16.21.38:55236;ob\r\n\t\tcseq: 1646\r\n\t\troute_set: \u003csip:172.22.2.58;lr=on;ftag=2Qp.E4ft3KpSHWbjfHVMI2Q3Jz0wEyxW;did=6f8.6b92\u003e\r\n\t\tsocket:\r\n\t}\r\n\tcallee: {\r\n\t\ttag: as47e134c0\r\n\t\tcontact: sip:39390409828030@172.16.201.101:5060\r\n\t\tcseq: 0\r\n\t\troute_set: \u003csip:172.22.2.58;lr=on;ftag=2Qp.E4ft3KpSHWbjfHVMI2Q3Jz0wEyxW;did=6f8.7b92\u003e\r\n\t\tsocket:\r\n\t}\r\n\tprofiles: {\r\n\t}\r\n\tvariables: {\r\n\t\t{\r\n\t\t\toriginalSourceIP: 172.16.21.38\r\n\t\t}\r\n\t\t{\r\n\t\t\tcgrSubsystems: \"cgr_subsystems\":\"*resources;*suppliers;*accounts\"\r\n\t\t}\r\n\t\t{\r\n\t\t\tauthType: subscriber\r\n\t\t}\r\n\t\t{\r\n\t\t\tau: 0409828030\r\n\t\t}\r\n\t\t{\r\n\t\t\tcalleeNumber: 39390409828030\r\n\t\t}\r\n\t\t{\r\n\t\t\tcgrReqType: *prepaid\r\n\t\t}\r\n\t\t{\r\n\t\t\tcgrTenant: evox.it\r\n\t\t}\r\n\t\t{\r\n\t\t\tcgrAccount: 0409828030\r\n\t\t}\r\n\t\t{\r\n\t\t\tcgrDestination: 39390409828030\r\n\t\t}\r\n\t\t{\r\n\t\t\tcgrCallip: 172.16.21.38\r\n\t\t}\r\n\t\t{\r\n\t\t\tcgrSuppliers: carrier1.cloud.evox.it,carrier2.cloud.evox.it,carrier3.cloud.evox.it\r\n\t\t}\r\n\t\t{\r\n\t\t\tcgrSupplier: carrier1.cloud.evox.it\r\n\t\t}\r\n\t\t{\r\n\t\t\tdu: sip:172.22.2.58:5060\r\n\t\t}\r\n\t\t{\r\n\t\t\tru: sip:39390409828030@carrier1.cloud.evox.it\r\n\t\t}\r\n\t}\r\n}`\r\n\r\nThis stays in memory on the node and in the DB for 2 minutes after the call has ended and then it is cleared.\r\nIs this behaviour correct? Am I clear enough or do you want me to make a video of what's going on?\r\nKind regards,\r\nAlex"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1274#issuecomment-380074715"}}}</script>