Sinch SDK - iOS app does not receive immediate callback when callee reject the call

80 Views Asked by At

I integrated Sinch SDK into iOS application (Capacity plugin which works under ionic).

Main use case so far is to make call from App to phone. I followed instructions from here: https://developers.sinch.com/docs/in-app-calling/getting-started/ios/create-app/ and everything works correctly - I can call from the app to phones using Sinch platform.

The problem which I noticed is when callee rejects the call then app does not receive immediate notification about it. Sometimes notification (func callDidEnd(_ call: SinchRTC.SinchCall)) is triggered after some delay (10-20s). However sometimes when callee rejects the call app is still calling and second connection appears on callee's phone - then when second time callee rejects the call app correctly receive callback about it and close the connection.

Do you have any hints what can be the issue here?

1

There are 1 best solutions below

2
Roland On

We will review the tutorial to see if the issue can be replicated.

However using the VideoCallKitSwift Swift sample you can change the following to the sinch client on start and call invocation to make a PSTN call:

In CallKitMediator

add the cli:<YOURCLI> after userId in the SinchRTC.client (In this case I have put a placeholder +4100000000 in the cli)

From

 do {
      self.client = try SinchRTC.client(withApplicationKey: APPLICATION_KEY,
                                        environmentHost: ENVIRONMENT_HOST,
                                        userId: userId)

To

   do {
      self.client = try SinchRTC.client(withApplicationKey: APPLICATION_KEY,
                                        environmentHost: ENVIRONMENT_HOST,
                                         userId: userId,
                                         cli:"+4100000000")

In CallKitMediator+CXProviderDelegate Here remove the withId: and change the client method to callPhoneNumber instead of videoCallToUser

From

let callResult = self.client!.callClient.videoCallToUser(withId: action.handle.value)

To

let callResult = self.client!.callClient.callPhoneNumber(action.handle.value)

Testing to a PSTN connection via this method yields no delay in the callDidEnd. If your issues persist, I would recommend to open a ticket with Sinch support who can analyse the PSTN leg of the call for you.