<p>Hi, Daniel! Thank you for your help!</p>
<p>I tried to print that value in logs, but get stuck a bit (I did not found how to print xml elements correctly). I got some sequence of crashes while attempts to add appropriate logs.</p>
<p>What I tried more:<br>
I changed:<br>
<code>&& xmlStrcmp(node->name, node->next->name) == 0) {</code><br>
to<br>
<code>&& xmlStrcmp(node->next->name, (const xmlChar *)"dialog") == 0) {</code><br>
and now second dialog compare works, appropriate logs are (all is the same as in my latest comment):</p>
<pre><code>Feb 15 15:15:18 0050562c117c /usr/sbin/kamailio[8030]: ERROR: presence [presentity.c:361]: ps_match_dialog_state_from_body(): vstate is terminated, tmp_state is terminated
Feb 15 15:15:18 0050562c117c /usr/sbin/kamailio[8030]: ERROR: presence [presentity.c:375]: ps_match_dialog_state_from_body(): do entered 
Feb 15 15:15:18 0050562c117c /usr/sbin/kamailio[8030]: ERROR: presence [presentity.c:389]: ps_match_dialog_state_from_body(): node->next 
Feb 15 15:15:18 0050562c117c /usr/sbin/kamailio[8030]: ERROR: presence [presentity.c:375]: ps_match_dialog_state_from_body(): do entered 
Feb 15 15:15:18 0050562c117c /usr/sbin/kamailio[8030]: ERROR: presence [presentity.c:385]: ps_match_dialog_state_from_body(): break it 
Feb 15 15:15:18 0050562c117c /usr/sbin/kamailio[8030]: ERROR: presence [presentity.c:361]: ps_match_dialog_state_from_body(): vstate is terminated, tmp_state is confirmed
Feb 15 15:15:18 0050562c117c /usr/sbin/kamailio[8030]: ERROR: presence [presentity.c:364]: ps_match_dialog_state_from_body(): states are different! goto done 
Feb 15 15:15:18 0050562c117c /usr/sbin/kamailio[8030]: ERROR: presence [presentity.c:395]: ps_match_dialog_state_from_body(): going to return rmatch 0
</code></pre>
<p>in my understanding of your proposed patch, we compare:<br>
<code>node->name</code> - is always the name of current node<br>
<code>node->next->name</code> - name of next node<br>
such compare would match only if there are to consecutive "dialog" nodes. (and that did not happen in my yesterday's tests).</p>
<p>Sorry if I'am writing/supposing something trivial or incorrect, I have never worked before with libxml and XML from C code as well.</p>
<p>Thanks</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/1427#issuecomment-365941679">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36Zb3ju-RdtkGsxWL-0b1MUT5y2CTZks5tVD4EgaJpZM4R5QB3">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZThbH-xovk0ruuON2s2X_7UU_U2Sks5tVD4EgaJpZM4R5QB3.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/issues/1427#issuecomment-365941679"></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":"@vance-od in #1427: Hi, Daniel! Thank you for your help!\r\n\r\nI tried to print that value in logs, but get stuck a bit (I did not found how to print xml elements correctly). I got some sequence of crashes while attempts to add appropriate logs.\r\n\r\nWhat I tried more:\r\nI changed:\r\n`\t\t\t\t\t\u0026\u0026 xmlStrcmp(node-\u003ename, node-\u003enext-\u003ename) == 0) {\r\n`\r\nto\r\n`\t\t\t\t\t\u0026\u0026 xmlStrcmp(node-\u003enext-\u003ename, (const xmlChar *)\"dialog\") == 0) {\r\n`\r\nand now second dialog compare works, appropriate logs are (all is the same as in my latest comment):\r\n```\r\nFeb 15 15:15:18 0050562c117c /usr/sbin/kamailio[8030]: ERROR: presence [presentity.c:361]: ps_match_dialog_state_from_body(): vstate is terminated, tmp_state is terminated\r\nFeb 15 15:15:18 0050562c117c /usr/sbin/kamailio[8030]: ERROR: presence [presentity.c:375]: ps_match_dialog_state_from_body(): do entered \r\nFeb 15 15:15:18 0050562c117c /usr/sbin/kamailio[8030]: ERROR: presence [presentity.c:389]: ps_match_dialog_state_from_body(): node-\u003enext \r\nFeb 15 15:15:18 0050562c117c /usr/sbin/kamailio[8030]: ERROR: presence [presentity.c:375]: ps_match_dialog_state_from_body(): do entered \r\nFeb 15 15:15:18 0050562c117c /usr/sbin/kamailio[8030]: ERROR: presence [presentity.c:385]: ps_match_dialog_state_from_body(): break it \r\nFeb 15 15:15:18 0050562c117c /usr/sbin/kamailio[8030]: ERROR: presence [presentity.c:361]: ps_match_dialog_state_from_body(): vstate is terminated, tmp_state is confirmed\r\nFeb 15 15:15:18 0050562c117c /usr/sbin/kamailio[8030]: ERROR: presence [presentity.c:364]: ps_match_dialog_state_from_body(): states are different! goto done \r\nFeb 15 15:15:18 0050562c117c /usr/sbin/kamailio[8030]: ERROR: presence [presentity.c:395]: ps_match_dialog_state_from_body(): going to return rmatch 0\r\n```\r\nin my understanding of your proposed patch, we compare:\r\n`node-\u003ename` - is always the name of current node \r\n`node-\u003enext-\u003ename` - name of next node\r\nsuch compare would match only if there are to consecutive \"dialog\" nodes. (and that did not happen in my yesterday's tests).\r\n\r\nSorry if I'am writing/supposing something trivial or incorrect, I have never worked before with libxml and XML from C code as well.\r\n\r\nThanks"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1427#issuecomment-365941679"}}}</script>