Using latest master, I'm getting error
Sep 16 20:16:36 lohi /usr/bin/pres-serv[1744]: ERROR: presence [presentity.c:319]: parse_dialog_state_from_body(): failed to parse xml document 'Messages-Waiting: no#015#012Message-Account: sip:jh@vm.test.tutpro.com#015#012Voice-Message: 0/0 (0/0)#015#012'
This happens when I rpc_execute 'pua_publish' request. Event package parameter in the request is 'message-summary' and content type is 'application/simple-message-summary'. Body is shown in the above error message (I added printing of it).
Since body of message-summary is not xml, why is k presence module trying to parse it as such?
I don't remember making any changes to the pua_publish request since 4.5, where it works.
-- Juha
Enclosed is pcapng of the publish request that presence server calls handle_publish() on and produces "failed to parse xml document" error message.
-- Juha
I added syslog message to handle_publish():
/* search event in the list */ event= search_event((event_t*)msg->event->parsed); if(event== NULL) { goto unsupported_event; } LM_INFO("***** event name/content_type/type '%.*s'/'%.*s'/%d\n", event->name.len, event->name.s, event->content_type.len, event->content_type.s, event->type);
and got:
Sep 16 21:43:09 lohi /usr/bin/pres-serv[29250]: INFO: presence [publish.c:305]: handle_publish(): ***** event name/content_type/type 'message-summary'/'application/simple-message-summary'/2
Otherwise OK, but type does not match event name:
enum event_type { EVENT_OTHER = 0, EVENT_PRESENCE, EVENT_PRESENCE_WINFO, EVENT_SIP_PROFILE, EVENT_XCAP_CHANGE, EVENT_DIALOG, EVENT_MESSAGE_SUMMARY, EVENT_UA_PROFILE };
-- Juha
Juha Heinanen writes:
Sep 16 21:43:09 lohi /usr/bin/pres-serv[29250]: INFO: presence [publish.c:305]: handle_publish(): ***** event name/content_type/type 'message-summary'/'application/simple-message-summary'/2
Otherwise OK, but type does not match event name:
Type 2 means PUBL_TYPE which is OK. event_parser gets it right:
Sep 16 22:20:06 lohi /usr/bin/pres-serv[31096]: INFO: <core> [parser/parse_event.c:115]: event_parser(): ********* event type of 'message-summary' is 6
Still have not figured out why xml document parsing.
-- Juha
Juha Heinanen writes:
Still have not figured out why xml document parsing.
"failed to parse xml document" error comes from this call in handle_publish:
/* querry the database and update or insert */ if(update_presentity(msg, presentity, &body, etag_gen, &sent_reply, sphere) <0) { LM_ERR("when updating presentity\n"); goto error; }
i then checked that function in presentity.c and noticed that two months ago commit
https://github.com/kamailio/kamailio/commit/839cf89b02f8817156487a960ff62013...
had added parse_dialog_state_from_body() function that calls xml parser. perhaps it has something to do with the error message?
-- juha
Hello,
I pushed a patch to master, can you try to see if works? If all ok, you can backport to 4.4 branch as well.
It was indeed a regression added by a commit trying to fix a race for dialog related events.
Cheers, Daniel
On 16/09/16 21:51, Juha Heinanen wrote: