A TCConnection object represents the connection between a TCDevice and Twilio’s services.
A TCConnection is either incoming or outgoing. You do not create a TCConnection directly; an outgoing connection is created by calling the [TCDevice connect:delegate:] method. Incoming connections are created internally by TCDevice and handed to the registered TCDeviceDelegate via [TCDeviceDelegate device:didReceiveIncomingConnection:].
| Selector | Description | Type |
|---|---|---|
| state | Current status of the TCConnection. |
Property |
| incoming | BOOL representing if the TCConnection is an incoming or outgoing connection. |
Property |
| parameters | A dictionary of parameters that define the connection. |
Property |
| delegate | The delegate object which will receive TCConnection events. |
Property |
| muted | Property that defines if the connection’s microphone is muted. |
Property |
| – accept | Accepts an incoming connection request. |
Instance Method |
| – ignore | Ignores an incoming connection request. |
Instance Method |
| – reject | Rejects an incoming connection request. |
Instance Method |
| – disconnect | Disconnect the connection. |
Instance Method |
| – sendDigits: | Send a string of digits over the connection. |
Instance Method |
delegateThe delegate object which will receive TCConnection events.
@property (nonatomic, assign) id<TCConnectionDelegate> delegateThe delegate object which will receive TCConnection events.
TCConnection.hincomingBOOL representing if the TCConnection is an incoming or outgoing connection.
@property (nonatomic, readonly, getter=isIncoming) BOOL incomingBOOL representing if the TCConnection is an incoming or outgoing connection.
If the connection is incoming, the value is YES.
TCConnection.hmutedProperty that defines if the connection’s microphone is muted.
@property (nonatomic, getter=isMuted) BOOL mutedProperty that defines if the connection’s microphone is muted.
Setting the property will only take effect if the connection’s state is TCConnectionStateConnected.
TCConnection.hparametersA dictionary of parameters that define the connection.
@property (nonatomic, readonly) NSDictionary *parametersA dictionary of parameters that define the connection.
Incoming connection parameters are defined by the “Incoming connection parameter capability keys”. Outoing connection parameters are defined by the union of optional application parameters specified in the Capability Token and any additional parameters specified when the [TCDevice connect:delegate:] method is called.
TCConnection.hstateCurrent status of the TCConnection.
@property (nonatomic, readonly) TCConnectionState stateCurrent status of the TCConnection.
TCConnection.hacceptAccepts an incoming connection request.
- (void)acceptNone
Accepts an incoming connection request.
When the TCDeviceDelegate receives a [TCDeviceDelegate device:didReceiveIncomingConnection:] message, calling this method will accept the incoming connection. Calling this method on a TCConnection that is not in the TCConnectionStatePending state will have no effect.
TCConnection.hdisconnectDisconnect the connection.
- (void)disconnectNone
Disconnect the connection.
Calling this method on a TCConnection that is in the TCConnectionStateDisconnected state will have no effect. The TCConnectionDelegate will eventually receive a [TCConnectionDelegate connectionDidDisconnect:] message once the connection is terminated.
TCConnection.hignoreIgnores an incoming connection request.
- (void)ignoreNone
Ignores an incoming connection request.
When the TCDeviceDelegate receives a [TCDeviceDelegate device:didReceiveIncomingConnection:] message, calling ignore will close the incoming connection request and the connection may not be accepted. Calling this method on a TCConnection that is not in the TCConnectionStatePending state will have no effect. The TCConnectionDelegate will eventually receive a [TCConnectionDelegate connectionDidDisconnect:] message once the connection is terminated.
TCConnection.hrejectRejects an incoming connection request.
- (void)rejectNone
Rejects an incoming connection request.
When the TCDeviceDelegate receives a [TCDeviceDelegate device:didReceiveIncomingConnection:] message, calling reject will terminate the request, notifying the caller that the call was rejected. Calling this method on a TCConnection that is not in the TCConnectionStatePending state will have no effect. The TCConnectionDelegate will eventually receive a [TCConnectionDelegate connectionDidDisconnect:] message once the connection is terminated.
TCConnection.hsendDigits:Send a string of digits over the connection.
- (void)sendDigits:(NSString *)digits| Name | Description |
|---|---|
| digits | A string of characters to be played. Valid values are ‘0’ – ‘9’, ‘*’, ‘#’, and ‘w’. Each ‘w’ will cause a 500 ms pause between digits sent. If any invalid character is present, no digits will be sent. |
None
Send a string of digits over the connection.
Calling this method on a TCConnection that is not in the TCConnectionStateConnected state will have no effect.
TCConnection.h