<div dir="ltr"><font size="4">The bearer token is lengthy.</font></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Sun, 2 Feb 2025 at 20:10, Prathibha B <<a href="mailto:prathibhab.tvm@gmail.com">prathibhab.tvm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><font size="4">How yo increase the buffer size in Opensips?</font></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 2 Feb 2025 at 20:04, Prathibha B <<a href="mailto:prathibhab.tvm@gmail.com" target="_blank">prathibhab.tvm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><font size="4">i'e corrected the third param.still getting this error:</font><span style="color:rgb(80,0,80)"><div><font size="4">rest_client:rest_append_hf_method: header field buffer too small</font></div><div><font size="4"><br></font></div><div><div dir="ltr" style="color:rgb(34,34,34)"><font size="4">i tried increasing the shared memory using -m switch to 7192, still opensips crashes with the buffer too small error.</font></div><div style="color:rgb(34,34,34)"><div style="margin:5px 0px"><div id="m_2269089026250066021m_-2689446984930908997gmail-q_155" style="background-color:rgb(232,234,237);border:none;clear:both;line-height:6px;outline:none;width:24px;color:rgb(80,0,80);font-size:11px;border-radius:5.5px"><br></div></div></div></div></span></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 31 Jan 2025 at 15:30, Bogdan-Andrei Iancu <<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>

  
    
  
  <div>
    <font face="monospace">The error has nothing to do with PN, but with
      the way you use the rest_post() function. The error log is 100%
      clear - the third param you pass to the function is not a string!<br>
      <br>
      Regards,<br>
    </font>
    <pre cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a href="https://www.opensips-solutions.com" target="_blank">https://www.opensips-solutions.com</a>
  <a href="https://www.siphub.com" target="_blank">https://www.siphub.com</a></pre>
    <div>On 30.01.2025 09:25, Prathibha B wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div>this is my route for sending Push Notification:
          <div><br>
          </div>
          <div>route [PN_SEND]<br>
            {<br>
                # send a PN using, for example, exec or rest_client<br>
                # Define FCM URL<br>
                $var(fcm_url) = "<a href="https://fcm.googleapis.com/v1/projects/asterisk-push-notificaiton/messages:send" target="_blank">https://fcm.googleapis.com/v1/projects/xxx/messages:send</a>";<br>
            <br>
                # Set HTTP headers<br>
                rest_append_hf("Authorization: Bearer ya29.c.c0AS...");<br>
                #rest_append_hf("Content-Type: application/json");<br>
                rest_append_hf("Content-Type: \"application/json\"");<br>
            <br>
                # Create JSON payload<br>
                $var(json_payload) = '{\"message\": {\"token\":
            \"xxx\",\"notification\": {\"title\": \"Notification
            Title\",\"body\": \"Notification Body\"}}}';<br>
            <br>
                # Send REST POST request<br>
                if (launch(rest_post($var(fcm_url),
            "$var(json_payload)", $avp(response_body),
            $avp(response_code)))) {<br>
                    xlog("L_INFO", "Push notification sent successfully.
            Response code: $avp(response_code)\n");<br>
                } else {<br>
                    xlog("L_ERR", "Failed to send push notification.
            Response code: $avp(response_code)\n");<br>
                }<br>
            }<br>
          </div>
          <div><br>
          </div>
          <div>But I get the following error while running Opensips:</div>
          <div>ERROR:rest_client:rest_append_hf_method: header field
            buffer too small<br>
            Jan 30 12:29:09 ngdcs opensips[102753]:
            ERROR:core:get_cmd_fixups: Variable in param [3] is not a
            string<br>
            Jan 30 12:29:09 ngdcs opensips[102753]:
            ERROR:core:do_action: Failed to get fixups for launch
            command <rest_post></div>
          <div><br>
          </div>
          <div>Can you pls help to resolve the issue?</div>
        </div>
        <div><br>
        </div>
        <span class="gmail_signature_prefix">-- </span><br>
        <div dir="ltr" class="gmail_signature">
          <div dir="ltr">
            <div>Regards,</div>
            <div>B.Prathibha<br>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <pre>_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </div>

</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,</div><div>B.Prathibha<br></div></div></div>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,</div><div>B.Prathibha<br></div></div></div>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,</div><div>B.Prathibha<br></div></div></div>