Skip to content

Commit

Permalink
Merge pull request #142 from team-telnyx/docs/WEBRTC-2341-markdown
Browse files Browse the repository at this point in the history
[WEBRTC-2341] [DOCS] Markdown docs
  • Loading branch information
gbattistel authored Nov 19, 2024
2 parents 57706ff + c204f37 commit c6d158e
Show file tree
Hide file tree
Showing 29 changed files with 1,473 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/generate_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
with:
add-paths: |
docs/
docs_markdown/
docs-markdown/
token: ${{ secrets.GITHUB_TOKEN }}
committer: TelnyxIntegrations <[email protected]>
base: main
Expand Down
44 changes: 44 additions & 0 deletions docs-markdown/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Reference Documentation

## Protocols

- [TxClientDelegate](protocols/TxClientDelegate.md)

## Structs

- [TxCallInfo](structs/TxCallInfo.md)
- [TxConfig](structs/TxConfig.md)
- [TxPushConfig](structs/TxPushConfig.md)
- [TxPushIPConfig](structs/TxPushIPConfig.md)
- [TxServerConfiguration](structs/TxServerConfiguration.md)

## Classes

- [Call](classes/Call.md)
- [FileLogger](classes/FileLogger.md)
- [StatsMessage](classes/StatsMessage.md)
- [TxClient](classes/TxClient.md)

## Enums

- [CallState](enums/CallState.md)
- [LogLevel](enums/LogLevel.md)
- [PushEnvironment](enums/PushEnvironment.md)
- [TxError](enums/TxError.md)
- [TxError.CallFailureReason](enums/TxError.CallFailureReason.md)
- [TxError.ClientConfigurationFailureReason](enums/TxError.ClientConfigurationFailureReason.md)
- [TxError.ServerErrorReason](enums/TxError.ServerErrorReason.md)
- [TxError.SocketFailureReason](enums/TxError.SocketFailureReason.md)
- [WebRTCEnvironment](enums/WebRTCEnvironment.md)

## Extensions

- [Call](extensions/Call.md)
- [TxClient](extensions/TxClient.md)
- [TxError](extensions/TxError.md)
- [TxError.CallFailureReason](extensions/TxError.CallFailureReason.md)
- [TxError.ClientConfigurationFailureReason](extensions/TxError.ClientConfigurationFailureReason.md)
- [TxError.ServerErrorReason](extensions/TxError.ServerErrorReason.md)
- [TxError.SocketFailureReason](extensions/TxError.SocketFailureReason.md)

This file was generated by [SourceDocs](https://github.com/eneko/SourceDocs) on 2024-11-19 12:53:48 +0000
120 changes: 120 additions & 0 deletions docs-markdown/classes/Call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
**CLASS**

# `Call`

```swift
public class Call
```

A Call is the representation of an audio or video call between two WebRTC Clients, SIP clients or phone numbers.
The call object is created whenever a new call is initiated, either by you or the remote caller.
You can access and act upon calls initiated by a remote caller by registering to TxClientDelegate of the TxClient

## Examples:
### Create a call:

```
// Create a client instance
self.telnyxClient = TxClient()

// Asign the delegate to get SDK events
self.telnyxClient?.delegate = self

// Connect the client (Check TxClient class for more info)
self.telnyxClient?.connect(....)

// Create the call and start calling
self.currentCall = try self.telnyxClient?.newCall(callerName: "Caller name",
callerNumber: "155531234567",
// Destination is required and can be a phone number or SIP URI
destinationNumber: "18004377950",
callId: UUID.init())
```

### Answer an incoming call:
```
//Init your client
func initTelnyxClient() {
//
self.telnyxClient = TxClient()

// Asign the delegate to get SDK events
self.telnyxClient?.delegate = self

// Connect the client (Check TxClient class for more info)
self.telnyxClient?.connect(....)
}

extension ViewController: TxClientDelegate {
//....
func onIncomingCall(call: Call) {
//We are automatically answering any incoming call as an example, but
//maybe you want to store a reference of the call, and answer the call after a button press.
self.myCall = call.answer()
}
}
```

## Properties
### `inviteCustomHeaders`

```swift
public internal(set) var inviteCustomHeaders: [String:String]?
```

Custum headers pased /from webrtc telnyx_rtc.INVITE Messages

### `answerCustomHeaders`

```swift
public internal(set) var answerCustomHeaders: [String:String]?
```

Custum headers pased tfrom telnyx_rtc.ANSWER webrtcMessages

### `sessionId`

```swift
public internal(set) var sessionId: String?
```

The Session ID of the current connection

### `telnyxSessionId`

```swift
public internal(set) var telnyxSessionId: UUID?
```

Telnyx call session ID.

### `telnyxLegId`

```swift
public internal(set) var telnyxLegId: UUID?
```

Telnyx call leg ID

### `callInfo`

```swift
public var callInfo: TxCallInfo?
```

`TxCallInfo` Contains the required information of the current Call.

### `callState`

```swift
public var callState: CallState = .NEW
```

`CallState` The actual state of the Call.

## Methods
### `startDebugStats()`

```swift
public func startDebugStats()
```
21 changes: 21 additions & 0 deletions docs-markdown/classes/FileLogger.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
**CLASS**

# `FileLogger`

```swift
public class FileLogger
```

## Properties
### `shared`

```swift
public static let shared = FileLogger()
```

## Methods
### `log(_:)`

```swift
public func log(_ message: String)
```
7 changes: 7 additions & 0 deletions docs-markdown/classes/StatsMessage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**CLASS**

# `StatsMessage`

```swift
public class StatsMessage
```
Loading

0 comments on commit c6d158e

Please sign in to comment.