Prosody RTP processing: API: sm_vmptx_config_tones

Prototype Definition

int sm_vmptx_config_tones(struct sm_vmptx_tone_parms *tonep)

Parameters

*tonep
a structure of the following type:
typedef struct sm_vmptx_tone_parms {
	tSMVMPtxId vmptx;					/* in */
	tSM_INT convert_tones;					/* in */
	tSM_INT elim_tones;					/* in */
	tSMVMPTxToneSetId tone_set_id;				/* in */
	enum kSMVMPtxRFC2833MinDuration {
		kSMVMPtxRFC2833MinDurationNoMinimum,
		kSMVMPtxRFC2833MinDuration40,
	} min_duration;						/* in */
} SM_VMPTX_TONE_PARMS;

Description

Allows an application to specify how DTMF tones in the audio stream are handled when transmitting RTP data.

It may be desirable to encode tones as per RFC 2833, rather than using the chosen audio codec. Some codecs, such as G.711, can represent DTMF tones and do not require an alternative encoding, however, applications may still choose to send tones as RFC 2833. For audio codecs that cannot adequately represent DTMF tones (e.g. G.729) it is necessary to send tones using an alternative encoding if the tones must be detected by the system which terminates an RTP stream. In this scenario, applications should supply a non-zero value for convert_tones in order to enable this feature.

This requires the module vtdet to have been downloaded.

Fields

vmptx
The VMP[tx] to be configured
convert_tones
Indicator of whether tones that could be sent using the RFC 2833 standard that are detected in the audio should be encoded as RFC 2833 RTP packets. A non-zero value instructs the VMP[tx] to encode these tones according to RFC 2833(see supported tones from RFC2833).
elim_tones
Indicator of whether tones that could be sent using the RFC 2833 encoding, that are detected in the audio, should be eliminated from the audio. A non-zero value instructs the VMP[tx] to eliminate these tones (see supported tones from RFC2833).
tone_set_id
The tone set that is to be used when converting and eliminating tones. This is the result of a call to sm_vmptx_create_toneset() The same module value must have been used to allocate both this VMP[tx] and the tone set.
min_duration
How much tone needs to be detected before RFC 2833 packets are generated. One of these values:
kSMVMPtxRFC2833MinDurationNoMinimum
kSMVMPtxRFC2833MinDuration40

Returns

0 if call completed successfully, otherwise a standard error such as:


This function is part of the Prosody RTP processing API.