<html><head></head><body><div style="color:#000; background-color:#fff; font-family:標楷體, dfkai-sb;font-size:16px"><div id="yui_3_16_0_ym19_1_1518745723612_3249">HI Liviu,</div><div><br></div><div id="yui_3_16_0_ym19_1_1518745723612_3250">Thanks for the prompt reply as you guys always do :). I'll rebuild my opensips and test again. I'll get back to you with results.</div><div id="yui_3_16_0_ym19_1_1518745723612_3251"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1518745723612_3252"><a href="mailto:liviu@opensips.org" id="yui_3_16_0_ym19_1_1518745723612_3245"><span data-name="Liviu Chircu" data-address="liviu@opensips.org" title="" data-action="contact-card-menu" tabindex="0" role="button" id="yui_3_16_0_ym19_1_1518745723612_3246"><br></span></a></div><div id="yui_3_16_0_ym19_1_1518745723612_3253"><span></span></div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: 標楷體, dfkai-sb; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 16px;"> <div dir="ltr"><font size="2" face="Arial"> On Thursday, 15 February 2018, 22:38, Liviu Chircu <liviu@opensips.org> wrote:<br></font></div>  <br><br> <div class="y_msg_container"><div id="yiv5521930329"><div>
    <div><tt>Hi Pasan,</tt></div>
    <div><tt>Thank you for the report - I have spotted and fixed [1] a bug
        in rest_append_hf() that could definitely lead to a world of
        problems. Can you try to pull the latest version of 2.3 and try
        again? If you're running off packages, the only option is to
        wait until tomorrow and deploy the nightly built ones. </tt></div>
    <div><tt>Cheers,<br clear="none">
      </tt></div>
    <div><tt>[1]: <a rel="nofollow" shape="rect" class="yiv5521930329moz-txt-link-freetext" target="_blank" href="https://github.com/OpenSIPS/opensips/commit/888d5e9b3f9">https://github.com/OpenSIPS/opensips/commit/888d5e9b3f9</a></tt><br clear="none">
    </div>
    <pre class="yiv5521930329moz-signature">Liviu Chircu
OpenSIPS Developer
<a rel="nofollow" shape="rect" class="yiv5521930329moz-txt-link-freetext" target="_blank" href="http://www.opensips-solutions.com/">http://www.opensips-solutions.com</a></pre>
    <div class="yiv5521930329yqt7273946508" id="yiv5521930329yqt54998"><div class="yiv5521930329moz-cite-prefix">On 15.02.2018 11:53, Pasan Meemaduma
      via Users wrote:<br clear="none">
    </div>
    <blockquote type="cite">
      <div style="color:#000;background-color:#fff;font-family:標楷體, dfkai-sb;font-size:16px;">
        <div id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50326">Hi List,</div>
        <div id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50327"><br clear="none">
        </div>
        <div dir="ltr" id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50328">I'm
          trying to use rest_append_hf function to append an extra
          header for my rest call. But it doesn't set it unless I call
          the same function twice.</div>
        <div dir="ltr" id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50298"><br clear="none">
        </div>
        <div dir="ltr" id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50329">How do
          I get around this ? I tried async() statement as well as per
          docs but it didn't work either.</div>
        <div dir="ltr" id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50330"><br clear="none">
        </div>
        <div dir="ltr" id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50331">I'm
          using opensips 2.3.3</div>
        <div dir="ltr" id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50332"><br clear="none">
        </div>
        <div dir="ltr" id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50299">route(xxxx);<br id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50339" clear="none">
        </div>
        <div dir="ltr" id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50415"><br clear="none">
        </div>
        <div dir="ltr" id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50340">route[xxxx]
          {<br id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50390" clear="none">
              rest_append_hf("Accept: application/vnd.xxx.vapi+json;
          version=2");<br id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50391" clear="none">
              $var(rc) = rest_post(<a rel="nofollow" shape="rect" class="yiv5521930329moz-txt-link-rfc2396E" target="_blank" href="http://%7B%7BAPI_USER%7D%7D:%7B%7BAPI_SECRET%7D%7D@{{api_host}}/xx/xx/xx">"http://{{ API_USER }}:{{ API_SECRET
          }}@{{ API_HOST }}/xx/xx/xx"</a>, "{ \"xx\": { \"xx\": [
          \"$var(auth_user)\" ] }}", "application/json", "$var(body)",
          "$var(ct)", "$var(rcode)");<br id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50392" clear="none">
              $json(res) := $var(body);<br id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50394" clear="none">
              if($json(res/success) != 1 ) {<br id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50395" clear="none">
                  xlog("L_ERR", "API: Failed to Blocked call request -
          M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50396" clear="none">
              } else {<br id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50397" clear="none">
                  xlog("L_WARN", "API: Blocked call request - M=$rm
          RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50398" clear="none">
              }<br id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50399" clear="none">
          }<br id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50400" clear="none">
          <br clear="none">
        </div>
        <div id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50205">Accept header
          will only send if I call route(xxxx) twice :/.</div>
        <div id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50494"><br clear="none">
        </div>
        <div id="yiv5521930329yui_3_16_0_ym19_1_1518659984271_50495"><br clear="none">
        </div>
      </div>
      <br clear="none">
      <fieldset class="yiv5521930329mimeAttachmentHeader"></fieldset>
      <br clear="none">
      <pre>_______________________________________________
Users mailing list
<a rel="nofollow" shape="rect" class="yiv5521930329moz-txt-link-abbreviated" ymailto="mailto:Users@lists.opensips.org" target="_blank" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a rel="nofollow" shape="rect" class="yiv5521930329moz-txt-link-freetext" target="_blank" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote></div>
    <br clear="none">
  </div></div><div class="yqt7273946508" id="yqt61088">_______________________________________________<br clear="none">Users mailing list<br clear="none"><a shape="rect" ymailto="mailto:Users@lists.opensips.org" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br clear="none"><a shape="rect" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br clear="none"></div><br><br></div>  </div> </div>  </div></div></body></html>