CreateConnection

Metreos.MediaControl.CreateConnection

Summary

Establishes both Rx and Tx RTP streams for a new or reserved connection on a media engine.

Usage

CreateConnection can be used to either create an entirely new connection on the media engine, or establish transmit properties on a connection previously created by ReserveConnection.

To cause the audio stream to send to a multicast IP address, specify a multicast IP address in the MediaTxIP parameter.

Remarks

A connection established with CreateConnection should always be deleted by using DeleteConnection. Media connections are a limited resource, and so must be managed carefully.

CreateConnection is implicitly invoked by AnswerCall or MakeCall, with the transmit and receive properties automatically set correctly based on the media negotiation for the call. A connection created in this manner is also automatically disconnected when the call is hung up or transferred.

For the lifetime of a connection created via ReserveConnection, one RTP resource is used. If a low bitrate codec is used for this connection, then one Enhanced RTP resource is also used in conjuction with the RTP resource for the lifetime of the connection.

Action Parameters
Parameter Name.NET TypeDefaultDescription
MediaRxFramesizeSystem.UInt32The framesize (in milliseconds) to use for the RTP stream inbound to the media engine. If not specified, the media engine configuration file defines the framesize to use, which by default is 20ms.
CallIdSystem.Int64The CallId of the call associated with this connection (hairpin only).
MediaTxIP *System.StringThe IP address that the Tx RTP stream will transmit audio to.
MediaTxPort *System.UInt32The port that the Tx RTP stream will transmit audio to.
MmsIdSystem.UInt32The ID of the media engine to create the connection on. This field is only relevant if CreateConnection is being used to create a new connection; not if being used to fully establish a connection that was previously created by ReserveConnection. If no MmsId is specified when using CreateConnection, a media engine with the most available resources is dynamically selected from the Media Resource Group associated with the partition of the script instance from which CreateConnection is invoked.
ConnectionIdSystem.String0A ConnectionId returned by a previous ReserveConnection action. If no ConnectionId is specified, then an entirely new connection is created.
MediaTxControlIPSystem.StringThe RTCP IP address of the remote endpoint.
MediaTxControlPortSystem.UInt32The RTCP port of the remote endpoint.
MediaRxCodecSystem.StringThe codec to use for the RTP stream inbound to the media engine. Valid values are G711u, G711a, G723, and G729. If not specified, the media engine configuration file defines the codec to use, which by default is G711u.
TimeoutSystem.Int32The Timeout property specifies to the Application Runtime Environment how long to wait for a response from the provider for the current action. The ReturnValue returned in this case is Timeout. The value must be a literal value in milliseconds.
MediaTxCodecSystem.StringThe codec to use for the RTP stream outbound from the media engine. Valid values are G711u, G711a, G723, and G729. If not specified, the media engine configuration file defines the codec to use, which by default is G711u.
MediaTxFramesizeSystem.UInt32The framesize (in milliseconds) to use for the RTP stream outbound from the media engine. If not specified, the media engine configuration file defines the framesize to use, which by default is 20ms.
Result Data
Parameter Name.NET TypeDescription
ConnectionIdSystem.StringUnique identifier used to identify this connection in all subsequent Media Control operations.
MmsIdSystem.UInt32Unique identifier used to identify the media engine in control of this connection. A common use for this ID is to ensure that other connections which will ultimately be conferenced with this connection are all created on the same media engine. This correlation is necessary because all connections in a single conference must all reside on the same media engine.
MediaRxIPSystem.StringThe IP address that the Rx RTP stream must be sent to for this connection.
MediaRxControlIPSystem.StringThe RTCP IP address of the media engine which is in control of this connection.
MediaRxControlPortSystem.UInt32The RTCP port of the connection.
ResultCodeSystem.StringA numeric code indicating the result status of the operation. A '0' indicates success; a positive number indicates an error. Please reference the Media Control Error Codes table for descriptions on specific error codes.
MediaRxPortSystem.UInt32The port that the Rx RTP stream must be sent to for this connection.

Branch Conditions 

Success

No description.

Failure

No description.

Timeout

No description.