I have implemented the opentok in my app, and did all necessary implementation which is required. I have been gone through sample code and did exactly same, by calling destination phone, the call reached perfectly, then issues comes.
Sometimes call connected to both device but most of the times not, receiver phone started the call with time counting but it has not been connected with voice chat in either way.
Some times loud speaker become active automatically in receiver phone and also by tapping it has not been disable.
Does anybody went through this situation and resolved it ? A
Any help will be appreciable.
Thanks.
If you're using callkit for voice calls then follow below solution to make your audio session active.
while making call or answering call :
Deactivate audio session.
initiate your audio session again.
answer/make call.
Related
I'M Trying to implement a feature with an app include a call inside it. I already implemented the call kit with a lot of socket events and everything is works fine but there's an issue in that:
once the app is locked and get new incoming call, and answer the call, the socket is open and event reach to the other side, but joining the conference is not working till I unlock the device!, have any one any idea about this issue or can help ?
I'm trying to make an iOS app that can programmatically make a phone call silently, blocking any kind of outgoing phone call sound. (After the phone call is ready the app would then start recording the audio from the microphone.) Does anyone know if that's possible or have any idea about how that can be done?
Apple is really protective in such core features as calls. So we as a programmers have really narrow API to use. Basically, to make a call you have two options:
Open URL with format like tel://
Init call with instance of CXStartCallAction
Everything happens after is held by the system, so you don't have much of control over it. To be concrete, you have no control over call sounds.
You can have much more control, if you use VoIP or something similar.
Welcome Antonio!
Briefly, no you can not.
Let me explain further...
After the recipient answers the call, the system calls the provider
delegate’s provider(_:perform:) method. In your implementation of that
method, configure an AVAudioSession and call the fulfill() method on
the action object when finished.
You may have some doing to configure audio session but the system would block the microphone and from the API side you will not have access whatsoever.
I am deeply sorry for being so blunt, but what you're intending is simply no possible.
I'm using AVAudioSession in my VOIP app (using also CallKit).
I understand that the session can get interrupted by a number of things, for example by a second incoming call.
Apple states towards the bottom of this page:
https://developer.apple.com/library/content/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/HandlingAudioInterruptions/HandlingAudioInterruptions.html#//apple_ref/doc/uid/TP40007875-CH4-SW5
"Note: There is no guarantee that a begin interruption will have a
corresponding end interruption. Your app needs to be aware of a switch
to a foreground running state or the user pressing a Play button. In
either case, determine whether your app should reactivate its audio
session."
On the mentioned page there is an example for a special case, when the user ignores the incoming call and in that case AVAudioSessionInterruptionTypeEnded is being sent.
But what should I do to know when the interruption has ended in every other case (in which cases I will never receive an AVAudioSessionInterruptionTypeEnded)? (E.g. When the user answers the 2nd call and puts me on hold and later he ends the 2nd call?)
Thanks!
I remember when you use CallKit, no app using audio like music will interrupt your app except for those other voip apps or native calls.
In that case, your call will be ended/held according to your response on the call kit ui (If your call do not support held, you will not be shown a thid button accept&hold)----Then, you can get your callback from CallKit delegate methods.
The Interruption api just works when CallKit is not used and CallKit app have a higher priority on audio session than those not using it.
We've been able to establish a VoIP call using CallKit. However, Hold and Resume operation on this established VoIP call causes one-way speech path issue. I'm able to hear far-end after I hold and resume. Far-end is not able to hear me.
I've already taken Wireshark traces and confirmed that after the resume, there is only one-way audio. Audio is not sent from my device to far-end.
Since Wireshark already showed the problem, I checked WebRTC code for media session errors. I see no errors in startSend or startPlayout (audio unit processing for send and receive)
I re-checked by CallKit integration code to confirm correct sequences
HOLD OPERATION
Press HOLD button on App UI or long-press MUTE button on CallKit UI.
App requests CXSetHeldCallAction transaction to CallKit with onHold as YES.
App receives provider delegate call back performSetHeldCallAction.
App puts the call on hold and then fulfils performSetHeldCallAction.
App receives provider delegate call back didDeactivateAudioSession.
RESUME OPERATION
Press RESUME button on App UI or HELD button on CallKit UI.
App requests CXSetHeldCallAction transaction to CallKit with onHold as NO.
App receives provider delegate call back performSetHeldCallAction.
App configures audio session (AVAudioSessionCategoryPlayAndRecord, AVAudioSessionModeVoiceChat, preferredSampleRate:44100) and then fulfils performSetHeldCallAction but remembers the call to be taken off-hold.
App receives provider delegate call back didActivateAudioSession. Using this App takes the call off-hold (resumes the call). The call is the one that was stored in the above step.
We've already raised an Apple Ticket using bugreport (with no update) and are pursuing raising an Apple Technical Support Incident (Apple TSI).
Hoping for some valuable inputs.
i'm using Sinch iOS SDK to call from app-to-phone.
i'm testing it by dialing to another mobile i have and when I let it ring some of the calls play the dial ringing tone and some don't. I can't reproduce a pattern that causes this.
Any ideas?
Its actually depends on what carrier you are calling, if you log on callProgressing you will notice that the onprogressing wont fire sometimes until much later for the ones that play no ringing (AT&T is one that dont playit).
To give the user some feedback while waiting for progress, you can play a local ringback (you can find that file in our sample apps) until you get callProgress.