cybex-dev / twilio_voice

Flutter Twilio Voice Plugin
https://twilio-voice-web.web.app/
MIT License
39 stars 79 forks source link

When Call From Native Screen Ui App Crashed (Android) #188

Open yazanturk opened 10 months ago

yazanturk commented 10 months ago

Hello, thank you for your efforts. I have a question for you. When I call from within the application, everything happens normally, but when I end the call and call from the native screen UI, the application Crashed

cybex-dev commented 10 months ago

Hi @yazanturk

Thank you very much for your kind words.

With regards to your issue, could you provide some additional context/info and platform information.

yazanturk commented 10 months ago

@cybex-dev

E/TwilioVoiceConnectionService(26627): onCreateOutgoingConnection: request is missing Bundle EXTRA_OUTGOING_PARAMS D/AndroidRuntime(26627): Shutting down VM E/AndroidRuntime(26627): FATAL EXCEPTION: main E/AndroidRuntime(26627): Process: com.mrfixitdoors.erpsystemdoor, PID: 26627 E/AndroidRuntime(26627): java.lang.RuntimeException: java.lang.reflect.InvocationTargetException E/AndroidRuntime(26627): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612) E/AndroidRuntime(26627): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130) E/AndroidRuntime(26627): Caused by: java.lang.reflect.InvocationTargetException E/AndroidRuntime(26627): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(26627): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) E/AndroidRuntime(26627): ... 1 more E/AndroidRuntime(26627): Caused by: java.lang.Exception: onCreateOutgoingConnection: request is missing Bundle EXTRA_OUTGOING_PARAMS E/AndroidRuntime(26627): at com.twilio.twilio_voice.service.TVConnectionService.onCreateOutgoingConnection(TVConnectionService.kt:527) E/AndroidRuntime(26627): at android.telecom.ConnectionService.createConnection(ConnectionService.java:1955) E/AndroidRuntime(26627): at android.telecom.ConnectionService.access$400(ConnectionService.java:95) E/AndroidRuntime(26627): at android.telecom.ConnectionService$2$1.loggedRun(ConnectionService.java:861) E/AndroidRuntime(26627): at android.telecom.Logging.Runnable$1.run(Runnable.java:37) E/AndroidRuntime(26627): at android.telecom.ConnectionService.onAccountsInitialized(ConnectionService.java:3100) E/AndroidRuntime(26627): at android.telecom.ConnectionService.access$4700(ConnectionService.java:95) E/AndroidRuntime(26627): at android.telecom.ConnectionService$5$1.loggedRun(ConnectionService.java:2443) E/AndroidRuntime(26627): at android.telecom.Logging.Runnable$1.run(Runnable.java:37) E/AndroidRuntime(26627): at android.os.Handler.handleCallback(Handler.java:938) E/AndroidRuntime(26627): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime(26627): at android.os.Looper.loop(Looper.java:246) E/AndroidRuntime(26627): at android.app.ActivityThread.main(ActivityThread.java:8653) E/AndroidRuntime(26627): ... 3 more I/Process (26627): Sending signal. PID: 26627 SIG: 9

cybex-dev commented 10 months ago

@yazanturk ah, that's great.

Do you have a set of steps to reproduce this issue. The EXTRA_OUTGOING_PARAMS should definitely be present. Also, which twilio_voice version are you using?

yazanturk commented 10 months ago

@cybex-dev

TwilioVoice.instance.call.place(
    from: 'mr',
    to: 'mr',
    extraOptions: {
        'callSid': cubit.state.callSid,
        'conferenceId': homeCubit.state.userResponseModel?.userModel.userName.toString() ?? '',
    },
);
cybex-dev commented 9 months ago

Hi @yazanturk

EXTRA_OUTGOING_PARAMS is an internal action bundle used by the ConnectionService - I need to investigate why this is missing - will be doing so this weekend.

cybex-dev commented 9 months ago

Could you provide more information on when this is called, is this a user action, is the app in foreground, is this automated. On which device and type of device is this being called, etc.

yazanturk commented 9 months ago

https://github.com/cybex-dev/twilio_voice/assets/96770991/20358548-1c7c-4491-ba13-d1125eb289e7

Android 9

cybex-dev commented 9 months ago

trim.033F2BA0-6170-4A0A-90C0-9E8D1858F503.MOV Android 9

Ah, wonderful - thanks for providing this feedback, I'll address asap.

cybex-dev commented 9 months ago

@yazanturk bug confirmed - I'm considering some solutions.

For context, since ConnectionService is a separated (system) service, I do not have access to the e.g. Twilio access token, etc which is sent via the EXTRA_OUTGOING_PARAMS bundle as this is not sent from me, but the Phone App itself which I have no control over. Storing of information may not guarantee the call being placed either.

For now, consider the "callback" feature on Android (via Recents in Phone App, and on post call screen) in-operational until a good interim solution can be put in place.