<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 05.04.18 09:19, Sergey Basov wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAFyM+kDOC8wgAizML0dCdLXD1agu8vnckngY78PbLRXOU-kPjg@mail.gmail.com">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <p>> Are you doing msg_apply_changes before use of
                  sipt_destination()?</p>
                <p>Yes I do.<br>
                </p>
                > Why you had to do changes inside sipt module and
                not inside append_body_part()?<br>
              </div>
              I have added line to debug append_body_part() function and
              it receives string till first \x00 in input...<br>
              <br>
            </div>
            May be this problem goes from configuration parser? Can it
            parse \x00 as end of value?<br>
            <br>
          </div>
          I make change in sipt module because I create ISUP part with
          replaced \x00 by \x01 in 3 places.<br>
        </div>
        I know where they are incorrect, so I can change them to 00
        while changing number using sipt_destination()<br>
      </div>
    </blockquote>
    OK.<br>
    <br>
    I haven't looked at the code to see how the config parser handles
    this case, could be what you said.<br>
    <br>
    A solution might be to add a new function append_body_part_hex(...)
    where the parameter is given in hexadecimal without escaping and the
    conversion to binary is done inside the code of the function. Like:<br>
    <br>
    append_body_part("01 90 00 20")<br>
    <br>
    Spaces can be omitted or ignored.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <blockquote type="cite"
cite="mid:CAFyM+kDOC8wgAizML0dCdLXD1agu8vnckngY78PbLRXOU-kPjg@mail.gmail.com">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div><br>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="gmail_extra"><br clear="all">
        <div>
          <div class="gmail_signature" data-smartmail="gmail_signature">--<br>
            Best regards,<br>
            Sergey Basov                     e-mail: <a
              href="mailto:sergey.v.basov@gmail.com" target="_blank"
              moz-do-not-send="true">sergey.v.basov@gmail.com</a><br>
          </div>
        </div>
        <br>
        <div class="gmail_quote">2018-04-05 8:20 GMT+03:00 Sergey Basov
          <span dir="ltr"><<a href="mailto:sergey.v.basov@gmail.com"
              target="_blank" moz-do-not-send="true">sergey.v.basov@gmail.com</a>></span>:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">
              <div>Hi Daniel,<br>
                <br>
              </div>
              I think that kamailio while reading configuration think
              that \x00 character is the end of string..<br>
            </div>
            <div class="gmail_extra"><span class=""><br clear="all">
                <div>
                  <div class="m_8016740915552192797gmail_signature"
                    data-smartmail="gmail_signature">--<br>
                    Best regards,<br>
                    Sergey Basov                     e-mail: <a
                      href="mailto:sergey.v.basov@gmail.com"
                      target="_blank" moz-do-not-send="true">sergey.v.basov@gmail.com</a><br>
                  </div>
                </div>
                <br>
              </span>
              <div>
                <div class="h5">
                  <div class="gmail_quote">2018-04-04 19:47 GMT+03:00
                    Daniel-Constantin Mierla <span dir="ltr"><<a
                        href="mailto:miconda@gmail.com" target="_blank"
                        moz-do-not-send="true">miconda@gmail.com</a>></span>:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0
                      .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      <div text="#000000" bgcolor="#FFFFFF">
                        <p>Hello,</p>
                        <p>I haven't looked at the source code, but it
                          looks like it needs some options to make it
                          work with zero characters.</p>
                        <p>Why you had to do changes inside sipt module
                          and not inside append_body_part()?</p>
                        <p>Are you doing msg_apply_changes before use of
                          sipt_destination()?</p>
                        <p>Cheers,<br>
                          Daniel<br>
                        </p>
                        <div>
                          <div class="m_8016740915552192797h5"> <br>
                            <div
                              class="m_8016740915552192797m_-388003231625095942moz-cite-prefix">On
                              04.04.18 16:19, Sergey Basov wrote:<br>
                            </div>
                          </div>
                        </div>
                        <blockquote type="cite">
                          <div>
                            <div class="m_8016740915552192797h5">
                              <div dir="ltr">
                                <div>
                                  <div>Hi All.<br>
                                    <br>
                                  </div>
                                  Does nobody have any idea how to avoid
                                  this?<br>
                                  <br>
                                </div>
                                Thank you.<br>
                              </div>
                              <div class="gmail_extra"><br clear="all">
                                <div>
                                  <div
                                    class="m_8016740915552192797m_-388003231625095942gmail_signature"
                                    data-smartmail="gmail_signature">--<br>
                                    Best regards,<br>
                                    Sergey Basov                    
                                    e-mail: <a
                                      href="mailto:sergey.v.basov@gmail.com"
                                      target="_blank"
                                      moz-do-not-send="true">sergey.v.basov@gmail.com</a><br>
                                  </div>
                                </div>
                                <br>
                                <div class="gmail_quote">2018-04-03
                                  17:07 GMT+03:00 Sergey Basov <span
                                    dir="ltr"><<a
                                      href="mailto:sergey.v.basov@gmail.com"
                                      target="_blank"
                                      moz-do-not-send="true">sergey.v.basov@gmail.com</a>></span>:<br>
                                  <blockquote class="gmail_quote"
                                    style="margin:0 0 0
                                    .8ex;border-left:1px #ccc
                                    solid;padding-left:1ex">
                                    <div dir="ltr">
                                      <div>
                                        <div>
                                          <div>
                                            <div>
                                              <div>
                                                <div>
                                                  <div>
                                                    <div>
                                                      <div>Hi All!<br>
                                                        <br>
                                                      </div>
                                                      I have some
                                                      troubles with
                                                      encoding hex
                                                      string to use as
                                                      ISUP part.<br>
                                                      <br>
                                                    </div>
                                                    I have next line:<br>
                                                    <br>
append_body_part("\x01\x10\x48<b><wbr>\x00</b>\x0a<b>\x00</b>\x02\x09\x07\x03\x<wbr>90\x90\x13\x71\x32\x20\x0a\x04<wbr>\x02\x13\x73\x12<b>\x00</b>","applica<wbr>tion/isup;version=itu-t92+","s<wbr>ignal;handling=optional");<br>
                                                    <br>
                                                  </div>
                                                  Problem is in the <b>\x00
                                                  </b>kamailio reads
                                                  this string till first
                                                  \x00<br>
                                                  <br>
                                                </div>
                                                May be there is some
                                                workaround?<br>
                                                <br>
                                              </div>
                                              Currently I have added
                                              some C code into SIPT
                                              module to change values in
                                              this pisitions first to 00
                                              then make other changes. <br>
                                              <br>
                                            </div>
                                            My current input string is<br>
append_body_part("\x01\x10\x48<b><wbr>\x01</b>\x0a<b>\x01</b>\x02\x09\x07\x03\x<wbr>90\x90\x13\x71\x32\x20\x0a\x04<wbr>\x02\x13\x73\x12<b>\x01</b>","applica<wbr>tion/isup;version=itu-t92+","s<wbr>ignal;handling=optional");<br>
                                            <br>
                                          </div>
                                          I first make replacement \x01
                                          to \x00 while executing
                                          sipt_destination<br>
                                          <br>
                                        </div>
                                        May be there is better solution?<br>
                                        <br>
                                      </div>
                                      Thank you.<br clear="all">
                                      <div>
                                        <div>
                                          <div>
                                            <div>
                                              <div>
                                                <div>
                                                  <div>
                                                    <div>
                                                      <div>
                                                        <div>
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <div
class="m_8016740915552192797m_-388003231625095942m_-5250978348107739699gmail_signature">--<br>
                                                          Best regards,<br>
                                                          Sergey Basov  
                                                                       
                                                              e-mail: <a
href="mailto:sergey.v.basov@gmail.com" target="_blank"
                                                          moz-do-not-send="true">sergey.v.basov@gmail.com</a><br>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </div>
                                                        </div>
                                                      </div>
                                                    </div>
                                                  </div>
                                                </div>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </blockquote>
                                </div>
                                <br>
                              </div>
                              <br>
                              <fieldset
                                class="m_8016740915552192797m_-388003231625095942mimeAttachmentHeader"></fieldset>
                              <br>
                            </div>
                          </div>
                          <pre>______________________________<wbr>_________________
Kamailio (SER) - Users Mailing List
<a class="m_8016740915552192797m_-388003231625095942moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org" target="_blank" moz-do-not-send="true">sr-users@lists.kamailio.org</a>
<a class="m_8016740915552192797m_-388003231625095942moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank" moz-do-not-send="true">https://lists.kamailio.org/cgi<wbr>-bin/mailman/listinfo/sr-users</a><span class="m_8016740915552192797HOEnZb"><font color="#888888">
</font></span></pre>
                          <span class="m_8016740915552192797HOEnZb"><font
                              color="#888888"> </font></span></blockquote>
                        <span class="m_8016740915552192797HOEnZb"><font
                            color="#888888"> <br>
                            <pre class="m_8016740915552192797m_-388003231625095942moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="m_8016740915552192797m_-388003231625095942moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" target="_blank" moz-do-not-send="true">www.twitter.com/miconda</a> -- <a class="m_8016740915552192797m_-388003231625095942moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" target="_blank" moz-do-not-send="true">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - April 16-18, 2018, Berlin - <a class="m_8016740915552192797m_-388003231625095942moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank" moz-do-not-send="true">www.asipto.com</a>
Kamailio World Conference - May 14-16, 2018 - <a class="m_8016740915552192797m_-388003231625095942moz-txt-link-abbreviated" href="http://www.kamailioworld.com" target="_blank" moz-do-not-send="true">www.kamailioworld.com</a></pre>
                          </font></span></div>
                    </blockquote>
                  </div>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<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 Advanced Training - April 16-18, 2018, Berlin - <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
Kamailio World Conference - May 14-16, 2018 - <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
  </body>
</html>