twilio / cocoapod-specs

https://www.twilio.com/
10 stars 15 forks source link

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

Open archonitex opened 7 years ago

archonitex commented 7 years ago

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

bobiechen-twilio commented 7 years ago

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 commented 7 years ago

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 commented 6 years ago

Any update on this issue?

bobiechen-twilio commented 6 years ago

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 commented 6 years ago

Any update on the issue please?

bobiechen-twilio commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

Kishorekumar-Elanchezhiyan commented 5 years ago

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