Skip to content

Commit

Permalink
Merge pull request #130 from team-telnyx/IS/Feature/DebugStats
Browse files Browse the repository at this point in the history
Update ReadMe
  • Loading branch information
isaacakakpo1 authored Sep 4, 2024
2 parents 7e69353 + f50c515 commit 7522a78
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion TelnyxRTC.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 10 additions & 0 deletions TelnyxRTC/Telnyx/TxClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
}
}
Expand Down Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions TelnyxRTCTests/TelnyxRTCTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Expand Down

0 comments on commit 7522a78

Please sign in to comment.