<div dir="ltr">Is this the correct solution?</div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Mon, 3 Feb 2025 at 09:45, 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">This issue is resolved after changing 

MAX_HEADER_FIELD_LEN  to 2048</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 3 Feb 2025 at 06:28, 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>
<div dir="auto">In <a rel="noreferrer noopener" href="https://github.com/OpenSIPS/opensips/blob/master/modules/rest_client/rest_cb.h" target="_blank">https://github.com/OpenSIPS/opensips/blob/master/modules/rest_client/rest_cb.h</a>, the MAX_HEADER_FIELD_LEN is only 1024.</div>
<div><br>
</div>
<div id="m_-2264136945601082926m_6281819389899074189ms-outlook-mobile-signature" dir="auto">Sent from <a href="https://aka.ms/AAb9ysg" target="_blank">
Outlook for Android</a></div>
<hr style="display:inline-block;width:98%">
<div id="m_-2264136945601082926m_6281819389899074189divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Prathibha B <<a href="mailto:prathibhab.tvm@gmail.com" target="_blank">prathibhab.tvm@gmail.com</a>><br>
<b>Sent:</b> Sunday, February 2, 2025 8:13:31 PM<br>
<b>To:</b> Bogdan-Andrei Iancu <<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>><br>
<b>Cc:</b> OpenSIPS users mailling list <<a href="mailto:users@lists.opensips.org" target="_blank">users@lists.opensips.org</a>><br>
<b>Subject:</b> Re: [OpenSIPS-Users] SIP Push Notification</font>
<div> </div>
</div>
<div>
<div dir="ltr"><font size="4">The bearer token is lengthy.</font></div>
<br>
<div>
<div dir="ltr">On Sun, 2 Feb 2025 at 20:10, Prathibha B <<a href="mailto:prathibhab.tvm@gmail.com" target="_blank">prathibhab.tvm@gmail.com</a>> wrote:<br>
</div>
<blockquote 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>
<div dir="ltr">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 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_-2264136945601082926m_6281819389899074189x_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>
<div dir="ltr">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 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>-- </span><br>
<div dir="ltr">
<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>-- </span><br>
<div dir="ltr">
<div dir="ltr">
<div>Regards,</div>
<div>B.Prathibha<br>
</div>
</div>
</div>
</blockquote>
</div>
<div><br clear="all">
</div>
<div><br>
</div>
<span>-- </span><br>
<div dir="ltr">
<div dir="ltr">
<div>Regards,</div>
<div>B.Prathibha<br>
</div>
</div>
</div>
</blockquote>
</div>
<div><br clear="all">
</div>
<div><br>
</div>
<span>-- </span><br>
<div dir="ltr">
<div dir="ltr">
<div>Regards,</div>
<div>B.Prathibha<br>
</div>
</div>
</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>