Prosody ADSI library: API

The following functions are provided by the Prosody ADSI library API:

API call W Description
adsi_init()   Prepare a Prosody module for use with ADSI
sm_play_sas_cas()   Generate the SAS and CAS parts of an ADSI outgoing signal
sm_play_vmwi_fsk()   Send a VMWI message over FSK modulation.
sm_play_cnd_fsk()   Send a CND message over FSK modulation.

This document is also available as separate pages for each function.


Prosody ADSI library: API: adsi_init

Prototype Definition

int adsi_init(ADSI_MODULE mp, tSMModuleId module)

Parameters

mp
A pointer to an opaque structure used by the library.
module
The Prosody module to prepare.

Description

Prepares a Prosody module for use with ADSI.

Returns

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


Prosody ADSI library: API: sm_play_sas_cas

Prototype Definition

int sm_play_sas_cas(struct sm_play_sas_cas_parms *parms, ADSI_MODULE mp)

Parameters

*parms
a structure of the following type:
typedef struct sm_play_sas_cas_parms {
	tSMChannelId channel;					/* in */
	enum kSASToneType {
		kSASToneTypeSingleBurst,
		kSASToneTypeDoubleBurst,
		kSASToneTypeTripleBurst,
	} sas_tone_type;						/* in */
} SM_PLAY_SAS_CAS_PARMS;
mp
A pointer to a structure initialised with adsi_init().

Description

This function generates the Subscriber Alerting Signal (SAS) and the CPE Alerting Signal (CAS). The exact sequence generated is:

kSASToneTypeSingleBurst kSASToneTypeDoubleBurst kSASToneTypeTripleBurst
440 Hz @ -16 dBm0 for 300 mS - 440 Hz @ -16 dBm0 for 100 mS
- silence for 100 mS
440 Hz @ -16 dBm0 for 100 mS
silence for 100 mS
440 Hz @ -16 dBm0 for 100 mS
2130 Hz @ -15 dBm0 + 2750 Hz @ -15 dBm0 for 82 mS
silence for 160 mS

Since this function uses sm_play_cptone() to generate the signal, the end of the signal is reported by sm_play_cptone_status() which can be monitored by waiting on the write event.

This function requires the firmware module tonegen to have been downloaded.

Fields

channel
The channel on which to generate the signal. This must have been allocated on the Prosody module that the mp parameter refers to.
sas_tone_type
The variant of SAS tone to generate. One of these values:
kSASToneTypeSingleBurst
Generate SAS tone with single burst of tone.
kSASToneTypeDoubleBurst
Generate SAS tone with two bursts of tone.
kSASToneTypeTripleBurst
Generate SAS tone with three bursts of tone.

Returns

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


Prosody ADSI library: API: sm_play_vmwi_fsk

Prototype Definition

int sm_play_vmwi_fsk(struct sm_play_vmwi_fsk *parms)

Parameters

*parms
a structure of the following type:
typedef struct sm_play_vmwi_fsk {
	tSMChannelId channel;					/* in */
	tSM_INT do_on_hook;					/* in */
	tSM_INT is_sdmf_message;				/* in */
	tSM_INT is_indicator_on_message;			/* in */
} SM_PLAY_VMWI_FSK;

Description

This function generates a Visual Message Waiting Indicator (VMWI) message. The message is sent in an FSK transmission at 1200 bits per second, using 1200 Hz for mark, 2200 Hz for space, and a power level of -13dBm0.

This function is intended to be used immediately after sm_play_sas_cas() has sent the SAS and CAS portion of the message.

Since this function uses the standard Prosody data communications API to generate the signal, the end of the signal is reported by smdc_line_status() which can be monitored by waiting on the write event.

This function requires the firmware modules asytx, fsktx, outchan, and prefsuf to have been downloaded.

Fields

channel
The channel on which to generate the signal.
do_on_hook
Selects on-hook (non-zero) or off-hook (zero) transmission format. The on-hook format starts with a channel seizure signal (300 bits of 0101...01) and 180 mark bits (11...1), whereas the off-hook format starts with only 80 mark bits.
is_sdmf_message
Selects Single Data Message Format - SDMF - (non-zero) or Multiple Data Message Format - MDMF - (zero).
is_indicator_on_message
Selects whether to generate an indicator-on message (non-zero), or an indicator-off message (zero).

Returns

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


Prosody ADSI library: API: sm_play_cnd_fsk

Prototype Definition

int sm_play_cnd_fsk(struct sm_play_cnd_fsk *parms)

Parameters

*parms
a structure of the following type:
typedef struct sm_play_cnd_fsk {
	tSMChannelId channel;					/* in */
	tSM_INT do_on_hook;					/* in */
	tSM_INT is_sdmf_message;				/* in */
	enum kCNDType {
		kCNDTypeAnonymous,
		kCNDTypeOutOfArea,
		kCNDTypeCallingDN,
	} cnd_type;						/* in */
	tSM_INT month;						/* in */
	tSM_INT day;						/* in */
	tSM_INT hour;						/* in */
	tSM_INT minute;						/* in */
	char digit_string[kCNDCallingDNMaxDigits_plus1];	/* in */
	char name_string[kCNDCallingNameMaxLen_plus1];		/* in */
} SM_PLAY_CND_FSK;

Description

This function generates a Calling Number Display (CND) message. The message is sent in an FSK transmission at 1200 bits per second, using 1200 Hz for mark, 2200 Hz for space, and a power level of -13dBm0.

This function is intended to be used immediately after sm_play_sas_cas() has sent the SAS and CAS portion of the message.

Since this function uses the standard Prosody data communications API to generate the signal, the end of the signal is reported by smdc_line_status() which can be monitored by waiting on the write event.

This function requires the firmware modules asytx, fsktx, outchan, and prefsuf to have been downloaded.

Fields

channel
The channel on which to generate the signal.
do_on_hook
Selects on-hook (non-zero) or off-hook (zero) transmission format. The on-hook format starts with a channel seizure signal (300 bits of 0101...01) and 180 mark bits (11...1), whereas the off-hook format starts with only 80 mark bits.
is_sdmf_message
Selects Single Data Message Format - SDMF - (non-zero) or Multiple Data Message Format - MDMF - (zero).
cnd_type
Controls the calling number facility in the message. One of these values:
kCNDTypeAnonymous
Specifies that the calling number is to be omitted and a code included specifying that the calling number is anyonymous.
kCNDTypeOutOfArea
Specifies that the calling number is to be omitted and a code included specifying that the calling number is unavailable because it is out-of-area.
kCNDTypeCallingDN
Specifies that the calling number is to be included. The number is taken from the digit_string field.
month
The month (1..12) to include in the generated message.
day
The day (1..31) to include in the generated message.
hour
The hour (0..23) to include in the generated message.
minute
The minute (0..59) to include in the generated message.
digit_string
Specifies the calling number. This field is ignored unless the cnd_type field contains kCNDTypeCallingDN.
name_string
Specifies the name associated with the calling number. This is included in the generated message only if it is not a zero length string, the format is MDMF, and the cnd_type field contains kCNDTypeCallingDN.

Returns

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


These functions constitute the Prosody ADSI library API.