[sr-dev] [kamailio/kamailio] presence: incorrect dialog state for multiple dialogs xml body (#1427)

Vasiliy Ganchev notifications at github.com
Thu Feb 15 15:24:04 CET 2018


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

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1427#issuecomment-365941679
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20180215/4d5525cb/attachment-0001.html>


More information about the sr-dev mailing list