<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hi Nikita,<br>
      <br>
      You use the str_init() macro in a wrong way - it is intended to
      take as param a static string (ie. str_init("test string") ) and
      not a pointer, as you do.<br>
      str_init() macro does a sizeof, and for you it will be 8 (size of
      a pointer on 64bit) -&gt; with one null termination -&gt; 7 left
      :).<br>
      <br>
      Regards,<br>
      <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
      On 05.12.2014 10:40, Nikita Tarasov wrote:<br>
    </div>
    <blockquote
cite="mid:trinity-6b317372-619c-4438-a0f2-4459493b80e7-1417768841133@3capp-mailcom-bs10"
      type="cite">
      <div style="font-family: Verdana;font-size: 12.0px;">
        <div>We are creating module for opensips working similar to
          call_control. This module exchanges with our software via unix
          socket. I developed mostly the all functionality that we want
          <span dir="auto">nevertheless I got very strange result in
            setting AVP variable via module. This variable with string
            is cutting after 7th symbol.</span></div>
        <div> </div>
        <div>How can I increase AVP string variable length?</div>
        <div> </div>
        <div> </div>
        <div>code example</div>
        <div> </div>
        <div>pv_value_t spec_value;</div>
        <div>pch = strtok (NULL, "\r\n:");</div>
        <div>
          <div>str text = str_init(pch);<br>
            spec_value.rs = text;<br>
            spec_value.flags = PV_VAL_STR;</div>
          <div>if
            (pv_set_value(msg,&amp;(mediagateway_avp_spec),0,&amp;spec_value)
            != 0){<br>
                LM_ERR("Failed to set the output variable\n");<br>
            }</div>
          <div> </div>
          <div> </div>
          <div> </div>
          <div>Nikita</div>
        </div>
        <div> </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Devel@lists.opensips.org">Devel@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/devel">http://lists.opensips.org/cgi-bin/mailman/listinfo/devel</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>