Skip to content

[Bug] Inbound Call Not declining in Android in Terminated State #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 of 9 tasks
Kushagra-Esmagico opened this issue Jun 5, 2025 · 3 comments
Closed
2 of 9 tasks
Assignees
Labels
bug Something isn't working

Comments

@Kushagra-Esmagico
Copy link

Kushagra-Esmagico commented Jun 5, 2025

Bug Category

  • Credential Login
  • Token Login
  • Local Audio Issue
  • Remote Audio Issue
  • Audio Device Switching
  • Mute / Unmute
  • Hold / Unhold
  • Performance issues
  • Other

SDK Version
^1.2.0

Describe the bug
A clear and concise description of what the bug is.
The call notification data some time consist the call_id key and some times not.
In result of that, call declining is not working when app is in terminated state on Android. When the push Meta has call_id key, it is working fine.when it has not.The dialer side it rings tlll the time out period.

Expected behaviour
It should send the call_id key in every push notification metadata.

To Reproduce
1.Make the app in teminated state
2.Call to the app
3.Decline the call
4. Try it 4-5 times, and it is not ending the call.

  • Emulator: (true/false) : false
  • Device/Browser: CMF Nothing
  • OS Version: Android 15

Logs

With call_id key

{metadata: {"call_id":"bc35a7f5-98d8-49e5-ad00-7213af8c8c30","caller_name":"19174750460","caller_number":"19174750460","dialogParams":{"custom_headers":[{"name":"X-RTC-CALLID","value":"f34fc26e-d405-48ea-9718-c1764da2714b"},{"name":"X-RTC-SESSID","value":"593cec80-97fd-4b80-ab8b-c1408c07c858"},{"name":"X-parentCallControlID","value":"v3:CFXI6D3KP7rz_nLTyDKqxXrSDhrsKJm_z4S-ZoonHuFYv8WUAdYoug"},{"name":"X-receiverNumber","value":"+14582196049"}]},"rtc_ip":"10.239.129.80","rtc_port":14938,"sent_time":"2025-06-05T09:43:17.752844Z","voice_sdk_id":"VSDK1Cu-BUDpa3pLGW5A1SnCFlXsWVZt2nA"}, message: Incoming call!}

Without call_id key

{metadata: {"caller_name":"19174750460","caller_number":"19174750460","dialogParams":{"custom_headers":[{"name":"X-RTC-CALLID","value":"9c7926fa-2503-40d5-9831-4d4696dae948"},{"name":"X-RTC-SESSID","value":"593cec80-97fd-4b80-ab8b-c1408c07c858"},{"name":"X-parentCallControlID","value":"v3:SXPDILfUSpwAdMqJViIUDAJkzF7rQtaeyj6eOQkHcy4-6VMRMpcj8g"},{"name":"X-receiverNumber","value":"+14582196049"}]},"rtc_ip":"10.239.33.81","rtc_port":14938,"sent_time":"2025-06-05T09:40:54.582395Z","voice_sdk_id":"VSDK1Cu8hUTpah4UMWj2OQzOM0iNsTOrYzg"}, message: Incoming call!}

@Oliver-Zimmerman , let me know if any other details required. The logs are from today only.

@Kushagra-Esmagico Kushagra-Esmagico added the bug Something isn't working label Jun 5, 2025
@Kushagra-Esmagico Kushagra-Esmagico changed the title [Bug] Short Bug Description [Bug] Call Not declining in Android in Terminated State Jun 5, 2025
@Kushagra-Esmagico Kushagra-Esmagico changed the title [Bug] Call Not declining in Android in Terminated State [Bug] Inbound Call Not declining in Android in Terminated State Jun 5, 2025
@Oliver-Zimmerman
Copy link
Collaborator

Oliver-Zimmerman commented Jun 5, 2025

Hey @Kushagra-Esmagico

This is something we are aware of and are hoping to patch by EoD.

For now, while you are testing, please get the X-RTC-CALLID from the header.

You can use this helper method. It will see if there is a callID and grab it from there, otherwise it will take it from the header

  /// Helper method to extract call ID from metadata with fallback to X-RTC-CALLID in custom headers
  static String? _extractCallId(Map<String, dynamic> metadataMap,
      PushMetaData metadata, Logger logger, String methodName) {
    String? telnyxCallId = metadata.callId;

    // If callId is missing or empty, check for X-RTC-CALLID in custom headers
    if (telnyxCallId == null || telnyxCallId.isEmpty) {
      try {
        final dialogParams = metadataMap['dialogParams'];
        if (dialogParams != null && dialogParams['custom_headers'] != null) {
          final customHeaders = dialogParams['custom_headers'] as List<dynamic>;
          for (final header in customHeaders) {
            if (header['name'] == 'X-RTC-CALLID') {
              telnyxCallId = header['value'];
              logger.i(
                  'NotificationService.$methodName: Found call ID in X-RTC-CALLID header: $telnyxCallId');
              break;
            }
          }
        }
      } catch (e) {
        logger.w(
            'NotificationService.$methodName: Error parsing custom headers for X-RTC-CALLID: $e');
      }
    }

    return telnyxCallId;
  }

I will tell you when the change is out to fix this issue

@Kushagra-Esmagico
Copy link
Author

@Oliver-Zimmerman Thank you for the reply. Please let me know, once it is fixed.

@Oliver-Zimmerman
Copy link
Collaborator

@Kushagra-Esmagico, this should be resolved now and is rolled out to prod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants