<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">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>sip:127.0.0.1:5060;transport=udp</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">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">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">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">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>sip:127.0.0.1:5060;transport=udp</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">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">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">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_attr">чт, 24 січ. 2019 о 10:10 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>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_-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_-4037824652674812596mimeAttachmentHeader"></fieldset>
<pre class="gmail-m_-4037824652674812596moz-quote-pre">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="gmail-m_-4037824652674812596moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a>
<a class="gmail-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_-4037824652674812596moz-signature" cols="72">--
Daniel-Constantin Mierla -- <a class="gmail-m_-4037824652674812596moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank">www.asipto.com</a>
<a class="gmail-m_-4037824652674812596moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a class="gmail-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_-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_-4037824652674812596moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank">www.asipto.com</a></pre>
</div>
</blockquote></div>