Skip to content
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

Callkit - No Audio when switching between PSTN call and VoiceClient #96

Open
archonitex opened this issue Jul 20, 2017 · 13 comments
Open

Comments

@archonitex
Copy link

archonitex commented Jul 20, 2017

Context

Trying to use VoiceClient with Callkit, running into some issues when receiving a VoiceClient Call while already on a PSTN call and using Hold&Accept on the PSTN call to accept the VoiceClient Call. Accepting the call initially works, but switching back to the PSTN call, and then back again to the VoiceClient Call, there is no more audio being received or sent.

Our Callkit configuration is as follows :

CXProviderConfiguration* config = [[CXProviderConfiguration alloc] initWithLocalizedName:@"AppName"];
config.supportsVideo = NO;
config.supportedHandleTypes = [NSSet setWithArray: @[ @(CXHandleTypeGeneric) ]  ];
config.iconTemplateImageData = UIImagePNGRepresentation([UIImage imageNamed:@"IconMask"]);

Attached is TVOLogLevelDebug Logs for the call.
The log follows the Steps to Reproduce indicated below in this report.
voiceclientlog.txt

Expected Behavior

Switching between active PSTN and VoiceClient calls should shut down / restore the audio session and audio streams.

Actual Behavior

There is no audio when switching between active PSTN and VoiceClient calls.

Steps to Reproduce

  1. Receive & Accept PSTN call on mobile device
  2. Receive VoiceClient call, Hold PSTN call & Accept VoiceClient Call
  3. Talk in VoiceClient call (working as intended)
  4. Switch back to PSTN call
  5. Talk in PSTN call (working as intended)
  6. Switch back to VoiceClient Call
  7. Talk in VoiceClient Call (no audio incoming or outgoing)

Environment

  • Version used: iOS VoiceClient 2.0.0-beta12
  • Device : iPhone 7
  • OS Version : iOS 10.3.2
@bobiechen-twilio
Copy link
Contributor

Hi @senatorsfc

Sorry for my delay of responding back to your issue.
How are things going with the team?

I did try with the steps and was able to reproduce the audio problem.
I've created a ticket to address hold-related audio problem and will get back to you soon as we have a fix.

Sorry for the inconveniences.

-bobie

@archonitex
Copy link
Author

Hey @bchen-twilio , things are good, about to release our new major version of the app!

Thanks for confirming the issue. I'll keep an eye here for an update on the fix!

@archonitex
Copy link
Author

Any update on this issue?

@bobiechen-twilio
Copy link
Contributor

Hi @senatorsfc

We are currently working on finalizing the APIs and the delegate protocols of the SDK.
Sorry for keeping you waiting for this important fix/feature but we'll give an update once this is done.

Thanks for bearing with us.
-bobie

@Kishorekumar-Elanchezhiyan

Any update on the issue please?

@bobiechen-twilio
Copy link
Contributor

Hi @Kishorekumar-Elanchezhiyan

Have you tried the latest version of Voice SDK 2.0? We've added some audio device related improvements since beta12. We've recently released a preview of the Voice 3.0 SDK which has a better audio related support.

Thanks
-bobie

@Kishorekumar-Elanchezhiyan

Hi @bchen-twilio ,

I'm using Twilio Voice 2.0.3, when I do hold and accept to attend the pstn call it works fine, when I comeback to twilio call I dont hear the audio in both ends.. Could you please let me know, what couldve gone wrong

For Better Understanding I am explaining the scenario below
SDK Twilio Voice 2.0.3

Make Twilio Call To USer A
works fine
PSTN call comes from User B
I hold(User A) and Acceptt(User B)
call goes well, but once I swap or cut the call. Twilio audio doesnt resume.

Please help

@bobiechen-twilio
Copy link
Contributor

Hi @Kishorekumar-Elanchezhiyan

During our integration tests we've observed in some scenarios (see the table), CallKit framework won't give you the callback so the application can unhold the Voice call.
One workaround, which we added at the end of the table, you can try is to add a handler method to update the TVOCall hold status when the app is active.

Let me know
-bobie

@Kishorekumar-Elanchezhiyan
Copy link

Kishorekumar-Elanchezhiyan commented Aug 26, 2018

Hi @bchen-twilio ,
I've gone through the table, scenario A in table itself is not working for me. I am actually enabling and disabling audio of sdk in said callbacks, still it is not working for me.

What Could I possibly done wrong?

@bobiechen-twilio
Copy link
Contributor

Hi @Kishorekumar-Elanchezhiyan

Thanks for checking out the table. In your environment, were you able to receive the CallKit and AVAudioSession interruption callbacks?

@Kishorekumar-Elanchezhiyan

Hi @bchen-twilio

  1. I was able to receive Callkit callbacks to activate and deactivate audio, In the callbacks only I am enabling and disabling sdk audio
    2.I didnt observe AVAudioSessionInterruption as I am not doing anything while interruption

@bobiechen-twilio
Copy link
Contributor

Thanks @Kishorekumar-Elanchezhiyan
When you ended the PSTN call from local device, did you you get the provider:performSetHeldCallAction: callback from CallKit?

@Kishorekumar-Elanchezhiyan
Copy link

Kishorekumar-Elanchezhiyan commented Aug 27, 2018

Yes @bchen-twilio provider:performSetHeldCallAction gets called after ending PSTN call, I call our api to unhold twilio call. After that didActivate audioSession gets called. I enable SDK's audio in didActivate audioSession callback by TwilioVoice.isAudioEnabled = true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants