Hi, Daniel! Thank you for your help!
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.
What I tried more: I changed: ` && xmlStrcmp(node->name, node->next->name) == 0) { ` to ` && xmlStrcmp(node->next->name, (const xmlChar *)"dialog") == 0) { ` and now second dialog compare works, appropriate logs are (all is the same as in my latest comment): ``` 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 ``` in my understanding of your proposed patch, we compare: `node->name` - is always the name of current node `node->next->name` - name of next node such compare would match only if there are to consecutive "dialog" nodes. (and that did not happen in my yesterday's tests).
Sorry if I'am writing/supposing something trivial or incorrect, I have never worked before with libxml and XML from C code as well.
Thanks