### List and Get Phone Numbers Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Classes/DefaultSudoTelephonyClient.html Methods for listing all provisioned phone numbers for a sudo ID and retrieving details of a specific phone number. ```APIDOC ## listPhoneNumbers(sudoId:limit:nextToken:completion:) ### Description Lists all phone numbers provisioned for a given sudo ID, with optional limit and pagination support. ### Method public func listPhoneNumbers(sudoId: String?, limit: Int?, nextToken: String?, completion: @escaping TelephonyClientCompletion>) ### Parameters #### Path Parameters - **sudoId** (String?) - Optional - The identifier for the sudo user. If nil, lists all numbers accessible by the client. - **limit** (Int?) - Optional - The maximum number of results to return per page. - **nextToken** (String?) - Optional - Token for retrieving the next page of results. #### Request Body None ``` ```APIDOC ## getPhoneNumber(id:completion:) ### Description Retrieves the details of a specific phone number by its ID. ### Method public func getPhoneNumber(id: String, completion: @escaping TelephonyClientCompletion) ### Parameters #### Path Parameters - **id** (String) - Required - The unique identifier of the phone number. #### Request Body None ``` -------------------------------- ### List and Get Phone Numbers Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/docsets/SudoTelephony.docset/Contents/Resources/Documents/Classes/DefaultSudoTelephonyClient.html Methods for listing all provisioned phone numbers for a user and retrieving details of a specific phone number. ```APIDOC ## listPhoneNumbers(sudoId:limit:nextToken:completion:) ### Description Lists all phone numbers provisioned for a given user, with optional pagination. ### Method `listPhoneNumbers` ### Parameters - **sudoId** (String?) - Optional - The identifier for the user. If nil, lists numbers for the current user. - **limit** (Int?) - Optional - The maximum number of results to return per page. - **nextToken** (String?) - Optional - Token for fetching the next page of results. - **completion** (@escaping TelephonyClientCompletion>) - Callback for the list of phone numbers. ### Response - **Result** (TelephonyClientCompletion>) - Contains a token with a list of PhoneNumber objects or an error. ``` ```APIDOC ## getPhoneNumber(id:completion:) ### Description Retrieves the details of a specific provisioned phone number by its ID. ### Method `getPhoneNumber` ### Parameters - **id** (String) - Required - The unique identifier of the phone number. - **completion** (@escaping TelephonyClientCompletion) - Callback for the phone number details. ### Response - **Result** (TelephonyClientCompletion) - Contains the PhoneNumber object or nil if not found, or an error. ``` -------------------------------- ### getSupportedCountries(completion:) Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Protocols/SudoTelephonyClient.html Get supported countries for searching available phone numbers. The supported countries are returned in ISO 3166-1 alpha-2 format. For example: US, ND, etc. ```APIDOC ## getSupportedCountries(completion:) ### Description Get supported countries for searching available phone numbers. The supported countries are returned in ISO 3166-1 alpha-2 format. For example: US, ND, etc. ### Declaration ```swift func getSupportedCountries(completion: @escaping TelephonyClientCompletion<[String]>) ``` ### Parameters #### Completion Callback - `completion` (TelephonyClientCompletion<[String]>): Completion callback that returns supported countries. ``` -------------------------------- ### Get Message Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Classes/DefaultSudoTelephonyClient.html Retrieves a specific message by its ID. ```APIDOC ## getMessage(id:completion:) ### Description Retrieves a specific message using its unique identifier. ### Method Signature ```swift public func getMessage(id: String, completion: @escaping TelephonyClientCompletion) ``` ### Parameters - **id** (String) - The unique identifier of the message to retrieve. - **completion** (@escaping TelephonyClientCompletion) - A closure that handles the result of the operation, returning either a PhoneMessage or a SudoTelephonyClientError. ``` -------------------------------- ### Get List of Call Records Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Protocols/SudoTelephonyClient.html Fetch a paginated list of call records associated with a specific local phone number. You can control the number of records returned using the `limit` parameter and navigate through results using `nextToken`. The result is provided asynchronously. ```swift func getCallRecords(localNumber: PhoneNumber, limit: Int?, nextToken: String?, completion: @escaping (Swift.Result, SudoTelephonyClientError>) -> Void) throws ``` -------------------------------- ### Get Supported Countries for Phone Number Search Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Protocols/SudoTelephonyClient.html Retrieves a list of supported countries for searching available phone numbers. Countries are returned in ISO 3166-1 alpha-2 format. ```swift func getSupportedCountries(completion: @escaping TelephonyClientCompletion<[String]>) ``` -------------------------------- ### Get Conversation Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Classes/DefaultSudoTelephonyClient.html Retrieves a specific conversation by its ID or by phone numbers. ```APIDOC ## getConversation(conversationId:completion:) ### Description Retrieves a specific conversation using its unique identifier. ### Method Signature ```swift public func getConversation(conversationId: String, completion: @escaping TelephonyClientCompletion) ``` ### Parameters - **conversationId** (String) - The unique identifier of the conversation. - **completion** (@escaping TelephonyClientCompletion) - A closure that handles the result, returning a PhoneMessageConversation object or a SudoTelephonyClientError. ``` ```APIDOC ## getConversation(localNumber:remoteNumber:completion:) ### Description Retrieves a conversation between two specified phone numbers. ### Method Signature ```swift public func getConversation(localNumber: PhoneNumber, remoteNumber: String, completion: @escaping TelephonyClientCompletion) ``` ### Parameters - **localNumber** (PhoneNumber) - The local phone number. - **remoteNumber** (String) - The remote phone number. - **completion** (@escaping TelephonyClientCompletion) - A closure that handles the result, returning a PhoneMessageConversation object or a SudoTelephonyClientError. ``` -------------------------------- ### Get Messages Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Classes/DefaultSudoTelephonyClient.html Retrieves a list of messages, with options to filter by phone numbers, limit results, and paginate. ```APIDOC ## getMessages(localNumber:remoteNumber:limit:nextToken:completion:) ### Description Retrieves a list of messages associated with a specific conversation between two phone numbers. Supports filtering by limit and pagination using nextToken. ### Method Signature ```swift public func getMessages(localNumber: PhoneNumber, remoteNumber: String, limit: Int?, nextToken: String?, completion: @escaping TelephonyClientCompletion>) ``` ### Parameters - **localNumber** (PhoneNumber) - The local phone number involved in the conversation. - **remoteNumber** (String) - The remote phone number involved in the conversation. - **limit** (Int?) - The maximum number of messages to retrieve. Optional. - **nextToken** (String?) - A token for paginating through results. Optional. - **completion** (@escaping TelephonyClientCompletion>) - A closure that handles the result, returning a TelephonyListToken containing PhoneMessage objects or a SudoTelephonyClientError. ``` ```APIDOC ## getMessages(conversationId:limit:nextToken:completion:) ### Description Retrieves a list of messages for a given conversation ID. Supports filtering by limit and pagination using nextToken. ### Method Signature ```swift public func getMessages(conversationId: String, limit: Int?, nextToken: String?, completion: @escaping TelephonyClientCompletion>) ``` ### Parameters - **conversationId** (String) - The unique identifier of the conversation. - **limit** (Int?) - The maximum number of messages to retrieve. Optional. - **nextToken** (String?) - A token for paginating through results. Optional. - **completion** (@escaping TelephonyClientCompletion>) - A closure that handles the result, returning a TelephonyListToken containing PhoneMessage objects or a SudoTelephonyClientError. ``` -------------------------------- ### init(keyNamespace:userClient:profilesClient:callProviderConfiguration:) Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Classes/DefaultSudoTelephonyClient.html Initializes an instance of DefaultSudoTelephonyClient using configuration parameters from sudoplatformconfig.json. ```APIDOC ## init(keyNamespace:userClient:profilesClient:callProviderConfiguration:) ### Description Initialize an instance of `DefaultSudoTelephonyClient`. It uses configuration parameters defined in `sudoplatformconfig.json` file located in the app bundle. ### Parameters - **keyNamespace** (String) - Namespace to use for the keys and passwords. This should be left as the default property. - **userClient** (SudoUserClient) - SudoUserClient instance used for authentication. - **profilesClient** (SudoProfilesClient) - SudoProfilesClient instance used for verifying sudo ownership proof. Throws: ``` -------------------------------- ### CallProviderConfiguration Initializer Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Structs/CallProviderConfiguration.html Instantiates a CallProviderConfiguration with localized name, icon template, ringtone sound, and a flag to include calls in recents. ```APIDOC ## CallProviderConfiguration ### Description A CallProviderConfiguration object controls the native call UI for incoming and outgoing calls, including a localized name for the provider, the ringtone to be played for incoming calls, and the icon to be displayed during calls. ### Initializer ```swift public init(localizedName: String, iconTemplate: UIImage?, ringtoneSound: String?, includesCallsInRecents: Bool) ``` #### Parameters * **localizedName** (String) - Required - The localized name of the provider. * **iconTemplate** (UIImage?) - Optional - The icon image to be displayed for the provider. The icon image should be a square with side length of 40 points. The alpha channel of the image is used to create a white image mask, which is used in the system native in-call UI for the button which takes the user from this system UI to the 3rd-party app. * **ringtoneSound** (String?) - Optional - The name of the sound resource in the app bundle to be used for the provider ringtone. * **includesCallsInRecents** (Bool) - Required - Whether or not calls from this provider should be included in the iOS Recents list. ``` -------------------------------- ### MediaObject Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Structs.html A remote media object ```APIDOC ## Structure: MediaObject ### Description A remote media object ### Declaration Swift ```swift public struct MediaObject ``` ``` -------------------------------- ### searchAvailablePhoneNumbers Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/docsets/SudoTelephony.docset/Contents/Resources/Documents/Protocols/SudoTelephonyClient.html Get available phone numbers for the specified coordinates. ```APIDOC ## searchAvailablePhoneNumbers(countryCode:latitude:longitude:limit:completion:) ### Description Get available phone numbers for the specified coordinates. ### Method func searchAvailablePhoneNumbers(countryCode: String, latitude: Double, longitude: Double, limit: UInt?, completion: @escaping SudoTelephonySearchResult) ### Parameters #### Path Parameters - **countryCode** (String) - Required - Supported country code to search on. Code must be formatted on the ISO 3166-1 alpha-2 format. For example: US, BR, ND, etc. - **latitude** (Double) - Required - Double value of the latitude of the coordinate to search on. - **longitude** (Double) - Required - Double value of the longitude of the coordinate to search on. - **limit** (UInt?) - Optional - Optional limit on the number of available phone numbers returned in the search result. If the limit is not specified, the default value is 10 and the search result will provide no more than 10 phone numbers. - **completion** (@escaping SudoTelephonySearchResult) - Required - Completion callback providing a search result containing available phone numbers with the given country code and coordinates. ``` -------------------------------- ### registerForIncomingCalls Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/docsets/SudoTelephony.docset/Contents/Resources/Documents/Protocols/SudoTelephonyClient.html Registers the device for receiving incoming calls using a provided push token. It's essential to use the correct token (sandbox or production) based on the build environment. ```APIDOC ## registerForIncomingCalls ### Description Registers for incoming calls. ### Method `func registerForIncomingCalls(with token: Data, useSandbox: Bool, completion: ((SudoTelephonyClientError?) -> Void)?) throws` ### Parameters - `token` (Data) - The push token data from PushKit. - `useSandbox` (Bool) - Use the sandbox or production APNS. Developer builds typically use the sandbox. - `completion` ((SudoTelephonyClientError?) -> Void)? - Called when the push token has been successfully provided to the service. Returns an error on failure. ### Throws A `CallConfigurationError` if a CallProviderConfiguration object is not provided in the initializer. ``` -------------------------------- ### registerForIncomingCalls Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Classes/DefaultSudoTelephonyClient.html Registers the device to receive incoming calls using a provided token and a flag to indicate sandbox usage. A completion handler is called with any potential error. ```APIDOC ## registerForIncomingCalls ### Description Registers for incoming calls. ### Signature ```swift public func registerForIncomingCalls(with token: Data, useSandbox: Bool, completion: ((SudoTelephonyClientError?) -> Void)?) throws ``` ### Parameters - `token` (Data) - The data token for registration. - `useSandbox` (Bool) - A boolean indicating whether to use the sandbox environment. - `completion` ((SudoTelephonyClientError?) -> Void)? - An optional closure to be called upon completion, receiving an error if one occurred. ``` -------------------------------- ### Get Conversations Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Classes/DefaultSudoTelephonyClient.html Retrieves a list of conversations for a given local number, with options for limiting results and pagination. ```APIDOC ## getConversations(localNumber:limit:nextToken:completion:) ### Description Retrieves a list of conversations associated with a specific local phone number. Supports filtering by limit and pagination using nextToken. ### Method Signature ```swift public func getConversations(localNumber: PhoneNumber, limit: Int?, nextToken: String?, completion: @escaping TelephonyClientCompletion>) ``` ### Parameters - **localNumber** (PhoneNumber) - The local phone number to retrieve conversations for. - **limit** (Int?) - The maximum number of conversations to retrieve. Optional. - **nextToken** (String?) - A token for paginating through results. Optional. - **completion** (@escaping TelephonyClientCompletion>) - A closure that handles the result, returning a TelephonyListToken containing PhoneMessageConversation objects or a SudoTelephonyClientError. ``` -------------------------------- ### CallProviderConfiguration Initializer Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/docsets/SudoTelephony.docset/Contents/Resources/Documents/Structs/CallProviderConfiguration.html Instantiates a CallProviderConfiguration with specified details for native call UI customization. ```APIDOC ## init(localizedName:iconTemplate:ringtoneSound:includesCallsInRecents:) ### Description Instantiates a CallProviderConfiguration. ### Parameters - **localizedName** (String) - Required - The localized name of the provider. - **iconTemplate** (UIImage?) - Optional - The icon image to be displayed for the provider. The icon image should be a square with side length of 40 points. The alpha channel of the image is used to create a white image mask, which is used in the system native in-call UI for the button which takes the user from this system UI to the 3rd-party app. - **ringtoneSound** (String?) - Optional - The name of the sound resource in the app bundle to be used for the provider ringtone. - **includesCallsInRecents** (Bool) - Required - Whether or not calls from this provider should be included in the iOS Recents list. ### Declaration ```swift public init(localizedName: String, iconTemplate: UIImage?, ringtoneSound: String?, includesCallsInRecents: Bool) ``` ``` -------------------------------- ### Unsupported Media Content Type Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Enums/SudoTelephonyClientError.html Indicates that the provided media content type is not supported. This error is relevant for media processing and handling. ```swift case unsupportedMediaContentType ``` -------------------------------- ### Get Voicemail Failed Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Enums/SudoTelephonyClientError.html Indicates that the retrieval of voicemail data has failed. This error case does not carry additional information. ```swift case getVoicemailFailed ``` -------------------------------- ### searchAvailablePhoneNumbers(countryCode:limit:completion:) Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Protocols/SudoTelephonyClient.html Get available phone numbers for the specified country code. The default limit is 10 if not specified. ```APIDOC ## searchAvailablePhoneNumbers(countryCode:limit:completion:) ### Description Get available phone numbers for the specified country code. The default limit is 10 if not specified. ### Declaration ```swift func searchAvailablePhoneNumbers(countryCode: String, limit: UInt?, completion: @escaping SudoTelephonySearchResult) ``` ### Parameters #### Path Parameters - `countryCode` (String): Supported country code to search on. Code must be formatted in ISO 3166-1 alpha-2 format. For example: US, BR, ND, etc. - `limit` (UInt?): Optional limit on the number of available phone numbers returned in the search result. If the limit is not specified, the default value is 10 and the search result will provide no more than 10 phone numbers. #### Completion Callback - `completion` (SudoTelephonySearchResult): Completion callback providing a search result containing available phone numbers with the given country code. ``` -------------------------------- ### Subscribe to Messages Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Classes/DefaultSudoTelephonyClient.html Establishes a subscription to receive real-time message updates. ```APIDOC ## subscribeToMessages(statusObserver:resultHandler:) ### Description Subscribes to receive real-time updates for messages. Allows for an optional status observer and requires a result handler for incoming messages. ### Method Signature ```swift public func subscribeToMessages(statusObserver: SubscriptionHandler?, resultHandler: @escaping SubscriptionHandler) throws -> SubscriptionToken? ``` ### Parameters - **statusObserver** (SubscriptionHandler?) - An optional handler to observe subscription status changes. - **resultHandler** (@escaping SubscriptionHandler) - A required handler that processes incoming PhoneMessage objects. ### Returns - **SubscriptionToken?** - An optional token that can be used to unsubscribe from the message stream. ``` -------------------------------- ### No Public Key Error Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Enums/SudoTelephonyClientError.html Indicates that the user does not have any public keys associated with their account. This is a prerequisite error. ```swift case noPublicKey ``` -------------------------------- ### searchAvailablePhoneNumbers(countryCode:limit:completion:) Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/docsets/SudoTelephony.docset/Contents/Resources/Documents/Protocols/SudoTelephonyClient.html Get available phone numbers for the specified country code. Optionally limit the number of results returned. ```APIDOC ## searchAvailablePhoneNumbers(countryCode:limit:completion:) ### Description Get available phone numbers for the specified country code. ### Declaration ```swift func searchAvailablePhoneNumbers(countryCode: String, limit: UInt?, completion: @escaping SudoTelephonySearchResult) ``` ### Parameters #### Path Parameters - `countryCode` (String) - Required - Supported country code to search on. Code must be formatted in ISO 3166-1 alpha-2 format. For example: US, BR, ND, etc. - `limit` (UInt?) - Optional - Optional limit on the number of available phone numbers returned in the search result. If the limit is not specified, the default value is 10 and the search result will provide no more than 10 phone numbers. #### Completion Callback - `completion` (SudoTelephonySearchResult) - Completion callback providing a search result containing available phone numbers with the given country code. ``` -------------------------------- ### registerForIncomingCalls Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/docsets/SudoTelephony.docset/Contents/Resources/Documents/Classes/DefaultSudoTelephonyClient.html Registers the device to receive incoming calls using a provided token and a flag to indicate sandbox usage. ```APIDOC ## registerForIncomingCalls ### Description Registers the device for incoming calls. ### Method Signature `public func registerForIncomingCalls(with token: Data, useSandbox: Bool, completion: ((SudoTelephonyClientError?) -> Void)?) throws` ### Parameters - `token` (Data) - The data token required for registration. - `useSandbox` (Bool) - A boolean indicating whether to use the sandbox environment. - `completion` ((SudoTelephonyClientError?) -> Void)? - An optional completion handler to be called upon completion. ``` -------------------------------- ### Register for Incoming Calls Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Protocols/SudoTelephonyClient.html Register your application to receive incoming calls using a PushKit VoIP token. Ensure the correct APNS environment (sandbox or production) is specified. This method may throw a CallConfigurationError if the CallProviderConfiguration is not set. ```swift func registerForIncomingCalls(with token: Data, useSandbox: Bool, completion: ((SudoTelephonyClientError?) -> Void)?) throws ``` -------------------------------- ### searchAvailablePhoneNumbers(countryCode:prefix:limit:completion:) Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Protocols/SudoTelephonyClient.html Get available phone numbers for the specified country code and prefix. The default limit is 10 if not specified. ```APIDOC ## searchAvailablePhoneNumbers(countryCode:prefix:limit:completion:) ### Description Get available phone numbers for the specified country code and prefix. The default limit is 10 if not specified. ### Declaration ```swift func searchAvailablePhoneNumbers(countryCode: String, prefix: String, limit: UInt?, completion: @escaping SudoTelephonySearchResult) ``` ### Parameters #### Path Parameters - `countryCode` (String): Supported country code to search on. Code must be formatted on the ISO 3166-1 alpha-2 format. For example: US, BR, ND, etc. - `prefix` (String): The prefix to search for available phone numbers. - `limit` (UInt?): Optional limit on the number of available phone numbers returned in the search result. If the limit is not specified, the default value is 10 and the search result will provide no more than 10 phone numbers. #### Completion Callback - `completion` (SudoTelephonySearchResult): Completion callback providing a search result containing available phone numbers with the given country code and prefix. ``` -------------------------------- ### Get Specific Call Record Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Protocols/SudoTelephonyClient.html Retrieve a single call record by its unique identifier. The result is delivered asynchronously via a completion handler, which provides either the CallRecord or a SudoTelephonyClientError. ```swift func getCallRecord(callRecordId: String, completion: @escaping (Swift.Result) -> Void) throws ``` -------------------------------- ### reset() Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Classes/DefaultSudoTelephonyClient.html Resets the client, potentially clearing internal states or caches. ```APIDOC ## reset() ### Description Resets the client. ### Declaration ```swift public func reset() throws ``` ``` -------------------------------- ### CallKitDisplayName Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Structs.html Provides instructions on what CallKit should display for an incoming/active call. ```APIDOC ## Structure: CallKitDisplayName ### Description Provides instructions on what CallKit should display for an incoming/active call. ### Declaration Swift ```swift public struct CallKitDisplayName ``` ``` -------------------------------- ### SubscriptionStatus Connecting Case Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Enums/SubscriptionStatus.html Represents the state where the subscription is in the process of establishing a connection. ```swift case connecting ``` -------------------------------- ### CallProviderConfiguration Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Structs.html A CallProviderConfiguration object controls the native call UI for incoming and outgoing calls, including a localized name for the provider, the ringtone to be played for incoming calls, and the icon to be displayed during calls. ```APIDOC ## Structure: CallProviderConfiguration ### Description A CallProviderConfiguration object controls the native call UI for incoming and outgoing calls, including a localized name for the provider, the ringtone to be played for incoming calls, and the icon to be displayed during calls. ### Declaration Swift ```swift public struct CallProviderConfiguration ``` ``` -------------------------------- ### Media Operations Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/docsets/SudoTelephony.docset/Contents/Resources/Documents/Classes/DefaultSudoTelephonyClient.html Methods for downloading media associated with telephony objects. ```APIDOC ## downloadData ### Description Downloads the data for a given media object. ### Method `downloadData(for:completion:)` ### Parameters - **media** (MediaObject) - Required - The media object to download. - **completion** (@escaping TelephonyClientCompletion) - Required - A callback to handle the downloaded data. ``` -------------------------------- ### createVoiceCall Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Protocols/SudoTelephonyClient.html Initiates a voice call from a provisioned number to a specified remote number. ```APIDOC ## createVoiceCall(localNumber:remoteNumber:delegate:) ### Description Creates a call from a provisioned phone number to another number. ### Parameters - `localNumber` (PhoneNumber) - Required - The E164 formatted phone number of the initiating sudo. - `remoteNumber` (String) - Required - The E164 formatted phone number to call. - `delegate` (ActiveCallDelegate?) - Required - A delegate to handle call events. ``` -------------------------------- ### createVoiceCall Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Classes/DefaultSudoTelephonyClient.html Initiates a new voice call with the specified local and remote phone numbers. A delegate is required to handle call events. ```APIDOC ## createVoiceCall ### Description Initiates a new voice call. ### Signature ```swift public func createVoiceCall(localNumber: PhoneNumber, remoteNumber: String, delegate: ActiveCallDelegate) throws ``` ### Parameters - `localNumber` (PhoneNumber) - The phone number to use for the outgoing call. - `remoteNumber` (String) - The phone number to call. - `delegate` (ActiveCallDelegate) - An object conforming to ActiveCallDelegate to handle call state changes. ``` -------------------------------- ### CallKitDisplayName Initialization Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Structs/CallKitDisplayName.html Creates a display name used by Callkit for display of an incoming/active call. ```APIDOC ## CallKitDisplayName ### Description Provides instructions on what CallKit should display for an incoming/active call. ### Initializer #### `init(value: String, ignoreSystemContacts: Bool = false)` Creates a display name used by Callkit for display of an incoming/active call. #### Parameters - **value** (String) - The display value, e.g. Jon Smith - **ignoreSystemContacts** (Bool) - If CallKit should ignore system contacts. By default, if iOS can resolve a contact it will ignore the display value we provide. To override this behavior and force CallKit to use the value provided, set this to true. ``` -------------------------------- ### Subscriptions Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/docsets/SudoTelephony.docset/Contents/Resources/Documents/Classes/DefaultSudoTelephonyClient.html Methods for subscribing to real-time updates for messages. ```APIDOC ## subscribeToMessages ### Description Subscribes to receive real-time updates for messages. Allows for an optional status observer and requires a result handler for incoming messages. ### Method `subscribeToMessages(statusObserver:resultHandler:)` ### Parameters - **statusObserver** (SubscriptionHandler?) - Optional - A handler for observing subscription status changes. - **resultHandler** (@escaping SubscriptionHandler) - Required - A handler for receiving new messages. ### Returns - **SubscriptionToken?** - An optional token that can be used to unsubscribe. ``` -------------------------------- ### File Not Found Error Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Enums/SudoTelephonyClientError.html Indicates that a file could not be found at the specified path. This error is relevant for file operations. ```swift case fileNotFound ``` -------------------------------- ### Search Available Phone Numbers by Country Code and Prefix Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Protocols/SudoTelephonyClient.html Fetches available phone numbers for a specified country code and number prefix. An optional limit can be set for the number of results returned. ```swift func searchAvailablePhoneNumbers(countryCode: String, prefix: String, limit: UInt?, completion: @escaping SudoTelephonySearchResult) ``` -------------------------------- ### getSupportedCountries(completion:) Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Classes/DefaultSudoTelephonyClient.html Retrieves a list of countries supported by the telephony service. ```APIDOC ## getSupportedCountries(completion:) ### Description Retrieves a list of countries supported by the telephony service. ### Declaration ```swift public func getSupportedCountries(completion: @escaping TelephonyClientCompletion<[String]>) ``` ``` -------------------------------- ### downloadData Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Protocols/SudoTelephonyClient.html Downloads the raw data for a given media object, typically an MMS attachment. ```APIDOC ## downloadData(for:completion:) ### Description Downloads MMS attachments. ### Parameters - `media` (MediaObject) - Required - The MediaObject that provides the necessary info for retrieving the media data. - `completion` (@escaping TelephonyClientCompletion) - Required - Completion callback providing the raw data of the retrieved media object or an error if it could not be retrieved. ``` -------------------------------- ### reset() Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Protocols/SudoTelephonyClient.html Removes all keys associated with this client, resets any cached data, cleans up subscriptions, and purges any pending operations. It is important to note that this will clear ALL cached data related to all telephony services. ```APIDOC ## reset() ### Description Removes all keys associated with this client, resets any cached data, cleans up subscriptions, and purges any pending operations. It is important to note that this will clear ALL cached data related to all telephony services. ### Declaration ```swift func reset() throws ``` ``` -------------------------------- ### activeVoiceCallAudioRouteDidChange(_:) Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Protocols/ActiveCallDelegate.html Called when the system audio route has changed. ```APIDOC ## activeVoiceCallAudioRouteDidChange(_:) ### Description Called when the system audio route has changed. Use `call.isOnSpeaker` to determine if the call is on speaker. ### Declaration ```swift func activeVoiceCallAudioRouteDidChange(_ call: ActiveVoiceCall) ``` ### Parameters - **call** (ActiveVoiceCall) - The ActiveVoiceCall instance. ``` -------------------------------- ### SudoTelephonyClientError Cases Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Enums/SudoTelephonyClientError.html This enumeration defines the specific errors that can be encountered when using the SudoTelephonyClient. Each case represents a distinct failure scenario, such as not being signed in, invalid configuration, authentication issues, request failures, internal errors, number provisioning problems, unsupported countries, message sending or retrieval failures, and call record retrieval issues. ```APIDOC ## SudoTelephonyClientError Enumeration List of possible errors thrown by `SudoTelephonyClient`. ### Error Cases: * **notSignedIn** * Description: Not signed in to the service. * Declaration: `case notSignedIn` * **invalidConfig** * Description: Bad configuration; something went wrong during setup. * Declaration: `case invalidConfig` * **authenticationFailed(_:)** * Description: Authentication failed, indicating the user is not signed in or registered. * Declaration: `case authenticationFailed(Error)` * **requestFailed** * Description: Request to the backend failed for an unspecified reason. * Declaration: `case requestFailed` * **internalError** * Description: An internal error occurred, potentially due to issues with data retrieval or parsing. * Declaration: `case internalError` * **numberProvisioningFailed** * Description: Failed to provision a phone number. * Declaration: `case numberProvisioningFailed` * **countryNotSupported(_:)** * Description: The country provided for the request is not supported. * Declaration: `case countryNotSupported(String)` * **messageSendFailed** * Description: Failed to send a message. * Declaration: `case messageSendFailed` * **getMessageFailed** * Description: Failed to retrieve a message. * Declaration: `case getMessageFailed` * **messageSubscriptionFailed** * Description: Failed to subscribe to message updates. * Declaration: `case messageSubscriptionFailed` * **getConversationFailed** * Description: Failed to retrieve a conversation. * Declaration: `case getConversationFailed` * **getCallRecordFailed** * Description: Failed to retrieve a call record. * Declaration: `case getCallRecordFailed` ``` -------------------------------- ### DefaultSudoTelephonyClient Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Classes.html Default implementation of SudoTelephonyClient. This class manages the lifecycle of core services and transforms errors to SudoTelephonyClientError. ```APIDOC ## DefaultSudoTelephonyClient ### Description Default implementation of `SudoTelephonyClient`. This class works in general by delegating work in layers starting with a use case. Use cases are fetched from the factory, which is mocked for easy testing. This class manages the lifecycle of core services that do things for the use cases, e.g. a KeyManager for providing keys and decryption services, a DoFoo object that does foo things and so forth. For better or for worse error’s are transformed here to SudoTelephonyClientError. for the completion handlers. ### Declaration Swift ```swift public final class DefaultSudoTelephonyClient : SudoTelephonyClient ``` ``` -------------------------------- ### SudoTelephonyClientError Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Enums.html Represents possible errors thrown by the SudoTelephonyClient. ```APIDOC ## SudoTelephonyClientError ### Description List of possible errors thrown by `SudoTelephonyClient`. ### Declaration Swift ```swift public enum SudoTelephonyClientError : Error, LocalizedError ``` ``` -------------------------------- ### Create CallKit Display Name Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Structs/CallKitDisplayName.html Use this initializer to create a display name for CallKit. You can specify a custom display value and optionally force CallKit to use this value even if it can resolve a system contact. ```swift public init(value: String, ignoreSystemContacts: Bool = false) ``` -------------------------------- ### SudoTelephonyClientError Cases Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Enums/SudoTelephonyClientError.html This section details the different error cases that can be returned by the Sudo Telephony client. ```APIDOC ## SudoTelephonyClientError Cases This enum represents the various errors that can occur within the Sudo Telephony client. ### Cases * **`callRecordDecryptionFailed`** * Description: CallRecord decryption failed. * Declaration: `case callRecordDecryptionFailed` * **`callRecordSubscriptionFailed`** * Description: CallRecord subscription failed. * Declaration: `case callRecordSubscriptionFailed` * **`getVoicemailFailed`** * Description: Voicemail retrieval failed. * Declaration: `case getVoicemailFailed` * **`voicemailDecryptionFailed(_:)`** * Description: Voicemail decryption failed. * Parameters: * `error` (Error) - The underlying error that occurred during decryption. * Declaration: `case voicemailDecryptionFailed(Error)` * **`voicemailSubscriptionFailed(_:)`** * Description: Voicemail subscription failed. * Parameters: * `error` (Error?) - An optional underlying error that occurred during subscription. * Declaration: `case voicemailSubscriptionFailed(Error?)` * **`invalidInput`** * Description: One or more invalid inputs were passed on the request. * Declaration: `case invalidInput` * **`keyGenerationFailed`** * Description: Key Pair failed to be generated for new phone number. * Declaration: `case keyGenerationFailed` * **`keyDeletionFailed`** * Description: Key Pair failed to be deleted for phone number. * Declaration: `case keyDeletionFailed` * **`ownershipProofFailed`** * Description: Failed to get ownership proof when provisioning a number. * Declaration: `case ownershipProofFailed` * **`noPublicKey`** * Description: User has no public keys. * Declaration: `case noPublicKey` * **`sealedDataDecryptionFailed`** * Description: Sealed data decryption failed. * Declaration: `case sealedDataDecryptionFailed` * **`fileNotFound`** * Description: File not found at provided path. * Declaration: `case fileNotFound` * **`invalidFileFormat`** * Description: Invalid file format. * Declaration: `case invalidFileFormat` * **`fileUploadFailed`** * Description: MMS file upload failed. * Declaration: `case fileUploadFailed` * **`fileDownloadFailed`** * Description: File download failed. * Declaration: `case fileDownloadFailed` * **`messageDecryptionFailed`** * Description: Message decryption failed. * Declaration: `case messageDecryptionFailed` * **`messageMediaTooLarge`** * Description: Collective size of message media exceeds limit. * Declaration: `case messageMediaTooLarge` * **`insufficientEntitlement`** * Description: Insufficient entitlements to perform the requested action. * Declaration: `case insufficientEntitlement` * **`invalidSearchError`** * Description: Invalid GPS or Area Code prefix provided. * Declaration: `case invalidSearchError` * **`failedOwnershipCheck`** * Description: Ownership attestation resulted in unauthorized. * Declaration: `case failedOwnershipCheck` * **`maximumMediaObject`** * Description: Exceeded the number of media objects allowed. * Declaration: `case maximumMediaObject` * **`unsupportedMediaContentType`** * Description: Unsupported media type. * Declaration: `case unsupportedMediaContentType` ``` -------------------------------- ### Subscribe to Call Record Updates Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Protocols/SudoTelephonyClient.html Subscribe to real-time updates for new or updated call records. A `SubscriptionToken` is returned, which can be used to unsubscribe later. The `resultHandler` will be called with the latest `CallRecord` or an error. ```swift func subscribeToCallRecords(resultHandler: @escaping (Swift.Result) -> Void) throws -> SubscriptionToken ``` -------------------------------- ### Insufficient Entitlement Error Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Enums/SudoTelephonyClientError.html Indicates that the user lacks the necessary entitlements to perform the requested action. This error relates to permissions and access control. ```swift case insufficientEntitlement ``` -------------------------------- ### SubscriptionStatus Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Enums.html Indicates the current status of a SubscriptionWatcher. ```APIDOC ## SubscriptionStatus ### Description The status of a SubscriptionWatcher. ### Declaration Swift ```swift public enum SubscriptionStatus ``` ``` -------------------------------- ### Set Audio Output Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Classes/ActiveVoiceCall.html Sets whether call audio should be routed through the speakers. ```APIDOC ## setAudioOutput(toSpeaker:) ### Description Sets whether call audio should be routed through the speakers. ### Method `func setAudioOutput(toSpeaker: Bool)` ### Parameters #### To Speaker - `toSpeaker` (Bool) - Required - If true, audio should be routed through the speakers. ``` -------------------------------- ### File Download Failed Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Enums/SudoTelephonyClientError.html Indicates that a file download operation has failed. This error is relevant for retrieving files. ```swift case fileDownloadFailed ``` -------------------------------- ### SubscriptionStatus Enum Cases Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/docsets/SudoTelephony.docset/Contents/Resources/Documents/Enums/SubscriptionStatus.html Represents the different states a subscription watcher can be in. Use these cases to check the current status of your subscription. ```swift case connecting ``` ```swift case connected ``` ```swift case disconnected ``` ```swift case error(Error) ``` -------------------------------- ### CallKitDisplayName Initializer Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/docsets/SudoTelephony.docset/Contents/Resources/Documents/Structs/CallKitDisplayName.html Creates a display name used by Callkit for display of an incoming/active call. By default, if iOS can resolve a contact it will ignore the display value we provide. To override this behavior and force CallKit to use the value provided, set `ignoreSystemContacts` to true. ```APIDOC ## `init(value: String, ignoreSystemContacts: Bool = false)` ### Description Creates a display name used by Callkit for display of an incoming/active call. ### Parameters #### Parameters - **value** (String) - The display value, e.g. Jon Smith - **ignoreSystemContacts** (Bool) - Optional. If CallKit should ignore system contacts. By default, if iOS can resolve a contact it will ignore the display value we provide. To override this behavior and force CallKit to use the value provided, set this to true. ``` -------------------------------- ### SubscriptionStatus Connected Case Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Enums/SubscriptionStatus.html Indicates that the subscription has successfully connected and is actively receiving events from the service. ```swift case connected ``` -------------------------------- ### Handle Incoming Push Notification Payload Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Protocols/SudoTelephonyClient.html Process the payload of an incoming VoIP push notification to determine if the Sudo Telephony SDK can handle it. This method requires the notification payload and a delegate to handle incoming call notifications. It can throw a CallConfigurationError if the CallProviderConfiguration is not initialized. ```swift func handleIncomingPushNotificationPayload(_ payload: [AnyHashable : Any], notificationDelegate: IncomingCallNotificationDelegate) throws -> Bool ``` -------------------------------- ### SubscriptionToken Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Protocols.html Represents a change subscription. When this object is released, the subscription is canceled. ```APIDOC ## SubscriptionToken ### Description Represents a change subscription. When this object is released, the subscription is canceled. ### Declaration Swift ```swift public protocol SubscriptionToken : AnyObject ``` ``` -------------------------------- ### listPhoneNumbers Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Protocols/SudoTelephonyClient.html Lists all phone numbers provisioned by the user account. Supports pagination with limit and next token parameters. Returns an empty list if no numbers are provisioned. ```APIDOC ## listPhoneNumbers(sudoId:limit:nextToken:completion:) ### Description List all the phone numbers provisioned by the user account. If the user does not have phone numbers associated with the account, an empty list will be returned. The list can be queried in batches, where the limit and the next batch token can be specified. ### Method func listPhoneNumbers(sudoId: String?, limit: Int?, nextToken: String?, completion: @escaping TelephonyClientCompletion>) ### Parameters #### Path Parameters - **sudoId** (String?) - Optional - The sudo id to fetch for. - **limit** (Int?) - Optional - The limit of the batch to fetch. If none specified, all of them will be returned. - **nextToken** (String?) - Optional - The token to use for pagination. Must pass same parameters as the previous call or unexpected results may be returned. - **completion** (TelephonyClientCompletion>) - Required - Completion callback that provides a list of phone numbers or an error if there was a failure. ``` -------------------------------- ### subscribeToVoicemails Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Classes/DefaultSudoTelephonyClient.html Subscribes to real-time updates for voicemails. A result handler is provided to process incoming voicemail updates. Returns a subscription token. ```APIDOC ## subscribeToVoicemails ### Description Subscribes to receive real-time voicemail updates. ### Signature ```swift public func subscribeToVoicemails(resultHandler: @escaping (Swift.Result) -> Void) throws -> SubscriptionToken ``` ### Parameters - `resultHandler` (@escaping (Swift.Result) -> Void) - A closure that will be called with each new `Voicemail` or an error. ### Returns - `SubscriptionToken` - A token that can be used to unsubscribe from updates. ``` -------------------------------- ### CallingError Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Enums.html Errors related to the calling feature of the Sudo Telephony SDK. ```APIDOC ## CallingError ### Description Errors for the calling feature. ### Declaration Swift ```swift public enum CallingError : Error, LocalizedError ``` ``` -------------------------------- ### SudoTelephonyClient Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Protocols.html Protocol encapsulating a library of functions for managing phone numbers and messages in the Sudo Platform Telephony service. ```APIDOC ## SudoTelephonyClient ### Description Protocol encapsulating a library of functions for managing phone numbers and messages in the Sudo Platform Telephony service. ### Declaration Swift ```swift public protocol SudoTelephonyClient ``` ``` -------------------------------- ### TelephonyListToken Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Structs/TelephonyListToken.html Represents a paginated list of items with a token for the next page. ```APIDOC ## TelephonyListToken ### Description Object containing a page of objects from a list, along with a token referencing the next page. ### Properties * **items** (`[T]`) - Required - Items returned from the token that represent a page in the overall list. * **nextToken** (`String?`) - Optional - A token that can be used to retrieve the next page. ### Declaration Swift ```swift public struct TelephonyListToken ``` ### Properties #### `items` * **Type**: `[T]` * **Description**: Items returned from the token that represent a page in the overall list. * **Declaration**: `public let items: [T]` #### `nextToken` * **Type**: `String?` * **Description**: A token that can be used to retrieve the next page. * **Declaration**: `public let nextToken: String?` ``` -------------------------------- ### AWSAppSyncSubscriptionWatcher Extension Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/docsets/SudoTelephony.docset/Contents/Resources/Documents/Extensions.html The AWSAppSyncSubscriptionWatcher extension conforms to the SubscriptionToken protocol, providing a way to manage subscriptions within the SudoTelephony framework. ```APIDOC ## Extension: AWSAppSyncSubscriptionWatcher ### Description This extension allows `AWSAppSyncSubscriptionWatcher` to conform to the `SubscriptionToken` protocol. ### Declaration ```swift extension AWSAppSyncSubscriptionWatcher: SubscriptionToken ``` ### Conformance - **Protocol**: `SubscriptionToken` ``` -------------------------------- ### SudoTelephonyClientError Cases Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Enums/SudoTelephonyClientError.html Defines the possible errors that can occur when interacting with the SudoTelephonyClient. These include issues with authentication, configuration, requests, and specific operations like number provisioning or message sending. ```swift case notSignedIn ``` ```swift case invalidConfig ``` ```swift case authenticationFailed(Error) ``` ```swift case requestFailed ``` ```swift case internalError ``` ```swift case numberProvisioningFailed ``` ```swift case countryNotSupported(String) ``` ```swift case messageSendFailed ``` ```swift case getMessageFailed ``` ```swift case messageSubscriptionFailed ``` ```swift case getConversationFailed ``` ```swift case getCallRecordFailed ``` -------------------------------- ### Download Data Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Classes/DefaultSudoTelephonyClient.html Downloads data associated with a media object. ```APIDOC ## downloadData(for:completion:) ### Description Downloads the data content for a given media object. ### Method Signature ```swift public func downloadData(for media: MediaObject, completion: @escaping TelephonyClientCompletion) ``` ### Parameters - **media** (MediaObject) - The media object for which to download data. - **completion** (@escaping TelephonyClientCompletion) - A closure that handles the result, returning the downloaded Data or a SudoTelephonyClientError. ``` -------------------------------- ### Ownership Proof Failed Source: https://github.com/sudoplatform/sudo-telephony-ios/blob/master/docs/Enums/SudoTelephonyClientError.html Indicates a failure in obtaining ownership proof when provisioning a phone number. This error is specific to the provisioning process. ```swift case ownershipProofFailed ```