Sinch app-to-phone calling can't hear dial tone sometimes - ios

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.

Related

How to fix outbound Twilio Website to Mobile VOIP Calls not making a ringing sound for the caller?

We have a javascript twilio webpage that calls either a classic phone number or attempts to make a VOIP call to a mobile app using twilio.
When a call is made to a standard phone, the website user can hear a ringing sound as one would expect. However when the call is routed to a VOIP user, then twilio is just silent while the mobile app that is being called is in a ringing state. This freaks out the users who think the website has failed, when really its just waiting for the mobile app user to answer.
While there are many different ways to implement this, what is the simpliest twilio implementation to play a ringing sound while waiting for a voip user to pick up?
Note: everything works normally from the mobile app user's end, to them the phone is ringing, its the caller who is not getting a ringing sound. I want the ringing sound to stop when the mobile user has picked up and I don't want to hold up the call to play the ringing sound.
How do I duplicate the ringing effect of calling a regular phone number when I'm calling a voip user?
Apparently Voip calls do not appear on their own to make a normal ringing sound, unlike classic non-voip calls. So one has to provide their own ringing UI effects or sound.
I used the ringing event on the Twilio.Connection object that is generated from a properly configured Twilio.Device object. The connection object will not normally emit a a ringing event. But if the enableRingingState configuration parameter is set to true when creating the Twilio.Device object, the Twilio.Connection object will emit the event.
I use that event to kick off a ringing recording using an <Audio> element without the controls attribute and with the loop attribute. I made a recording of a regular phone call's ringing sound to play, so that it sounds the same. Then when the call connects, I shut off the ringing sound. Also if hasEarlyMedia is set to true then I also do not play the ringing sound, since maybe whatever that early media is will play. I haven't yet observed that case, however.
I detect ahead of time if I'm going to making a voip call rather than a standard call, so that I don't create a double ringing effect. Regular (non-voip) phone calls provide their own ringing sound.

Issue with TokBox Audio Session with CallKit

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.

Phone Call Recording in 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

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.

How to handle AVPlayer errors while the app is running in the background?

I am using AVPlayer to play an audio stream, and it's possible to keep it playing in the background. I'm wondering how could I handle a situtation where the user loses internet connectivity, so that I could provide some feedback or maybe try to re-establish the playback after some seconds.
EDIT: I know that the question regards AVPlayer, but if you have an answer with MPMoviePlayerController it might be useful as well. Right now, by using MPMoviePlayerController, I'm trying to get the MPMovieFinishReasonPlaybackError case of the MPMoviePlayerPlaybackDidFinishReasonUserInfoKey, by subscribing to the MPMoviePlayerPlaybackDidFinishNotification but if f.e. my audio is playing in the background and I turn airplane mode on, I never get this notification; I only get MPMovieFinishReasonPlaybackEnded, and I don't know how to separate that from the case that the user stops the audio himself.
I tried looking around for the actual source but I remember reading somewhere that if the audio playback stops (for whatever reason) it kills the background thread. The person writing about the issue talked about possible feeding the stream some empty audio content to keep the thread alive. You might be able to send a local notification from a call back error notifying the user that the audio experienced an error and will have to be manually restarted from within the application. Haven't played around with the API enough to know which callback is the best one to use in this case. If I find the link I'm looking for I'll update.
EDIT: Here's Grant Pannell's take on audio streaming and multitasking.

Resources