<div dir="ltr"><div dir="ltr">Hello again,<div><br></div><div>I updated my system with latest version of Kamailio from master branch. Attached file was generated with your suggestion. This time I used Postman instead of curl.</div><div><br></div><div>Here is the output from debug:</div><div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><i>Jan 24 19:36:21 geo-location1-manager1 kamailio: 3(29836) ERROR: presence_mwi [add_events.c:110]: mwi_publ_handl(): check of body <Messages-Waiting: yes</i></div><div><i>Jan 24 19:36:21 geo-location1-manager1 kamailio: Message-Account: <a href="mailto:sip%3A100-test@172.16.30.151">sip:100-test@172.16.30.151</a></i></div><div><i>Jan 24 19:36:21 geo-location1-manager1 kamailio: Voice-Message: 1/2 (0/0)</i></div><div><i>Jan 24 19:36:21 geo-location1-manager1 kamailio: > failed at character index 22 (hexa: 0xa)</i></div><div><i>Jan 24 19:36:21 geo-location1-manager1 kamailio: 3(29836) ERROR: presence [publish.c:419]: ki_handle_publish_uri(): in event specific publish handling</i></div></div><div><i><br></i></div></blockquote>Thank you very much!</div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">чт, 24 січ. 2019 о 13:52 Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>> пише:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<p>Hello,</p>
<p>I am not sure if curl is converting \r into the single
corresponding char. Can you try to write the xml in a file, where
you ensure the \r\n are the corresponding chars -- one option
would be to do it with echo, like:</p>
<p>echo -e "first line\r\nsecond line\r\n..." >/tmp/data.xml</p>
<p>and then use curl with the parameter to read data from file.</p>
<p>I also pushed a small patch to master branch that is printing the
hexa code of the character which is wrong, so should be easier to
troubleshoot -- maybe you can test with it.</p>
<p>Cheers,<br>
Daniel<br>
</p>
<div class="gmail-m_5955618156698479268moz-cite-prefix">On 24.01.19 11:25, Володимир Іванець
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">Hello Daniel,
<div><br>
</div>
<div>According to Wireshark they are. I attached
packet pactures for two attempts. Hope they will
help to identify the problem. First one has "\n"
and second "\r\n"</div>
<div><br>
</div>
<div>First PUBLISH was generated by pua.publish like
so:</div>
</div>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div dir="ltr">
<div>
<div><i># curl -H "Content-Type: text/xml" -X
POST -d "<?xml version='1.0'
?><methodCall><methodName>pua.publish</methodName><params><param><value><string><a href="mailto:sip%3A100-test@172.16.30.151" target="_blank">sip:100-test@172.16.30.151</a></string></value></param><param><value><string>15</string></value></param><param><value><string>message-summary</string></value></param><param><value><string>application/simple-message-summary</string></value></param><param><value><string>.</string></value></param><param><value><string>.</string></value></param><param><value><string><a class="gmail-m_5955618156698479268moz-txt-link-freetext">sip:127.0.0.1:5060;transport=udp</a></string></value></param><param><value><string>Content-Length:
91</string></value></param><param><value><string>Messages-Waiting:
yes</i></div>
<div><i>Message-Account: <a href="mailto:sip%3A100-test@172.16.30.151" target="_blank">sip:100-test@172.16.30.151</a></i></div>
<div><i>Voice-Message: 1/2 (0/0)</i></div>
<div><i></string></value></param></params></methodCall>"
<a href="http://172.16.30.151:5060/XML_RPC" target="_blank">http://172.16.30.151:5060/XML_RPC</a></i></div>
</div>
<div><i><br>
</i></div>
<div><i>
<div>Jan 24 12:05:07 test kamailio: 3(27128)
ERROR: presence_mwi [add_events.c:110]:
mwi_publ_handl(): check of body
<Messages-Waiting: yes</div>
<div>Jan 24 12:05:07 test kamailio:
Message-Account: <a href="mailto:sip%3A100-test@172.16.30.151" target="_blank">sip:100-test@172.16.30.151</a></div>
<div>Jan 24 12:05:07 test kamailio:
Voice-Message: 1/2 (0/0)</div>
<div>Jan 24 12:05:07 test kamailio: >
failed at character number 22</div>
<div>Jan 24 12:05:07 test kamailio: 3(27128)
ERROR: presence [publish.c:480]:
ki_handle_publish_uri(): in event specific
publish handling</div>
<div><br>
</div>
</i></div>
</div>
</blockquote>
For second I tried adding "\r" to to the end of each
line:</div>
</div>
</div>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div dir="ltr">
<div dir="ltr">
<div>
<div><i># curl -H "Content-Type: text/xml" -X POST
-d "<?xml version='1.0'
?><methodCall><methodName>pua.publish</methodName><params><param><value><string><a href="mailto:sip%3A100-test@172.16.30.151" target="_blank">sip:100-test@172.16.30.151</a></string></value></param><param><value><string>15</string></value></param><param><value><string>message-summary</string></value></param><param><value><string>application/simple-message-summary</string></value></param><param><value><string>.</string></value></param><param><value><string>.</string></value></param><param><value><string><a class="gmail-m_5955618156698479268moz-txt-link-freetext">sip:127.0.0.1:5060;transport=udp</a></string></value></param><param><value><string>Content-Length:
97</string></value></param><param><value><string>Messages-Waiting:
yes\r</i></div>
<div><i>Message-Account: <a href="mailto:sip%3A100-test@172.16.30.151" target="_blank">sip:100-test@172.16.30.151</a>\r</i></div>
<div><i>Voice-Message: 1/2 (0/0)\r</i></div>
<div><i></string></value></param></params></methodCall>"
<a href="http://172.16.30.151:5060/XML_RPC" target="_blank">http://172.16.30.151:5060/XML_RPC</a></i></div>
</div>
<div><i><br>
</i></div>
<div><i>
<div>Jan 24 12:10:59 test kamailio: 2(27127)
ERROR: presence_mwi [add_events.c:110]:
mwi_publ_handl(): check of body
<Messages-Waiting: yes\r</div>
<div>Jan 24 12:10:59 test kamailio:
Message-Account: <a href="mailto:sip%3A100-test@172.16.30.151" target="_blank">sip:100-test@172.16.30.151</a>\r</div>
<div>Jan 24 12:10:59 test kamailio: Voice-Message:
1/2 (0/0)\r</div>
<div>Jan 24 12:10:59 test kamailio: > failed at
character number 22</div>
<div>Jan 24 12:10:59 test kamailio: 2(27127)
ERROR: presence [publish.c:480]:
ki_handle_publish_uri(): in event specific
publish handling</div>
<div><br>
</div>
</i></div>
</div>
</div>
</blockquote>
Thank you very much!</div>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail-m_5955618156698479268gmail_attr">чт, 24 січ. 2019 о 10:10
Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>>
пише:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<p>Hello,</p>
<p>are the lines ended by \r\n? Like:</p>
<p><i>Messages-Waiting: yes\r\n...</i></p>
<p>Cheers,<br>
Daniel<br>
</p>
<div class="gmail-m_5955618156698479268gmail-m_-4037824652674812596moz-cite-prefix">On
22.01.19 16:51, Володимир Іванець wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">Hello!
<div><br>
</div>
<div>I'm trying to process PUBLISH on Kamailio
(v. 5.2.1) but constantly getting "500
Server Internal Error" responce.</div>
<div><br>
</div>
<div>For packet body:</div>
</div>
</div>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div dir="ltr">
<div dir="ltr">
<div>
<div><i>Messages-Waiting: yes</i></div>
<div><i>Message-Account: <a href="mailto:sip%3A100-test@172.16.30.151" target="_blank">sip:100-test@172.16.30.151</a></i></div>
<div><i>Voice-Message: 1/2</i></div>
</div>
<div><i><br>
</i></div>
</div>
</div>
</blockquote>
... debug output is:</div>
<div>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div>
<div><i>kamailio: 2(27127) DEBUG: presence
[event_list.c:348]: search_event(): start
event= [message-summary/6]</i></div>
<div><i>kamailio: 2(27127) DEBUG: presence
[publish.c:351]: ki_handle_publish_uri():
SIP-If-Match header not found</i></div>
<div><i>kamailio: 2(27127) DEBUG: presence
[presentity.c:88]: generate_ETag(): etag=
a.1548164100.27127.7.0 / 22</i></div>
<div><i>kamailio: 2(27127) DEBUG: presence
[publish.c:360]: ki_handle_publish_uri():
new etag = a.1548164100.27127.7.0</i></div>
<div><i>kamailio: 2(27127) DEBUG: presence
[publish.c:385]: ki_handle_publish_uri():
Expires header found, value= 16</i></div>
<div><i>kamailio: 2(27127) ERROR: presence_mwi
[add_events.c:110]: mwi_publ_handl():
check of body <Messages-Waiting: yes</i></div>
<div><i>kamailio: Message-Account: <a href="mailto:sip%3A100-test@172.16.30.151" target="_blank">sip:100-test@172.16.30.151</a></i></div>
<div><i>kamailio: Voice-Message: 1/2</i></div>
<div><i>kamailio: > failed at character
number 22</i></div>
<div><i>kamailio: 2(27127) ERROR: presence
[publish.c:480]: ki_handle_publish_uri():
in event specific publish handling</i></div>
</div>
<div><i><br>
</i></div>
</blockquote>
I'm not sure, but it appears to me that check in
line 95 from <a href="https://github.com/kamailio/kamailio/blob/5.2/src/modules/presence_mwi/add_events.c" target="_blank">https://github.com/kamailio/kamailio/blob/5.2/src/modules/presence_mwi/add_events.c</a>
is not passing. I was trying to add "\n" and "\r"
to the end of each string but I always had failure
on character number 22.</div>
<div><br>
</div>
<div>Does anyone know how exactly PUBLISH packet
body should look like?</div>
<div><br>
</div>
<div>Thanks a lot!</div>
</div>
</div>
</div>
<br>
<fieldset class="gmail-m_5955618156698479268gmail-m_-4037824652674812596mimeAttachmentHeader"></fieldset>
<pre class="gmail-m_5955618156698479268gmail-m_-4037824652674812596moz-quote-pre">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="gmail-m_5955618156698479268gmail-m_-4037824652674812596moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a>
<a class="gmail-m_5955618156698479268gmail-m_-4037824652674812596moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<pre class="gmail-m_5955618156698479268gmail-m_-4037824652674812596moz-signature" cols="72">--
Daniel-Constantin Mierla -- <a class="gmail-m_5955618156698479268gmail-m_-4037824652674812596moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank">www.asipto.com</a>
<a class="gmail-m_5955618156698479268gmail-m_-4037824652674812596moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a class="gmail-m_5955618156698479268gmail-m_-4037824652674812596moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Kamailio World Conference - May 6-8, 2019 -- <a class="gmail-m_5955618156698479268gmail-m_-4037824652674812596moz-txt-link-abbreviated" href="http://www.kamailioworld.com" target="_blank">www.kamailioworld.com</a>
Kamailio Advanced Training - Mar 4-6, 2019 in Berlin; Mar 25-27, 2019, in Washington, DC, USA -- <a class="gmail-m_5955618156698479268gmail-m_-4037824652674812596moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank">www.asipto.com</a></pre>
</div>
</blockquote>
</div>
</blockquote>
<pre class="gmail-m_5955618156698479268moz-signature" cols="72">--
Daniel-Constantin Mierla -- <a class="gmail-m_5955618156698479268moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank">www.asipto.com</a>
<a class="gmail-m_5955618156698479268moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a class="gmail-m_5955618156698479268moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Kamailio World Conference - May 6-8, 2019 -- <a class="gmail-m_5955618156698479268moz-txt-link-abbreviated" href="http://www.kamailioworld.com" target="_blank">www.kamailioworld.com</a>
Kamailio Advanced Training - Mar 4-6, 2019 in Berlin; Mar 25-27, 2019, in Washington, DC, USA -- <a class="gmail-m_5955618156698479268moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank">www.asipto.com</a></pre>
</div>
</blockquote></div>