The SetAudioMediaFormat function allows you to specify the single outgoing media type (codec) for each phone line supported by the telephony engine. All phone lines that are supported by the telephony engine can be set to the same media type. Alternatively, you can set the media type of individual phone lines to whatever your application requires. You can configure the phone lines in any media combination you need.

When the telephony engine places an out bound call, the single media format (codec) that will be used for the call is the media format specified by the MediaFormat parameter.

When the telephony engine receives an in-bound call, one or more media formats (codecs) will be requested by the far end (the initiating side of the call). The telephony engine will determine the lowest bandwidth codec from the list of codecs that is specified in the call's INVITE SIP message.

If you want to initiate and receive calls using a specific set of enabled codecs (more than one codec), please see the SetAudioMediaFormats(Int32, array<VoipMediaEngine..::.MEDIA_FORMAT_AUDIO>[]()[]) API procedure.

Namespace:  LanScape
Assembly:  LMEVoipManaged (in LMEVoipManaged.dll) Version: 6.0.5226.26700

Syntax

C#
public VoipMediaEngine..::.TELEPHONY_RETURN_VALUE SetAudioMediaFormat(
	int PhoneLine,
	VoipMediaEngine..::.MEDIA_FORMAT_AUDIO MediaFormat
)
Visual Basic (Declaration)
Public Function SetAudioMediaFormat ( _
	PhoneLine As Integer, _
	MediaFormat As VoipMediaEngine..::.MEDIA_FORMAT_AUDIO _
) As VoipMediaEngine..::.TELEPHONY_RETURN_VALUE
Visual C++
public:
VoipMediaEngine..::.TELEPHONY_RETURN_VALUE SetAudioMediaFormat(
	int PhoneLine, 
	VoipMediaEngine..::.MEDIA_FORMAT_AUDIO MediaFormat
)
J#
public VoipMediaEngine..::.TELEPHONY_RETURN_VALUE SetAudioMediaFormat(
	int PhoneLine,
	VoipMediaEngine..::.MEDIA_FORMAT_AUDIO MediaFormat
)

Parameters

PhoneLine
Type: System..::.Int32
The zero based phone line to configure.
MediaFormat
Type: LanScape..::.VoipMediaEngine..::.MEDIA_FORMAT_AUDIO
The media format the phone line will use. It can be any one of the following enumerated values as specified by the VoipMediaEngine..::.MEDIA_FORMAT_AUDIO data type.

Return Value

If the function succeeds, the return value will be SipSuccess.

If the function fails, the return value will be one of the following values as specified by the VoipMediaEngine..::.TELEPHONY_RETURN_VALUE data type.

Return ValueDescription
SipCallFailure
This value is returned by telephony API procedures to indicate general API failure. This error value is used as a "catch all error". If you receive this error, check to make sure that all parameters specified in the API procedure call are correct. Particularly, verify that pointers to memory regions are valid. This error return value is only used if a mapping to another specific error value does not exist.

(API return value)

SipBadPhoneLine
Application software called a telephony API procedure and specified an invalid phone line. Phone lines are numbered starting from zero. This error is most commonly returned when attempting to access phone lines in excess of the max number of lines supported by the telephony engine.

(API return value)

SipBadAudioDataType

Remarks

None.

See Also