<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" 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="moz-cite-prefix">On 22.01.19 16:51, Володимир Іванець
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAOQgkjba=qKA6aGKxG4LpcZbrUXT5CX_vA_os_FEzbEw5cHcNg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <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"
                            moz-do-not-send="true">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"
                        moz-do-not-send="true">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"
                moz-do-not-send="true">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="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio World Conference - May 6-8, 2019 -- <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a>
Kamailio Advanced Training - Mar 4-6, 2019 in Berlin; Mar 25-27, 2019, in Washington, DC, USA -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a></pre>
  </body>
</html>