<div id="geary-body" dir="auto"><div>Hello Vlad,</div><div>Thank you for pointing out. I adjusted as following and it resolve the issue </div><div><br></div><div><div>if sys.argv[2] == "encode":</div><div>    print(encoding().strip())</div><div>elif sys.argv[2] == "decode":</div><div>    print(decoding().strip())</div><div>elif sys.argv[2] == "test":</div><div>    print(testing().strip())</div></div><div><br></div><div>volga629</div></div><div id="geary-quote" dir="auto"><br>On Tue, Jan 14, 2020 at 17:03, Vlad Patrascu <vladp@opensips.org> wrote:<br><blockquote type="cite">
  
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  
  
    <p>You get the newline from the print() function in the python
      script that you call. I've tested with your script and for example
      this fixed it:</p>
    <p>print(testing(),end="")</p>
    <pre class="moz-signature" cols="72">Vlad Patrascu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 1/14/20 3:32 PM, volga629 via Users
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:1579008735.2357.13@skillsearch.ca">
      <meta http-equiv="content-type" content="text/html;
        charset=windows-1252">
      <div id="geary-body" dir="auto">
        <div>
          <div>Hello Vlad,</div>
          <div>In lua script  we use \n only in xlog.</div>
          <div><br>
          </div>
          <div>this repository </div>
          <div><br>
          </div>
          <div><a href="https://github.com/VoIP-SAAS/opensips-smpp-lua" moz-do-not-send="true">https://github.com/VoIP-SAAS/opensips-smpp-lua</a></div>
        </div>
      </div>
      <div id="geary-quote" dir="auto"><br>
        On Tue, Jan 14, 2020 at 13:37, Vlad Patrascu
        <a class="moz-txt-link-rfc2396E" href="mailto:vladp@opensips.org"><vladp@opensips.org></a> wrote:<br>
        <blockquote type="cite">
          <meta http-equiv="Content-Type" content="text/html;
            charset=windows-1252">
          <p>I still don't think it is AVP_set function's fault for the
            whitespaces. Make sure that the string you produce in lua
            and want to return to opensips doesn't have a newline
            character at the end. It seems that syslog prints a newline
            as "#012" sometimes (if it's not actually at the end of a
            message).<br>
          </p>
          <pre class="moz-signature" cols="72">Vlad Patrascu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com" moz-do-not-send="true">http://www.opensips-solutions.com</a></pre>
          <div class="moz-cite-prefix">On 1/13/20 3:26 PM, volga629 via
            Users wrote:<br>
          </div>
          <blockquote type="cite" cite="mid:1578921976.2424.0@skillsearch.ca">
            <meta http-equiv="content-type" content="text/html;
              charset=windows-1252">
            <div id="geary-body" dir="auto">
              <div>Hello Vlad,</div>
              <div>Yes, it still in issue, but we have work around.
                 #012 it insert white spaces. </div>
              <div><br>
              </div>
              <div>$avp(sms-out) = $(avp(formatted-msg){s.trimr});</div>
            </div>
            <div id="geary-quote" dir="auto"><br>
              On Mon, Jan 13, 2020 at 12:26, Vlad Patrascu <a class="moz-txt-link-rfc2396E" href="mailto:vladp@opensips.org" moz-do-not-send="true"><vladp@opensips.org></a>
              wrote:<br>
              <blockquote type="cite">
                <meta http-equiv="Content-Type" content="text/html;
                  charset=windows-1252">
                <p>Hi Volga,</p>
                <p>Sorry for getting to this so late. Do you still
                  encounter this issue? I have tried to reproduce this
                  myself but it seems that AVP_set() does set the value
                  correctly.</p>
                <p>Regards,<br>
                </p>
                <pre class="moz-signature" cols="72">Vlad Patrascu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com" moz-do-not-send="true">http://www.opensips-solutions.com</a></pre>
                <div class="moz-cite-prefix">On 12/14/19 7:12 AM,
                  volga629 via Users wrote:<br>
                </div>
                <blockquote type="cite" cite="mid:1576300326.3097.7@skillsearch.ca">
                  <meta http-equiv="content-type" content="text/html;
                    charset=windows-1252">
                  <div id="geary-body" dir="auto">
                    <div>Hello Everyone,</div>
                    <div>Having some issue get lua to set proper avp.
                       When it set in insert some extra characters into
                      value of avp</div>
                    <div>Here are log </div>
                    <div><br>
                    </div>
                    <div><br>
                    </div>
                    <div>
                      <div>Dec 14 05:53:41 dev1-fr
                        /usr/sbin/opensips[12985]: siplua: test::wwwww
                        nah.uy/u5bmnc</div>
                      <div>Dec 14 05:53:41 dev1-fr
                        /usr/sbin/opensips[12985]: siplua: Tested string
                        ~>0</div>
                      <div>Dec 14 05:53:41 dev1-fr
                        /usr/sbin/opensips[12985]: SMS_ROUTE_IN: Test
                        string ~> [0#012]</div>
                    </div>
                    <div><br>
                    </div>
                    <div>It insert #012</div>
                    <div><br>
                    </div>
                    <div>Lua script </div>
                    <div><br>
                    </div>
                    <div>
                      <div>                local cmd_var =
                        handle:read("*all")</div>
                      <div>                handle:close()</div>
                      <div>                xlog("Tested string ~> "
                        .. cmd_var .. "\n")</div>
                      <div>                r eturn AVP_set("test-str",
                        cmd_var)</div>
                    </div>
                    <div><br>
                    </div>
                    <div>Any help thank you</div>
                    <div><br>
                    </div>
                    <div>volga629</div>
                  </div>
                  <br>
                  <fieldset class="mimeAttachmentHeader"></fieldset>
                  <pre class="moz-quote-pre" wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" moz-do-not-send="true">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" moz-do-not-send="true">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
                </blockquote>
              </blockquote>
            </div>
            <br>
            <fieldset class="mimeAttachmentHeader"></fieldset>
            <pre class="moz-quote-pre" wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" moz-do-not-send="true">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" moz-do-not-send="true">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
          </blockquote>
        </blockquote>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
  

</blockquote></div>