<div dir="ltr"><div><div><div><div><div><div>Hi Daniel.<br><br></div>Thank you.<br><br></div>It works like expected!<br><br></div>Now when i do<br><br>set_body_multipart(,"2123894789_1257887457");<br>msg_apply_changes();<br>append_body_part_hex("01 10 48 00 0a 00 02 09 07 03 90 90 13 71 32 20 0a 04 02 13 73 12 00","application/isup;version=itu-t92+","signal;handling=optional");<br>msg_apply_changes();<br>sipt_destination($(rU{s.strip,1}), 31, 3, 0);<br>sipt_set_calling($fU, 3, 0, 3);<br><br></div>I got correct ISUP part.<br><br></div>Now I will try to document and commit some SIPT module functions to get forwarding info.<br><br></div>Thank you Daniel.<br><div><div><div><br></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">sergey.v.basov@gmail.com</a><br></div></div>
<br><div class="gmail_quote">2018-04-05 21:12 GMT+03:00 Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">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>I pushed append_body_part_hex() function in master branch, which
      expects the parameter in hexa format and it will decode it before
      adding it as a body part. Can you test the function and see if it
      works ok?</p>
    <p>Cheers,<br>
      Daniel<br>
    </p><div><div class="h5">
    <br>
    <div class="m_4517442123190565494moz-cite-prefix">On 05.04.18 09:32, Daniel-Constantin
      Mierla wrote:<br>
    </div>
    <blockquote type="cite">
      
      <p><br>
      </p>
      <br>
      <div class="m_4517442123190565494moz-cite-prefix">On 05.04.18 09:19, Sergey Basov
        wrote:<br>
      </div>
      <blockquote type="cite">
        <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">
        <div dir="ltr">
          <div>
            <div>
              <div>
                <div><br>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="gmail_extra"><br clear="all">
          <div>
            <div class="m_4517442123190565494gmail_signature" data-smartmail="gmail_signature">--<br>
              Best regards,<br>
              Sergey Basov                     e-mail: <a href="mailto:sergey.v.basov@gmail.com" target="_blank">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">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><br clear="all">
                  <div>
                    <div class="m_4517442123190565494m_8016740915552192797gmail_signature" data-smartmail="gmail_signature">--<br>
                      Best regards,<br>
                      Sergey Basov                     e-mail: <a href="mailto:sergey.v.basov@gmail.com" target="_blank">sergey.v.basov@gmail.com</a><br>
                    </div>
                  </div>
                  <br>
                </span>
                <div>
                  <div class="m_4517442123190565494h5">
                    <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">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_4517442123190565494m_8016740915552192797h5"> <br>
                              <div class="m_4517442123190565494m_8016740915552192797m_-388003231625095942moz-cite-prefix">On
                                04.04.18 16:19, Sergey Basov wrote:<br>
                              </div>
                            </div>
                          </div>
                          <blockquote type="cite">
                            <div>
                              <div class="m_4517442123190565494m_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_4517442123190565494m_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">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">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_4517442123190565494m_8016740915552192797m_-388003231625095942m_-5250978348107739699gmail_signature">--<br>
                                                          Best regards,<br>
                                                          Sergey Basov  
                                                                       
                                                              e-mail: <a href="mailto:sergey.v.basov@gmail.com" target="_blank">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_4517442123190565494m_8016740915552192797m_-388003231625095942mimeAttachmentHeader"></fieldset>
                                <br>
                              </div>
                            </div>
                            <pre>______________________________<wbr>_________________
Kamailio (SER) - Users Mailing List
<a class="m_4517442123190565494m_8016740915552192797m_-388003231625095942moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a>
<a class="m_4517442123190565494m_8016740915552192797m_-388003231625095942moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/cgi<wbr>-bin/mailman/listinfo/sr-users</a><span class="m_4517442123190565494m_8016740915552192797HOEnZb"><font color="#888888">
</font></span></pre>
                            <span class="m_4517442123190565494m_8016740915552192797HOEnZb"><font color="#888888"> </font></span></blockquote>
                          <span class="m_4517442123190565494m_8016740915552192797HOEnZb"><font color="#888888"> <br>
                              <pre class="m_4517442123190565494m_8016740915552192797m_-388003231625095942moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="m_4517442123190565494m_8016740915552192797m_-388003231625095942moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a class="m_4517442123190565494m_8016740915552192797m_-388003231625095942moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - April 16-18, 2018, Berlin - <a class="m_4517442123190565494m_8016740915552192797m_-388003231625095942moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank">www.asipto.com</a>
Kamailio World Conference - May 14-16, 2018 - <a class="m_4517442123190565494m_8016740915552192797m_-388003231625095942moz-txt-link-abbreviated" href="http://www.kamailioworld.com" target="_blank">www.kamailioworld.com</a></pre>
                            </font></span></div>
                      </blockquote>
                    </div>
                    <br>
                  </div>
                </div>
              </div>
            </blockquote>
          </div>
          <br>
        </div>
      </blockquote>
      <br>
      <pre class="m_4517442123190565494moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="m_4517442123190565494moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a class="m_4517442123190565494moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - April 16-18, 2018, Berlin - <a class="m_4517442123190565494moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank">www.asipto.com</a>
Kamailio World Conference - May 14-16, 2018 - <a class="m_4517442123190565494moz-txt-link-abbreviated" href="http://www.kamailioworld.com" target="_blank">www.kamailioworld.com</a></pre>
    </blockquote>
    <br>
    <pre class="m_4517442123190565494moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="m_4517442123190565494moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a class="m_4517442123190565494moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - April 16-18, 2018, Berlin - <a class="m_4517442123190565494moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank">www.asipto.com</a>
Kamailio World Conference - May 14-16, 2018 - <a class="m_4517442123190565494moz-txt-link-abbreviated" href="http://www.kamailioworld.com" target="_blank">www.kamailioworld.com</a></pre>
  </div></div></div>

</blockquote></div><br></div>