We are encountering an issue with PJSIP in our Android application. When the app is in a killed state and receives an FCM event related to a call, we initiate the PJSIP library initialization followed by the SIP registration process. However, we are consistently receiving a 503 response most of the time, even though the server is Up and Running.
The device has internet access during the registration process, and our application uses WebSocket, which connects successfully.
Note: PJSIP Registration working while manually opening the application (Like application is in active state). Only we are facing the issue while FCM event for call while application is in kill and lock/unlock state.
We have attempted various approaches to address this issue:
- Initializing the library from both background and main threads.
- First initializing the library, then starting the SIP registration process after a delay of 1 or 2 seconds.
- Creating Notification for Client to answer/hangup the call and then initializing the PJSIP library on main thread (Looper.getMainLooper()).
Balu Nayak Dharavath is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.