[SIP Beyond VoIP] sylkpush-server google fcm failed with error 400
Tijmen de Mes
tijmen at ag-projects.com
Mon Jan 9 14:24:56 CET 2023
Hi,
I can't tell from your logs what is wrong. Clearly firebase receives a wrong JSON request. Which version are you using?
What JSON is transmitted towards firebase? You should see this in the debug log.
Best regards,
Tijmen de Mes
—
AG Projects
> Op 9 jan. 2023, om 13:08 heeft Vasilios Tzanoudakis <vtzanoudakis at gmail.com> het volgende geschreven:
>
> Dear Team,
>
> Happy new year to you all!!!
>
> I have a question regarding sylkpush-server.
> I have manged to run the sylkpush-server successfully
> --------------------------------------------------------------------------------
> root at ip-10-100-0-202:~# /usr/bin/sylk-pushserver --debug
> INFO:root:2023-01-09 10:33:04.029253 Starting Sylk Pushserver...
> INFO:to_file:2023-01-09 10:33:04.615029 Loaded 1 applications from /etc/sylk-pushserver/applications.ini:
> INFO:to_file:2023-01-09 10:33:04.615682 Loaded Firebase Linphone app com.voiceland.voiceland
> DEBUG:to_file:2023-01-09 10:33:04.616451 Linphone app com.voiceland.voiceland classes: FirebaseLinphoneHeaders, FirebaseLinphonePayload
> DEBUG:to_file:2023-01-09 10:33:04.616731 Loaded 1 Push notification services: FirebasePNS
> DEBUG:to_file:2023-01-09 10:33:04.616935 Firebase Push Notification Service - FirebasePNS class
> DEBUG:to_file:2023-01-09 10:33:04.617140 Server is now ready to answer requests
> INFO:to_file:2023-01-09 10:33:04.618109 Sylk Pushserver listening on http://0.0.0.0:8400 <http://0.0.0.0:8400/>
> --------------------------------------------------------------------------------
>
> and I am trying to wake up my device using this opensips script which is take from the opensips.cfg example.
> -------------------------------------------------------------------------------------------
> $var(push_command) = "/usr/bin/sylk-pushclient --url \"http://127.0.0.1:8400/push\ <http://127.0.0.1:8400/push/>" --platform=\"" + $var(pn_platform) +
> "\" --appid=\"" + $var(pn_app) + "\" --from_name=\"" + $(fn{s.escape.common}) + "\" --mediatype=\"" + $var(sip_application_type) +
> "\" --event=\"" + $var(pn_event) + "\" --token=\"" + $var(pn_token) + "\" --deviceid=\"" + $var(sip_instance) +"\" --callid=\"" +
> $ci + "\" --from=\"" + $var(from) + "\" --to=\"" + $var(to) + "\"";
> xlog("L_NOTICE", "Route:ci:$ci:wakeup_mobile_devices [CONFIG] Push notification command: $var(push_command)\n");
> launch(exec("$var(push_command)",,, $var(rc)), "PN_RESULT");
> ---------------------------------------------------------
>
> I am receiving an error from FCM side, could you please help me out because I don't see time_to_live, priority to the sylk-pushclient and also it gives me an error on "to" header also also that cannot find field. In the opensips.cfg example I see pusher.py script which I cannot find anywhere in repo. So could you please clarify what I am doing wrong?
>
> root at ip-10-100-0-202:~# /usr/bin/sylk-pushclient --url "http://127.0.0.1:8400/push <http://127.0.0.1:8400/push>" --platform="firebase" --appid="myappid" --from_name="" --mediatype="audio" --event="incoming_session" --token="cZdVSMtZRZ-qhGDAkX3vCj:token" --deviceid="<urn:uuid:4cf4f194-0215-433b-86e1-8aecc8cde1ce>" --callid="B2B.281.4947472.1673264089" --from="+30210XXXXXXX at domain" --to="+30210XXXXXXX at domain"
>
> error:
> ========================================================================
> incoming_session push for B2B.281.4947472.1673264089 to http://127.0.0.1:8400/push <http://127.0.0.1:8400/push> failed: 400: {"code":400,"description":"push notification response","data":{"body":{"_content":{"error":{"code":400,"message":"Invalid JSON payload received. Unknown name \"to\": Cannot find field.\nInvalid JSON payload received. Unknown name \"time_to_live\": Cannot find field.\nInvalid JSON payload received. Unknown name \"priority\": Cannot find field.\nInvalid JSON payload received. Unknown name \"data\": Cannot find field.","status":"INVALID_ARGUMENT","details":[{"@type":"type.googleapis.com/google.rpc.BadRequest <http://type.googleapis.com/google.rpc.BadRequest>","fieldViolations":[{"description":"Invalid JSON payload received. Unknown name \"to\": Cannot find field."},{"description":"Invalid JSON payload received. Unknown name \"time_to_live\": Cannot find field."},{"description":"Invalid JSON payload received. Unknown name \"priority\": Cannot find field."},{"description":"Invalid JSON payload received. Unknown name \"data\": Cannot find field."}]}]}},"_content_consumed":true,"status_code":400,"url":"https://fcm.googleapis.com/v1/projects/voiceland-dev/messages:send <https://fcm.googleapis.com/v1/projects/voiceland-dev/messages:send>","encoding":"UTF-8","reason":"Bad Request"},"code":400,"reason":"Bad Request","url":"https://fcm.googleapis.com/v1/projects/voiceland-dev/messages:send <https://fcm.googleapis.com/v1/projects/voiceland-dev/messages:send>","call_id":"B2B.281.4947472.1673264089","token":"cZdVSMtZRZ-qhGDAkX3vCj:token"}}
> ========================================================================
> thank you very much in advance for your support.
>
> Kind Regards
>
> --
> Vasilios Tzanoudakis
> _______________________________________________
> SIPBeyondVoIP mailing list
> SIPBeyondVoIP at lists.ag-projects.com
> https://lists.ag-projects.com/mailman/listinfo/sipbeyondvoip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ag-projects.com/pipermail/sipbeyondvoip/attachments/20230109/1a6fce48/attachment-0001.htm>
More information about the SIPBeyondVoIP
mailing list