Channel Options

The behavior of a channel can be controlled by setting the channel option parameters. The option parameters can be set by making a call to the API SetChannelOption.


The following table lists the possible options:

Option name Description
EAfOptionAutoMode Channels use all possible means to complete a call. Server reflexive, relay, and UPnP candidates may be retrieved for each channel. If necessary, it will try HTTP tunneling.
This is the default mode.
EAfOptionStandardMode Channels use only standard means to enable call completion, namely STUN and TURN. Server reflexive and relay candidates may be retrieved for each channel.
EAfOptionManualMode Channels use specified means to enable call completion. If this option is set, the programmer has to specify which options they prefer to enable when connecting to its peer.
EAfOptionEnableStun Retrieves a server reflexive candidate for connecting to a peer.
This option is only available if the channel is set to EAfOptionManualMode.
EAfOptionEnableRelay Retrieves relay candidate for connecting to a peer. Use HTTP proxy if necessary.
This option is only available if the channel is set to EAfOptionManualMode.
EAfOptionEnableHTTPTunneling Uses HTTP tunneling for connecting to a peer. This option is only available if the channel is set to EAfOptionManualMode.
EAfOptionEnableUPnP Enables a UPnP port mapping on an Internet Gateway Device (IGD) for connecting to a peer.
This option is only available if the channel is set to EAfOptionManualMode.
EAfOptionKeepAlivePeriodSeconds Sets the keep-alive period (in seconds) for the channel.
Timeouts are specified in milliseconds. A value of -1 indicates an infinite 
timeout. A value of 0 disables the timeout.
EAfOptionBandwidthKbps The peak amount of bandwidth a channel can use.
EAfOptionSocket This option can be used to specify options for the sockets used by AFE. The value must be the address of a struct of type AfSocketOptionParams.
AFE does not support retrieving this option with GetChannelOption.
EAfOptionRelayFallbackTimeout
This option affects the behavior of the Connect function.
By default, when connecting to a destination with Connect, AFE first tries a direct connection. If no data is received within 5 seconds, AFE assumes that a direct connection is not possible, and tries to connect through the TURN server. This timeout can be configured with EAfOptionRelayFallbackTimeout.
Timeouts are specified in milliseconds. If the value is negative,
AFE will try a direct connection only. If the value is zero,
AFE will try only through relay.
In the case of TCP channel, this timeout will be effective after a direct
connection has been attempted with the specified iTi timeout in CreateHost function.
EAfOptionTcpRegularMode
Applicable only for Microsoft® Lync™ mode (AF_MODE_MSOCS).
TCP regular mode is disabled by default; RTP and RTCP channels have only TCP candidates. To include both UDP and TCP candidates, TCP regular mode must be enabled by setting EAfOptionTcpRegularMode to AF_OPTION_TRUE with the help of SetChannelOption() function.
EAfOptionEnableBWManagement Used to enable or disable the bandwidth management in AnyFirewall™ Engine for a particular channel.
* If the value is 1 then bandwidth management is set as true for that channel.
* If the value is zero then bandwidth management is set as false.
Applicable only for Microsoft® Lync™ mode (AF_MODE_MSOCS).

Before setting this Option to true, Global bandwidth management must be set as true. Bandwidth management is only applicable in answered end. Don't enable bandwidth management in offerer end.
EAfOptionMinSendBW Used to set the minimum bandwidth used when sending on a specific channel.
Applicable only for Microsoft® Lync™ mode (AF_MODE_MSOCS).
EAfOptionMaxSendBW Used to set the maximumbandwidth used when sending on a specific channel.
Applicable only for Microsoft® Lync™ mode (AF_MODE_MSOCS).
EAfOptionMinRecvBW Used to set the minimum bandwidth used when receiving on a specific channel.
Applicable only for Microsoft® Lync™ mode (AF_MODE_MSOCS).
EAfOptionMaxRecvBW Used to set the maximum bandwidth used when receiving on a specific channel.
Applicable only for Microsoft® Lync™ mode (AF_MODE_MSOCS).
EAfOptionMaxSendBWConfirmedP2P Used to retrieve confirmation of the maximum bandwidth that can be used when sending from a TURN server in P2P case.
Applicable only for Microsoft® Lync™ mode (AF_MODE_MSOCS).
EAfOptionMaxRecvBWConfirmedP2P Used to retrieve confirmation of the maximum bandwidth that can be used when receiving from a TURN server in P2P case.
Applicable only for Microsoft® Lync™ mode (AF_MODE_MSOCS).
EAfOptionMaxSendBWConfirmedRelay Used to retrieve confirmation of the maximum bandwidth that can be used when sending from a TURN server in Relay case.
Applicable only for Microsoft® Lync™ mode (AF_MODE_MSOCS).
EAfOptionMaxRecvBWConfirmedRelay Used to retrieve confirmation of the maximum bandwidth that can be used when receiving from a TURN server in Relay case.
Applicable only for Microsoft® Lync™ mode (AF_MODE_MSOCS).
EAfOptionMSService Quality Indicates which service is being used: audio or video. For audio MS_SERVICE_QUALITY_AUDIO and for video MS_SERVICE_QUALITY_VIDEO is used.
EAfOptionUpdateBW Used to update the bandwidth.
Applicable only for Microsoft® Lync™ mode (AF_MODE_MSOCS).
EAfOptionEnableModeMsOcs Enables or disables Microsoft® Lync™ mode on a specific channel. To enable Microsoft® Lync™ mode, set this value to true. To disable it, set this value to false.
The default value is false for this option.
EAfOptionEnablePacketFilter Enables or disables packet filters for sockets other than the one ICE selected.
By default, this feature is enabled.
EAfOptionDontFragment Enables or disables relaying data through SendIndication mechanism in IETF mode. By default AFE uses ChannelData mechanism to relay data TURN server.
This option will work only if related channel is in EAfOptionManualMode.
EAfOptionFingerPrint Used to enable or disable fingerprint attribute in STUN signaling. By default this attribute is enable. If the value is less than or equal to zero then fingerprint attribute will not be added in STUN signaling.If the value is greater than zero then fingerprint attribute will be added in STUN signaling.
This option will work only if Channel ID is set as 0.
EAfOptionMessageQueueSize Now the size of message queue is configurable. Client can change the size of the queue of AFE which is used for message buffering of channel. AFE initially sets 128 size as default. If AFE can not allocate memory while re-sizing the queue, AFE will not change anything as well as return false otherwise re-size the queue according to parameter as well as return true.
If application wants to use modified buffer size then this option needs to be set just after creating a channel. This is configurable per channel basis.
The value should be greater than 32.
The value should be the power of 2. (i.e. 64, 128, 256, 512, 1024 etc.)


EAfOptionAutoMode, EAfOptionStandardMode, and EAfOptionManualMode control four other options:

  • EAfOptionEnableStun,
  • EAfOptionEnableRelay,
  • EAfOptionEnableHTTPTunneling, and
  • EAfOptionEnableUPnP.
    EAfOptionAutoMode and EAfOptionStandardMode set the values of the above four options, whereas EAfOptionManualMode allows these options to be individually configured using SetChannelOption. By default EAfOptionAutoMode mode of operation is enabled.
    All of the four options are initially set to FALSE when EAfOptionManualMode mode is first set. The application can then manually configure these options to TRUE or FALSE. For boolean options such as these,
    TRUE = AF_OPTION_TRUE = 1
    FALSE = AF_OPTION_FALSE = 0.

The table below shows the mode of operation affecting the four options:

Mode of Operation
Options
STUN Relay HTTP Tunneling UPnP
Auto TRUETRUE TRUETRUE
Standard TRUETRUEFALSEFALSE
Manual TRUE/FALSE TRUE/FALSE TRUE/FALSE TRUE/FALSE


These modes of operation and options can be set for each channel. If an option is set for channel 0, these options will be applied to all subsequent channels that are created. Since these options are channel-specific, shared services such as detecting connectivity will always use STUN and TURN servers, as well as HTTP tunneling and UPnP where necessary.