Phone Call Recording in iOS - ios

In phone.app (iOS Native calling app), Is there any mean by which I can perform task like
1.Identify the caller (Incoming and Outgoing), so that on the behalf of caller I can perform some task.
2.Recording of call.
3.If some audio recording already in running state then how a call record can be handled.?
In my finding a reached at below outcome
1. CTCallCenter class have the information about call but i don't get phone number.
2. Call recording is not possible as there is no Apple API to do so.There are some apps on app store but they are not capable to record the call from phone.app. I think they are recording the call by their server (3 Way call.)
3. I think it will lead towards a crash as phone call is a high priority task so that the control of mic and speaker is given to phone call.
Is there any way to get expected result ? Is it possible with call kit.?
Thanks.

Unfortunately, what you're asking for is not possible as far as I know. Your app can be aware of incoming calls and their states, but not access the phone number. Using the CallKit APIs introduced in iOS 10, you can provide a label for an incoming phone number, but even then you have to set up a predefined list of numbers and labels. Your app won't know which number called. See "Identifying Incoming Callers" in the documentation and this SO question.
As for recording calls, there are no ways to do this without introducing a third party to the call, or routing the call to a service you control.
Regards,
Martin

Related

iOS - Is it possible to make a phone call programmatically blocking any kind of outgoing phone call sound?

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.

How do I know that an audio interruption ended without receiving AVAudioSessionInterruptionTypeEnded?

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.

How to intercept and parse incoming calls via an app

How does Truecaller intercept incoming phonecalls on the iphone to display caller ID?
I didn't think this was possible from within the app?
Specifically, if I wanted to build this functionality, what protocols would I go about using?
http://www.truecaller.com/how-it-works
On an iPhone, without jailbreaking it:
- you cannot intercept a call in any way
- you cannot determine the phone number nor the caller ID identifying information regarding the call. Even if you could there
is no way to alter what is displayed on the call screen
- you cannot block the call
- your program can get a notification when a call is being made/terminated etc. But only if your app is executing in the
foreground at the time of the call or if the app is in the
background and has a relevant background mode (even then you can
only know there is a call in some circumstance, depending upon what
you're doing in the background and what state your in etc. Its too complex to describe the exact situation here briefly)
True Caller doesn't do that on iOS as it isn't supported with the native SDK. See their FAQ:
http://www.truecaller.com/support , specifically the "Why don't I receive live caller ID?" Section under "iPhone/Windows Phone". If you must though, try looking into a solution for jailbroken devices.
It's impossible to "intercept" calls. It is possible to handle the "background event call" when a iPhone get's a call. That said, Truecaller doesn't intercept calls. More info can be found on their website.

Intercept incoming call ios sdk (Non Jailbreak)

Hi i have tried for bundle of times and find out that iOS SDK does not give us access due to security reasons for getting following data;
Intercept an incoming call (Getting phone number from incoming call)
Read Call history
Intercept SMS (Getting phone number from incoming SMS and reading its contents)
Block an incoming call
etc
Here are some of the links resulting from my search about this issue:-
How can I get the callers phone number from an incoming call on iphone
http://iosstuff.wordpress.com/2011/08/19/accessing-iphone-call-history/
Programmatically get the number of the incoming call
Can I fetch details of the incoming call phone number in my applicaton?
Hook into incoming call?
handling an incoming call through an app in iphone xcode
Identify number of incoming call in iPhone
I also found that CoreTelephony CTCall object provide us only limited info, Just call state and its unique Id. But nothing else we can get by using CoreTelephony framework.
But, I have seen one application on app store that does gets incoming call phone number.
I wonder how this app
Callinize iPone App
works and gets incoming call info?
I also want the same thing to do with my app. But i did't find such a way to do. Please help if you can.
Thanks!
I'm late to the party here, but I was just reading the description of Callinize. They built an integration with the Asterix pbx system and it only works with Asterix. So this app does not really access iOS phone calls.

Detect a pause during call in iPhone

I have a requirement to detect a pause while speaking over call(It may be VOIP call) and send an pre-recorded reply automatically using Core Audio API. I explored Twilio APIs as well, I want to know feasibility of following things -
Is it possible to detect pause while caller from other side speaks, be it on normal call or VOIP call?
Is it possible to insert a prerecorded audio file during live call in iOS??
After the introduction of CallKit in iOS 10, you can detect whether the user has performed any action with DTMF which is usually the way to answer an IVR call. In case of normal human interaction it should not be possible because every call has this property of supportsDTMF
In a reverse scenario you can add soft and hard pauses while dialing a call programmatically as well using a simple init call.

Resources