diff --git a/README.md b/README.md index b2074395..b5be345f 100644 --- a/README.md +++ b/README.md @@ -724,8 +724,15 @@ telnyxClient.disablePushNotifications() Note : Signing back in, using same credentials will re-enable push notifications. ### Privacy Manifest -Support for privacy manifest is add from version 0.1.26 +Support for privacy manifest is added from version 0.1.26 +### Sending Debug Stats +In case of any need to investigate any issue by Telnyx, please enable the debug stats that will be sent to Telnyx for analysis. + +```Swift +currentCall?.startDebugStats() +``` +Please store the **debug_stats_id** that would be used for investigation ### Documentation: For more information you can: diff --git a/TelnyxRTC.podspec b/TelnyxRTC.podspec index 49a56b30..6ac3cf9d 100644 --- a/TelnyxRTC.podspec +++ b/TelnyxRTC.podspec @@ -2,7 +2,7 @@ Pod::Spec.new do |spec| spec.name = "TelnyxRTC" - spec.version = "0.1.30" + spec.version = "0.1.33" spec.summary = "Enable Telnyx real-time communication services on iOS." spec.description = "The Telnyx iOS WebRTC Client SDK provides all the functionality you need to start making voice calls from an iPhone." spec.homepage = "https://github.com/team-telnyx/telnyx-webrtc-ios" diff --git a/TelnyxRTC/Telnyx/TxClient.swift b/TelnyxRTC/Telnyx/TxClient.swift index 51eaba02..c7400800 100644 --- a/TelnyxRTC/Telnyx/TxClient.swift +++ b/TelnyxRTC/Telnyx/TxClient.swift @@ -148,6 +148,7 @@ public class TxClient { private var pendingAnswerHeaders = [String:String]() private var speakerOn:Bool = false internal var sendFileLogs:Bool = false + private var attachCallId:String? private var pushMetaData:[String:Any]? func isSpeakerEnabled() -> Bool { @@ -577,6 +578,7 @@ extension TxClient { let pushProvider = self.txConfig?.pushNotificationConfig?.pushNotificationProvider let attachMessage = AttachCallMessage(pushNotificationProvider: pushProvider,pushEnvironment:self.txConfig?.pushEnvironment) let message = attachMessage.encode() ?? "" + attachCallId = attachMessage.id self.socket?.sendMessage(message: message) } } @@ -698,6 +700,14 @@ extension TxClient : SocketDelegate { //Check if server is sending an error code if let error = vertoMessage.serverError { + if(attachCallId == vertoMessage.id){ + // Call failed from remote end + if let callId = pushMetaData?["call_id"] as? String { + Logger.log.i(message: "TxClient:: Attach Call ID \(String(describing: callId))") + self.delegate?.onRemoteCallEnded(callId: UUID(uuidString: callId)!) + } + return + } let message : String = error["message"] as? String ?? "Unknown" let code : String = String(error["code"] as? Int ?? 0) let err = TxError.serverError(reason: .signalingServerError(message: message, code: code)) diff --git a/TelnyxRTCTests/TelnyxRTCTests.swift b/TelnyxRTCTests/TelnyxRTCTests.swift index 61524b2e..ea0e33a3 100644 --- a/TelnyxRTCTests/TelnyxRTCTests.swift +++ b/TelnyxRTCTests/TelnyxRTCTests.swift @@ -94,8 +94,8 @@ class TelnyxRTCTests: XCTestCase { override func onClientError(error:Error) { XCTAssertEqual(error.localizedDescription, TxError.serverError(reason: - .signalingServerError(message: "Gateway state not found", - code: "0")).localizedDescription) + .signalingServerError(message: "Login Incorrect", + code: "-32001")).localizedDescription) self.expectation.fulfill() } }