flutter-webrtc / dart-sip-ua

A dart-lang version of the SIP UA stack.
MIT License
331 stars 255 forks source link

Is there any way to reconnect to the existing call? #367

Open eugeen3 opened 1 year ago

eugeen3 commented 1 year ago

I use the FCM to awake my app and init SIP listener when my app is terminated. To show call notification I use flutter_callkit_incoming library. When Accept is pressed on incoming call notification then the app is opened in new isolate. In app i have the screen with hang up button which allows me to end the call with call.hangup({'status_code': 603}). As I mentioned, the app is opened in new isolate, so i don't have access to instance of current Call since the call was handled in separate isolate. Can I somehow reconnect to the call in my app? I guess the sendMessage() may help since it also triggers the callStateChanged() function.

clover-soft commented 1 year ago

Hi! Try wake your application when any VoIP call is being received, see this: https://github.com/hiennguyen92/flutter_callkit_incoming/blob/master/PUSHKIT.md

After receive CallStateEnum.CALL_INITIATION event -> start FlutterCallkitIncoming.showCallkitIncoming(params); in your code add FlutterCallkitIncoming.onEvent.listen((CallEvent event) use: case Event.ACTION_CALL_ACCEPT: and show screen calling your application on Flutter

maybe using FCM for awake your app not good idea? maybe it's better to use another library? for example: https://pub.dev/packages/flutter_background

eduardothiesen commented 1 month ago

@eugeen3 were you able to solve this problem?

Vinayak0-0 commented 1 month ago

@eugeen3, You can try running SIP as a background service, if FCM option doesn't suit your preferences.