[OpenSIPS-Users] SIP Push Notification

Prathibha B prathibhab.tvm at gmail.com
Thu Feb 6 05:29:49 UTC 2025


Now I'm not getting any error but the request is not getting forwarded to
the main registrar.

if (is_method("REGISTER")) {
                mid_registrar_save("location");
                switch ($retcode) {
                case 1:
                        xlog("forwarding REGISTER to main registrar
($$ci=$ci$ru)\n");
                        $ru = "sip:10.214.0.18:1443";
                        if (!t_relay()) {
                        send_reply(500, "Server Internal Error 1");
                }
                        break;
                case 2:
                        xlog("absorbing REGISTER! ($$ci=$ci)\n");
                        break;
                default:
                        xlog("failed to save registration! ($$ci=$ci)\n");
                }

                exit;
        }

On Wed, 5 Feb 2025 at 15:06, Prathibha B <prathibhab.tvm at gmail.com> wrote:

> These issues are resolved. I download ca_list from lets encrypt site. Now
> I get the following errors:
>
> ERROR:proto_wss:ws_parse_rpl_http_fl: invalid first line: reply code <302
> Moved Temporarily>
> ERROR:proto_wss:ws_parse_rpl_handshake: cannot parse the first line of the
> message
>
> On Wed, 5 Feb 2025 at 13:03, Prathibha B <prathibhab.tvm at gmail.com> wrote:
>
>> Now I'm using midregistrar. I get the following errors:
>>
>> ERROR:proto_wss:wss_conn_init: no TLS client domain found
>> Feb  5 13:01:44 [36844] ERROR:core:tcp_conn_create: failed to do proto 6
>> specific init for conn 0x7fdb7ffb4870
>> Feb  5 13:01:44 [36844] DBG:core:tcpconn_destroy: delaying
>> (0x7fdb7ffb4870, flags 0018) ref = -1 ...
>> Feb  5 13:01:44 [36844] ERROR:proto_wss:ws_sync_connect: tcp_conn_create
>> failed, closing the socket
>> Feb  5 13:01:44 [36844] ERROR:proto_wss:ws_connect: connect failed
>> Feb  5 13:01:44 [36844] ERROR:proto_wss:proto_wss_send: connect failed
>> Feb  5 13:01:44 [36844] ERROR:tm:msg_send: send() to 10.214.0.18:1443
>> for proto wss/6 failed
>> Feb  5 13:01:44 [36844] ERROR:tm:t_forward_nonack: sending request failed
>> Feb  5 13:01:44 [36844] ERROR:tm:w_t_relay: t_forward_nonack failed
>>
>> In asterisk, I get the errors:
>>  tcptls.c:179 handle_tcptls_connection: Unable to set up ssl connection
>> with peer '10.214.0.18:34529'
>> [Feb  5 13:01:44] ERROR[36873]: iostream.c:552 ast_iostream_close:
>> SSL_shutdown() failed: error:00000001:lib(0)::reason(1), Internal SSL error
>> [Feb  5 13:03:49] ERROR[37370]: iostream.c:647 ast_iostream_start_tls:
>> Problem setting up ssl connection: error:00000001:lib(0)::reason(1),
>> Internal SSL error
>>
>> How to resolve these errors?
>>
>> On Tue, 4 Feb 2025 at 13:44, Prathibha B <prathibhab.tvm at gmail.com>
>> wrote:
>>
>>> How to fwd the INVITE from opensips to Asterisk?
>>>
>>> I tried using
>>> sethostport("ip:port");
>>> t_relay();
>>>
>>> But it is not working.
>>>
>>> On Mon, 3 Feb 2025 at 13:08, Bogdan-Andrei Iancu <bogdan at opensips.org>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> Yes, it is, maybe we should do that length configurable as modparam and
>>>> not compile option.
>>>>
>>>> Regards,
>>>> Bogdan
>>>>
>>>> Bogdan-Andrei Iancu
>>>>
>>>> OpenSIPS Founder and Developer
>>>>   https://www.opensips-solutions.com
>>>>   https://www.siphub.com
>>>>
>>>> On 03.02.2025 06:15, Prathibha B wrote:
>>>>
>>>> Is this the correct solution?
>>>>
>>>> On Mon, 3 Feb 2025 at 09:45, Prathibha B <prathibhab.tvm at gmail.com>
>>>> wrote:
>>>>
>>>>> This issue is resolved after changing  MAX_HEADER_FIELD_LEN  to 2048
>>>>>
>>>>> On Mon, 3 Feb 2025 at 06:28, Prathibha B <prathibhab.tvm at gmail.com>
>>>>> wrote:
>>>>>
>>>>>> In
>>>>>> https://github.com/OpenSIPS/opensips/blob/master/modules/rest_client/rest_cb.h,
>>>>>> the MAX_HEADER_FIELD_LEN is only 1024.
>>>>>>
>>>>>> Sent from Outlook for Android <https://aka.ms/AAb9ysg>
>>>>>> ------------------------------
>>>>>> *From:* Prathibha B <prathibhab.tvm at gmail.com>
>>>>>> *Sent:* Sunday, February 2, 2025 8:13:31 PM
>>>>>> *To:* Bogdan-Andrei Iancu <bogdan at opensips.org>
>>>>>> *Cc:* OpenSIPS users mailling list <users at lists.opensips.org>
>>>>>> *Subject:* Re: [OpenSIPS-Users] SIP Push Notification
>>>>>>
>>>>>> The bearer token is lengthy.
>>>>>>
>>>>>> On Sun, 2 Feb 2025 at 20:10, Prathibha B <prathibhab.tvm at gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>> How yo increase the buffer size in Opensips?
>>>>>>
>>>>>> On Sun, 2 Feb 2025 at 20:04, Prathibha B <prathibhab.tvm at gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>> i'e corrected the third param.still getting this error:
>>>>>> rest_client:rest_append_hf_method: header field buffer too small
>>>>>>
>>>>>> i tried increasing the shared memory using -m switch to 7192, still
>>>>>> opensips crashes with the buffer too small error.
>>>>>>
>>>>>>
>>>>>> On Fri, 31 Jan 2025 at 15:30, Bogdan-Andrei Iancu <
>>>>>> bogdan at opensips.org> wrote:
>>>>>>
>>>>>> 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!
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Bogdan-Andrei Iancu
>>>>>>
>>>>>> OpenSIPS Founder and Developer
>>>>>>   https://www.opensips-solutions.com
>>>>>>   https://www.siphub.com
>>>>>>
>>>>>> On 30.01.2025 09:25, Prathibha B wrote:
>>>>>>
>>>>>> this is my route for sending Push Notification:
>>>>>>
>>>>>> route [PN_SEND]
>>>>>> {
>>>>>>     # send a PN using, for example, exec or rest_client
>>>>>>     # Define FCM URL
>>>>>>     $var(fcm_url) = "
>>>>>> https://fcm.googleapis.com/v1/projects/xxx/messages:send
>>>>>> <https://fcm.googleapis.com/v1/projects/asterisk-push-notificaiton/messages:send>
>>>>>> ";
>>>>>>
>>>>>>     # Set HTTP headers
>>>>>>     rest_append_hf("Authorization: Bearer ya29.c.c0AS...");
>>>>>>     #rest_append_hf("Content-Type: application/json");
>>>>>>     rest_append_hf("Content-Type: \"application/json\"");
>>>>>>
>>>>>>     # Create JSON payload
>>>>>>     $var(json_payload) = '{\"message\": {\"token\":
>>>>>> \"xxx\",\"notification\": {\"title\": \"Notification Title\",\"body\":
>>>>>> \"Notification Body\"}}}';
>>>>>>
>>>>>>     # Send REST POST request
>>>>>>     if (launch(rest_post($var(fcm_url), "$var(json_payload)",
>>>>>> $avp(response_body), $avp(response_code)))) {
>>>>>>         xlog("L_INFO", "Push notification sent successfully. Response
>>>>>> code: $avp(response_code)\n");
>>>>>>     } else {
>>>>>>         xlog("L_ERR", "Failed to send push notification. Response
>>>>>> code: $avp(response_code)\n");
>>>>>>     }
>>>>>> }
>>>>>>
>>>>>> But I get the following error while running Opensips:
>>>>>> ERROR:rest_client:rest_append_hf_method: header field buffer too small
>>>>>> Jan 30 12:29:09 ngdcs opensips[102753]: ERROR:core:get_cmd_fixups:
>>>>>> Variable in param [3] is not a string
>>>>>> Jan 30 12:29:09 ngdcs opensips[102753]: ERROR:core:do_action: Failed
>>>>>> to get fixups for launch command <rest_post>
>>>>>>
>>>>>> Can you pls help to resolve the issue?
>>>>>>
>>>>>> --
>>>>>> Regards,
>>>>>> B.Prathibha
>>>>>>
>>>>>> _______________________________________________
>>>>>> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Regards,
>>>>>> B.Prathibha
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Regards,
>>>>>> B.Prathibha
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Regards,
>>>>>> B.Prathibha
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Regards,
>>>>> B.Prathibha
>>>>>
>>>>
>>>>
>>>> --
>>>> Regards,
>>>> B.Prathibha
>>>>
>>>>
>>>>
>>>
>>> --
>>> Regards,
>>> B.Prathibha
>>>
>>
>>
>> --
>> Regards,
>> B.Prathibha
>>
>
>
> --
> Regards,
> B.Prathibha
>


-- 
Regards,
B.Prathibha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20250206/aafe35e2/attachment-0001.html>


More information about the Users mailing list