®
Intel IXP400 Digital Signal
Processing (DSP) Software
Version 2.5
API Reference Manual
December 2004
Document Number: 273811-007a
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Contents
Introduction............................................................................................................ 7
Architectural Overview ...................................................................................... 9
Message Format and Delivery Mechanism.............................................. 20
Common Control Message............................................................................. 23
Get-Parameter Message............................................................................... 26
Get-All-Parameters Message........................................................................ 26
Resource-Specific Control Messages ....................................................... 29
Tone Generator Play Message ..................................................................... 30
API Reference Manual
3
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Packet Data Interface.........................................................................................36
Packet Formats..............................................................................................36
Packet Delivery Mechanism...........................................................................37
Configuration and Initialization.....................................................................38
System Configuration.....................................................................................38
Complementary Functions..............................................................................44
Flash Hook Detection.....................................................................................44
Cache Prompt Registration............................................................................45
Constant Data.......................................................................................................47
Error Codes....................................................................................................47
Other Constants.............................................................................................51
Figures
Tables
®
Resource Component Identifiers....................................................................10
None.
4
API Reference Manual
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Revision History
Date
Revision
Description
Updated product branding.
December 2004
008
Further updates for the release of Intel® IXP400 DSP Software
v2.5. Change bars indicate areas of change.
Updates for the release of Intel® IXP400 DSP Software v2.5.
Updates for the release of Intel® IXP400 DSP Software
Version 2.4.
September 2004
June 2004
007
006
005
January 2004
Clarified input for XStatus_t xMsgReceivemessage
function.
Updates for the release of Intel® IXP400 DSP Software
Version 2.3
September 2003
September 2003
004
003
Added minor updates to represent features of Intel® IXP400
DSP Software Version 1.1.
March 2003
002
001
January 2003
First release of this document.
API Reference Manual
5
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
This page intentionally left blank.
6
API Reference Manual
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Introduction
1.0
Introduction
®
The Intel IXP400 DSP Software v2.5 is a software module that provides the basic voice processing
functionalities for VoIP residential gateway applications. It can be viewed as a completed media pro-
cessing layer with control and data interfaces as its API.
This document defines the API specifications.
1.1
General
®
The Intel IXP400 DSP Software is a software module for media processing, targeted for next gen-
eration IADs such as Consumer Premise Equipment (CPE), specifically, to perform audio encoding/
decoding, echo cancellation, tone processing and jitter control, etc., as required in any IP media gate-
way or real-time media streaming functionalities.
This document is intended to describe the control and data interfaces in order for a third party de-
veloper to incorporate the module into a media gateway or server system. It provides sufficient de-
tails of the interfaces so that the user can fully configure and control the operations and services.
It additionally describes the data interface and format as well as message and data delivery mecha-
nisms.
1.2
1.3
Scope
The interface of DSP software is a set of functions, macros, and message and packet formats that
determines how the applications access the media processing resource components.
Audience
This document is intended for the following audiences:
• Firmware engineers who are responsible for the development of DSP Resources
• Third party software engineers who are building a gateway or server application
• System architects and engineers
• Project development managers
1.4
Acronyms
AGC
ALC
CPE
EC
Automatic Gain Control for voice data towards IP network
Automatic Level Control
Consumer Premise Equipment
Echo Cancellation
FSK
IP
Frequency Shift Keying
Internet Protocol
ISR
Interrupt Service Routine
API Reference Manual
7
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Introduction
NLP
SP
Non-linear Processing (for EC)
Signal Processing
VAD
Voice Activity Detection
8
API Reference Manual
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Architectural Overview
2.0
Architectural Overview
®
Intel IXP400 DSP Software is implemented as an independent module having its own tasks and
runtime environment. The software architecture is of a two-layer hierarchy – a control layer that pro-
vides the control interface and control logic, and a data processing layer where the media data
In this architecture, a group of media resource (MPR) components forms a channel for full duplex
media processing. They are the addressable entities that can be controlled individually by the appli-
cations.
®
Figure 1. Architecture of Intel IXP400 DSP Software v2.5
Intel® IXP400 DSP Software Client
User-Defined
Control
Messages
and Replies
Replies and
Events
Control
Messages
Intel® IXP400 DSP
User-Defined
Software Control Interface
Control Interface
Common Control Logic and
Generic Control Engine
Message
Agent
Network
Endpoint
Tone
Encoder
Tone
Detector
Audio
Player
Audio
Mixer
Decoder
T.38
Generator
Control Layer
Data Processing Layer
Data-Processing
Algorithms and
Components
PCM
Data
Interface
IP
Stack
SLIC
Interface
Packet
Interface
PCM
Data
Encoded
Packets
Sync
Real-Time Execution Environment
Revision 002
API Reference Manual
9
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Media Processing Resource Components
3.0
Media Processing Resource Components
®
processing resource (MPR) components similar to those defined in many Intel Dialogic compute te-
lephony system architecture. There are nine resource components, working together to provide all
the media processing needed by a gateway or server channel. Each resource component has a unique
identifier as shown below. In the following, we will refer to each of these nine media processing en-
tities as either a resource or a resource component.
Figure 2. Resource Component Identifiers
typedef enum{
XMPR_ANY=0,
XMPR_NET,
/* any resource, not currently supported */
/* Network Endpoint resource */
/* Decoder resource */
XMPR_DEC,
XMPR_ENC,
/* Encoder resource */
XMPR_TNGEN,
XMPR_TNDET,
XMPR_PLY,
/* Tone generator resource */
/* Tone detector resource */
/* Audio player resource */
/* Audio mixer resource */
/* T38 IP fax resource */
/* Message Agent resource */
XMPR_MIX,
XMPR_T38,
XMPR_MA
} XMPResource_t;
Each resource contains a particular set of algorithms to perform a specific set of media-processing
functions. For example, the Network Endpoint resource consists of echo cancellation, high pass fil-
ter and PCM A-law or µ-lawconversion algorithms to perform TDM front-end processing. Each re-
source, therefore, has a unique set of parameters associated with the particular set of algorithms it
contains.
Communications of control information to these resource components are through messages defined
in this document. Some messages are common to all the resources while others are unique only to a
particular resource.
The following sections describe each resource in terms of their identifiers, media processing func-
tions, parameters, and control messages. The resource parameters can be read or modified by the
messages or direct function calls. Some of the parameters can only be set though the messages be-
cause they can only be updated by the internal control task.
3.1
Network Endpoint Resource Component
Resource Type: XMPR_NET
Media Processing Functions
• A-law or µ-law compression and decompression
• High pass Filter
• Echo Cancellation (EC)
• Supplementary functions (timer and flash hook detection)
Resource-Specific Control Messages: None
10
API Reference Manual
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Media Processing Resource Components
Parameters
Direct
Write
Identifier
Description, Values
Current state (0: idle, 1: active)
Attr.
XPARMID_RES_STATE
R
N
The L-Port stream ID. Default: the stream assigned to the IP termination’s T-
Port of the same channel if exist, otherwise –1.
XPARMID_NET_LP_STREAM
R/W
N
N
PCM data format on HSS TDM bus. XPARM_NET_ALAWor
XPARM_NET_MULAW.
Default: XPARM_NET_MULAW
XPARMID_NET_LAW
R/W
R/W
R/W
EC enabling flag, XPARM_ONor XPARM_OFF.
Default: XPARM_ON
XPARMID_NET_ECENABLE
XPARMID_NET_ECTAIL
Y
N
EC tail length (2, 4, 6, 8, ... in 1 ms unit, Max 64 in narrowband mode and 32
in wideband mode).
Default: 6. The resource must be reset after setting the parameter.
EC NLP and suppress flag, XPARM_OFF, XPARM_EC_NLP_ONor
XPARM_EC_NLP_SUP_ON.
XPARMID_NET_ECNLP
R/W
N
Default: XPARM_OFF
EC freezing flag, XPARM_ON(freeze) or XPARM_OFF(adaptive).
XPARMID_NET_ECFREEZE
XPARMID_NET_DELAYCOMP
R/W
R/W
N
Y
Typically, freeze is used only in debug situations. Default: XPARM_OFF
EC delay compensation (0 ~ 240 in 0.125-ms units).
Default: 20 (or 2.5 ms delay compensation)
The window of flash hook detection (in 10-ms units)
Default: 100
XPARMID_NET_FLASH_HK
XPARMID_NET_TIMER
R/W
R/W
Y
Y
Timer counter (in 10 ms unit). This timer can be used for timing that is
synchronized to the TDM clock.
Default: 0
Input gain of HSS interface (+15 ~ –40 in 1-dB units)
Default: 0
XPARMID_NET_GAIN_RX
XPARMID_NET_GAIN_TX
R/W
R/W
N
N
Output gain of HSS interface (+15 ~ –40 in 1-dB units)
Default: 0
TDM short bypass flag, XPARM_ONor XPARM_OFF. The low latency
connection made within NPE between the corresponding time slots if
enabled. Do not enable it in wideband mode.
XPARMID_NET_HSS_BYPASS
R/W
N
Default: XPARM_OFF
Events
• XEVT_NET_HOOK_STATE— Hook state change detected.
• XEVT_NET_TIMER— Timer expired.
3.2
Decoder Resource Component
Resource Type: XMPR_DEC
API Reference Manual
11
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Media Processing Resource Components
Media Processing Functions
• Decoding
• Automatic level control and/or volume control
• Comfort noise generation
• Jitter compensation
Resource-Specific Control Messages
• XMSG_CODER_START(inbound)
• XMSG_CODER_STOP_ACK(outbound)
Parameters
Direct
Write
Identifier
XPARMID_RES_STATE
XPARMID_DEC_VOL
Description and Values
Current state (0: idle, 1: active)
Attr.
R
N
N
Decoder volume adjustment; +15 ~ -40 in 1-dB units.
Default: 0 (Set to -99 to mute)
R/W
ALC enable flag. XPARM_ONor XPARM_OFF.
Default: XPARM_ON
XPARMID_DEC_ALC
XPARMID_DEC_CNG
R/W
R/W
N
Y
CNG enable flag. XPARM_ONor XPARM_OFF. Default:
XPARM_OFF
Coder type. Currently supported types are
XCODER_TYPE_G711MU_10MS,
XCODER_TYPE_G711A_10MS, XCODER_TYPE_G729A
or XCODE_TYPE_G723, XCODER_TYPE_G722,
XPARMID_DEC_CTYPE
R/W
N
XCODER_TYPE_G726_40, XCODER_TYPE_G726_32,
XCODER_TYPE_G726_24, XCODER_TYPE_G726_16,
and XCODER_TYPE_G729.
Default: XCODER_TYPE_G711MU_10MS
Report bad and lost packet, caused by the jitter buffer unable to
provide packets to the decoder. XPARM_ONor XPARM_OFF.
Default: XPARM_OFF
XPARMID_DEC_EVT_PKT
XPARMID_DEC_EVT_PKTCHNG
XPARMID_DEC_AUTOSW
R/W
R/W
R/W
Y
Y
Y
Report RTP payload type change. XPARM_ONor
XPARM_OFF.
Default: XPARM_ON.
Auto-Switch mask bits. This specifies which coder types are
allowed to be auto-switched based on input RTP payload type.
Default: XPARM_DEC_AUTOSW_ALL
Jitter buffer maximum delay (0 ~ 500 in 1-ms units).
Default: 200.
XPARMID_DEC_JB_MAXDLY
XPARMID_DEC_JB_PLR
R/W
R/W
N
N
Jitter buffer packet loss rate in 0.1% units.
Default: 1
12
API Reference Manual
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Media Processing Resource Components
Direct
Write
Identifier
Description and Values
Attr.
RTP payload type for G.726 40-Kbps coder. The payload type is
negotiated and set by the call stack. The range of values is 96 to
127.
XPARMID_DEC_G726_40_RTP_PLD
R/W
Y
Default: 96
RTP payload type for G.726 32-Kkbps coder, The payload type is
negotiated and set by the call stack. The range of values is 96 to
127.
XPARMID_DEC_G726_32_RTP_PLD
XPARMID_DEC_G726_24_RTP_PLD
XPARMID_DEC_G726_16_RTP_PLD
R/W
R/W
R/W
Y
Y
Y
Default: 97
RTP payload type for G.726 24-Kbps coder, The payload type is
negotiated and set by the call stack. The range of values is 96 to
127.
Default: 98
RTP payload type for G.726 16kbps coder, The payload type is
negotiated and set by the call stack. The range of values is 96 to
127.
Default: 99
G.726 packing format. Set to XPARM_G726_PACK_LSBfor RFC
3551 format, or XPARM_G726_PACK_MSBfor I.366.2 Annex E
format.
XPARMID_DEC_G726_PACK
R/W
N
Default: XPARM_G726_PACK_LSB
Events
• XEVT_LOST_PACKET – Bad or lost packet.
• XEVT_DEC_PACKET_CHNG – RTP payload type changed.
3.3
Encoder Resource Component
Resource Type: XMPR_ENC
Media Processing Functions
• Encoding
• Automatic Gain Control
• Voice Activity Detection
Resource-Specific Control Messages
• XMSG_CODER_START(inbound)
• XMSG_CODER_STOP_ACK (outbound)
API Reference Manual
13
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Media Processing Resource Components
Parameters
Direct
Write
Identifier
Description and values
Current state (0: idle, 1: active)
Attr.
XPARMID_RES_STATE
R
N
N
L-Port stream ID. Default: the stream assigned to the TDM termination’s
T-Port of the same channel if exist, otherwise –1.
XPARMID_ENC_LP_STREAM
R/W
AGC enable flag. XPARM_ONor XPARM_OFF.
Default: XPARM_OFF
XPARMID_ENC_AGC
XPARMID_ENC_VAD
R/W
R/W
N
N
VAD enable flag. XPARM_ONor XPARM_OFF.
Default: XPARM_OFF
Coder type. Currently supported types are
XCODER_TYPE_G711MU_10MS,
XCODER_TYPE_G711A_10MS, XCODER_TYPE_G729Aor
XCODE_TYPE_G723,
XCODER_TYPE_G722,XCODER_TYPE_G726_40,
XPARMID_ENC_CTYPE
XPARMID_ENC_MFPP
R/W
N
XCODER_TYPE_G726_32,
XCODER_TYPE_G726_24,
XCODER_TYPE_G726_16,
and XCODER_TYPE_G729.
Default: XCODER_TYPE_G711MU_10MS
Number of frames per packet. Supported range is 1~6 for G.711 and
G.722, 1~8 for G.723, 1~9 for G.726 40 Kbps, 1~12 for G.726 32 Kbps,
1~16 for G.726 24 Kbps, and 1~24 for G.729 and G.726 16 Kbps.
R/W
N
Default: 1.
Enable packet lost event. XPARM_ONor XPARM_OFF.
Default: XPARM_OFF
XPARMID_ENC_EVT_PKT
R/W
R/W
Y
Y
RTP payload type for G.726 40-Kbps coder, The payload type is
negotiated and set by the call stack. The range of values is 96 to 127.
XPARMID_ENC_G726_40_RTP_PLD
Default: 96
RTP payload type for G.726 32-Kbps coder, The payload type is
negotiated and set by the call stack. The range of values is 96 to 127.
XPARMID_ENC_G726_32_RTP_PLD
XPARMID_ENC_G726_24_RTP_PLD
XPARMID_ENC_G726_16_RTP_PLD
R/W
R/W
R/W
Y
Y
Y
Default: 97
RTP payload type for G.726 24-Kbps coder, The payload type is
negotiated and set by the call stack. The range of values is 96 to 127.
Default: 98
RTP payload type for G.726 16-Kbps coder, The payload type is
negotiated and set by the call stack. The range of values is 96 to 127.
Default: 99
G.726 packing format. Set to XPARM_G726_PACK_LSBfor RFC 3551
XPARMID_ENC_G726_PACK
XPARMID_ENC_VOL
Events
R/W
R/W
N
N
format, or XPARM_G726_PACK_MSBfor I.366.2 Annex E format.
Default: XPARM_G726_PACK_LSB
Encoder gain adjustment, +15 ~ – 40 in 1-dB units.
Default: 0 (Set to -99 to mute)
• XEVT_LOST_PACKET— Bad packet.
• XEVT_DEC_PACKET_CHNG— Received RTP payload type changed.
14
API Reference Manual
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Media Processing Resource Components
3.4
Tone Generation Resource Component
Resource Type: XMPR_TNGEN
Media Processing Functions
• Generating multiple frequency tone signals
• Generating call progress tones
Resource-Specific Control Messages
• XMSG_TG_PLAY(inbound)
• XMSG_TG_PLAY_FSK(inbound)
• XMSG_TG_PLAY_CMPLT (outbound)
Parameters
Direct
Write
Identifier
Description and values
Current state (0: idle, 1: active)
Attr.
R
XPARMID_RES_STATE
XPARMID_TNGEN_VOL
N
N
Tone Generator’s volume adjustment, +15 ~ –20 in 1-dB units.
Default: 0
R/W
FSK modulator mode. XPARM_TNGEN_FSK_V23or
XPARM_TNGEN_FSK_B202.
XPARMID_TNGEN_FSK_MOD
R/W
Y
Default: XPARM_TNGEN_FSK_B202if country code set to
COUNTRY_CODE_US or COUNTRY_CODE_PRC, otherwise
XPARM_TNGEN_FSK_V23
CS bit length of FSK modulator (in bit unit).
XPARMID_TNGEN_FSK_CS
R/W
R/W
Y
Y
Default: 300 if country code set to COUNTRY_CODE_USor
COUNTRY_CODE_PRC, otherwise 0.
Mark bit length of FSK modulator (in bit unit).
XPARMID_TNGEN_FSK_MARK
Default: 180 if country code set to COUNTRY_CODE_USor
COUNTRY_CODE_PRC, otherwise 100.
FSK modulator baud rate (XPARM_TNGEN_FSK_R1200,
XPARM_TNGEN_FSK_R600, XPARM_TNGEN_FSK_R300,
XPARM_TNGEN_FSK_R150or XPARM_TNGEN_FSK_R75).
XPARMID_TNGEN_FSK_RATE
R/W
N
Default: XPARM_TNGEN_FSK_R1200, i.e., 1200 bps
Postmark bit length of FSK modulator (in bit unit)
Default: 72
XPARMID_TNGEN_FSK_POSTMK
XPARMID_TNGEN_RFC2833
R/W
R/W
Y
N
RFC2833 enable flag. XPARM_ONor XPARM_OFF.
Default: XPARM_ON
Events
None.
API Reference Manual
15
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Media Processing Resource Components
3.5
Tone Detection Resource Component
Resource Type: XMPR_TNDET
Media Processing Functions
• Receiving DTMF digits
• Detecting individual tone event
Resource-Specific Control Messages
• XMSG_TD_RCV(inbound)
• XMSG_TD_RCV_FSK(inbound)
• XMSG_TD_RCV_CMPLT (outbound)
• XMSG_TD_RCV_FSK_CMPLT (outbound)
Parameters
Direct
Write
Identifier
Description and values
Current state (0: idle, 1: active)
Attr.
XPARMID_RES_STATE
R
N
N
L-Port stream ID. Default: the stream assigned to the DTM
termination’s T-Port of the same channel if exist, otherwise –1.
XPARMID_TD_LP_STREAM
R/W
Tone Clamping enable flag. XPARM_ONor XPARM_OFF.
XPARMID_TD_TC
R/W
R/W
Y
N
Default: XPARM_OFF
Tone Clamping buffer size. 0 ~ 3 in 10 ms unit.
Default: 3
XPARMID_TD_TC_FRAMES
Tone event enable flag. XPARM_OFF,
XPARM_TD_RPT_TONE_ON,
XPARM_TD_RPT_TONE_OFFor
XPARM_TD_RPT_TONE_ON_OFF.
XPARMID_TD_RPT_EVENTS
R/W
Y
Default: XPARM_OFF
RFC2833 event enable flag. XPARM_ONor XPARM_OFF.
Default: XPARM_OFF
XPARMID_TD_RFC2833E_ENABLE
R/W
R/W
Y
N
RFC 2833 packet rate in 10-ms units, i.e., the period between
the packets generated when a tone event is detected.
XPARMID_TD_RFC2833E_UPDATERATE
Default: 5
Redundancy of end-of-event packet. Range 0-255.
Default: 3
XPARMID_TD_RFC2833E_NUMEOE
XPARMID_TD_RFC2833E_NUMBOE
R/W
R/W
Y
Y
Redundancy of begin-of-event packet. Range 0-255.
Default: 0
Flag of audio encoding suppression when event detected.
XPARM_ONor XPARM_OFF.
Default: XPARM_ON
XPARMID_TD_RFC2833E_AUDIOSUPRESS
XPARMID_TD_RFC2833E_PAYLOADTYPE
R/W
R/W
N
Y
RFC 2833 Payload type, Range is in the RTP dynamic payload
type range of 96 to 127.
Default: 0x65.
16
API Reference Manual
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Media Processing Resource Components
Direct
Write
Identifier
Description and values
Attr.
Minimum CS-bit length required by FSK receiver. Default: 200
if country code set to COUNTRY_CODE_USor
COUNTRY_CODE_PRC, otherwise 0.
XPARMID_TD_FSK_CS
R/W
Y
Minimum mark-bit length required by FSK receiver. Default:
100 if country code set to COUNTRY_CODE_USor
COUNTRY_CODE_PRC, otherwise 60.
XPARMID_TD_FSK_MARK
R/W
Y
Extra stop bits allowed between data.
Default: 20
XPARMID_TD_FSK_STOP
XPARMID_TD_FSK_RATE
R/W
R/W
Y
Y
Baud rate of FSK receiver. (Reserved for future, currently only
support 1,200 bps rate)
Events
• XEVT_CODE_TD_TONEON – tone on event for an individual tone
• XEVT_CODE_TD_TONEOFF – tone off event for an individual tone
Event data1gives the tone ID and data2 gives the time stamp in 10-ms units.
3.6
Audio Player Resource Component
Resource Type: XMPR_PLY
Media Processing Functions
• Play back recorded audio data.
Resource-Specific Control Messages
• XMSG_PLY_START(inbound)
• XMSG_PLY_CMPLT (outbound)
Parameters
Direct
Write
Identifier
Description and values
Attr.
XPARMID_RES_STATE
XPARMID_PLY_VOL
Current state (0: idle, 1: active)
Volume adjustment (+15 ~ –30 in 1dB unit), Default: 0
R
N
N
R/W
Events
None.
3.7
Audio Mixer Resource Component
Resource Type: XMPR_MIX
API Reference Manual
17
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Media Processing Resource Components
Media Processing Functions
Mixing multiple audio streams for three-way call or small audio conference. The maximum number
of parties to the mixer is currently five.
Resource-Specific Control Messages
None.
Parameters
Direct
Write
Identifier
Description and values
Current state (0: idle, 1: active)
Attr.
XPARMID_RES_STATE
R
N
N
N
N
XPARMID_MIX_LP_STREAM
XPARMID_MIX_LP_STREAM+1
XPARMID_MIX_LP_STREAM+n-1
The first L-Port stream ID. Default: –1
The 2nd L-Port stream ID. Default: –1
The nth L-Port stream ID. Default: –1
R/W
R/W
R/W
Events
None.
3.8
T.38 Fax Resource Component
Resource Type: XMPR_T38
Media Processing Functions
• Real-time fax gateway between TDM interface and IP network
Resource-Specific Control Messages
None.
Parameters
Direct
Write
Identifier
Description and Values
Current state (0: idle, 1: active)
Attr.
XPARMID_RES_STATE
XPARMID_T38_ELLIPSIS
R
N
N
Flag of enabling ellipsis. XPARM_ONor XPARM_OFF.
Default: XPARM_OFF
R/W
Flag of enabling FEC. XPARM_ONor XPARM_OFF.
Default: XPARM_OFF
XPARMID_T38_FEC
R/W
R/W
N
N
Redundancy level, (0 ~ 7)
Default: 0
XPARMID_T38_REDUNDANCY
18
API Reference Manual
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Media Processing Resource Components
Direct
Write
Identifier
Description and Values
Method of modem rate negotiation.
Attr.
XPARM_T38_RATE_NEG_LOCAL or
XPARM_T38_RATE_NEG_REMOTE.
XPARMID_T38_RATE_NEG
R/W
N
Default:XPARM_T38_RATE_NEG_REMOTEif packet transferred over
UDP, otherwise XPARM_T38_RATE_NEG_LOCAL
TCF error threshold (in percentage).
Default: 5
XPARAID_T38_TCF_THRSHLD
XPARMID_T38_TRANSPORT
R/W
R/W
N
N
Protocol used to transfer T.38 packets over IP network.
XPARMID_T38_TRANS_UDP or XPARMID_T38_TRANS_TCP.
Default: XPARMID_T38_TRANS_UDP
Special mode, XPARM_T38_MODE_ITU or
XPARM_T38_MODE_CHINA.
XPARMID_T38_MODE
R/W
N
Default: XPARM_T38_MODE_ITU
Events
XEVT_T38_END — End of the T.38 session. Event Data 1 gives the reason of the termination.
3.9
Message Agent Resource Component
Resource Type: XMPR_MA
Media Processing Functions
• No media processing function.
• Converting the user-defined messages and executing the control accordingly.
Resource-Specific Control Messages
None.
Parameters
Direct
Write
Identifier
Description and values
Current state (0: idle, 1: active)
Attr.
XPARMID_RES_STATE
XPARMID_MA_DEBUG
Default: XPARM_OFF
R
N
Enable trace during processing user’s messages. XPARM_ONor
XPARM_OFF
Default: XPARM_OFF
R/W
Y
Events
None.
API Reference Manual
19
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Message Format and Delivery Mechanism
4.0
Message Format and Delivery Mechanism
There are two message queues (in-bound and out-bound) for the user application to send control
messages and to receive response and event messages, respectively. The message queues are created
from pre-allocated memory buffers in consideration of maximum message size and total number of
messages. The entire message header and content are copied to/from the buffers in the message
queue during message transmitting and receiving. The memory used for messaging is not shared be-
tween the message sender and the receiver.
4.1
Message Functions
Three functions are provided to send and receive messages.
XStatus_t xMsgSend (void *pMsgBuf);
Description
Input
Sends a control message to the in-bound message queue
pMsgBuf– Pointer to the message buffer.
None
Output
• XSUCC— If successful
• XERROR— If errors
Return
Caution
Note
Message buffer requires 4-byte alignment.
Message buffer can be used for any other purpose after sending.
XStatus_t xMsgReceive (void *pMsgBuf, UINT16 channel, int timeout);
Description
Receives acknowledgement or event from the outbound message queue.
• pMsgBuf– Pointer to the message buffer
• channel– Channel number. (Reserved for future extension)
• timeout – Waiting flag
Input
— XWAIT_NONE— If return immediately
— XWAIT_FOREVER— If never time out (no other values are valid.)
Output
Return
None
• XSUCC— If successful
• XERROR— If errors
Message buffer requires 4-byte alignment. The receiving buffer must fit the maximum
message size. Cannot be called from ISR.
Caution
XStatus_t xMsgWrite (void *pMsgBuf); (Sheet 1 of 2)
Posts a message (e.g. an user defined external event message) to the out-bound queue so
Description
that it can be retrieved by XMsgReceive().
pMsgBuf— Pointer to the message buffer.
None
Input
Output
20
API Reference Manual
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Message Format and Delivery Mechanism
XStatus_t xMsgWrite (void *pMsgBuf); (Sheet 2 of 2)
• XSUCC— If successful
• XERROR— If errors
Return
Caution
Note
Message buffer requires 4-byte alignment.
The message buffer can be used for any other purpose, after posting.
4.2
Message Header Format
typedef struct{
UINT32 transactionId; /* used by apps to track the message */
UINT16 instance;
/* instance ID (1-0xffff), 0:reserved */
/* MPR resource type */
UINT8
UINT8
resource;
reserved;
Format
/* reserved for future */
UINT16 size;
/* total size in bytes */
UINT8
UINT8
type;
/* message type */
attribute;
/* attribute, reserved for future */
} XMsgHdr_t, *XMsgRef_t_t;
Caution Message content must follow the header in contiguous memory.
#define XMSG_MAKE_HEAD(pMsg, trans, res, inst, sz, typ, attr) \
((XMsgRef_t)(pMsg))->transactionId = trans;\
((XMsgRef_t)(pMsg))->instance
((XMsgRef_t)(pMsg))->resource
((XMsgRef_t)(pMsg))->reserved
((XMsgRef_t)(pMsg))->size
= inst;\
= res;\
= 0;\
Macros
= sz;\
((XMsgRef_t)(pMsg))->type
= typ;\
= attr;
((XMsgRef_t)(pMsg))->attribute
API Reference Manual
21
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Message Format and Delivery Mechanism
4.3
Message Type List
All message types are pre-defined as:
Typedef enum{
XMSG_BEGIN =0,
XMSG_RESET,
/* Begin list */
/* reset a resource */
XMSG_START,
/* start media processing a SP resource */
/* stop a current action on a SP resource */
/* ping a SP resource */
XMSG_STOP,
XMSG_PING,
XMSG_SET_PARM,
XMSG_SET_MPARMS,
XMSG_GET_PARM,
XMSG_GET_PARM_ACK,
XMSG_GET_ALLPARMS,
/* set a parameter on a SP resource */
/* set multiple parameters on a SP resource */
/* get a parameter from a SP resource */
/* acknowledgement to get parameter message */
/* get all parameters from a SP resource */
XMSG_GET_ALLPARMS_ACK, /* acknowledgement to get all parameter message */
XMSG_ACK,
/* general acknowledgement message */
/* error message from SP resource */
/* event message from SP resource */
/* start a codec resource */
XMSG_ERROR,
XMSG_EVENT,
XMSG_CODER_START,
XMSG_CODER_STOP_ACK,
XMSG_TG_PLAY,
/* acknowledgement to stop message */
/* play a digit string on a TG instance */
/* play FSK modulated data */
XMSG_TG_PLAY_FSK,
XMSG_TG_PLAY_CMPLT,
XMSG_TD_RCV,
/* play-completed message from a TG instance */
/* receive a digit string on a TD instance */
/* receive-completed message from a channel */
/* receive a FSK signal on a TD instance */
XMSG_TD_RCV_CMPLT,
XMSG_TD_RCV_FSK,
XMSG_TD_RCV_FSK_CMPLT, /* receive-completed message from TD instance */
XMSG_PLY_START,
XMSG_GET_JBSTAT,
/* start playing audio on a Player instance */
/* get jitter buffer statistics from Dec */
XMSG_GET_JBSTAT_CMPLT, /* response to the get-JB-statistics msg */
XMSG_PLY_CMPLT,
XMSG_END
/* play-completed message from Player */
/* end of list */
} XMsgType_t;
22
API Reference Manual
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Common Control Message
5.0
Common Control Message
This section defines the control messages that can be applied to all the resources.
5.1
Reset Message
Type
XMSG_RESET
Direction
Inbound
Description
Stops the current action and resets the resource to idle state.
typedef struct{
Format
XMsgHdr_t head;/* message header */
} XMsgReset_t;
#define XMSG_MAKE_RESET(pMsg, trans, res, inst) \
{\
Macro
XMSG_MAKE_HEAD(pMsg, trans, res, inst, sizeof(XMsgReset_t),\
XMSG_RESET, 0)\
}
•
•
General acknowledgement message (XMSG_ACK)
Response
Caution
Error message (XMSG_ERROR) if error.
Any intermediate results are discarded.
5.2
Start Message
Type
XMSG_Start
Direction
Inbound
Description
Generic start message. Starts the media-processing functions on a resource.
typedef struct{
Format
Macro
XMsgHdr_t head; /* message header */
} XMsgStart_t;
#define XMSG_MAKE_START(pMsg, trans, res, inst) \
{\
XMSG_MAKE_HEAD(pMsg, trans, res, inst, sizeof(XMsgStart_t),\
XMSG_START, 0)\
}
•
•
General acknowledgement message (XMSG_ACK)
Error message (XMSG_ERROR) if error.
Response
Caution
This message is not applicable to Tone Generator and Player resources.
API Reference Manual
23
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Common Control Message
5.3
Stop Message
Type
XMSG_STOP
Direction
Inbound
Description
Stops the current action.
typedef struct{
Format
XMsgHdr_t head; /* message header */
} XMsgStop_t;
#define XMSG_MAKE_STOP(pMsg, trans, res, inst)\
{\
Macro
XMSG_MAKE_HEAD(pMsg, trans, res, inst, sizeof(XMsgStop_t),\
XMSG_STOP, 0)\
}
Response
Resource returns the processing results or states, if any, depending on the resources and current actions.
5.4
Ping Message
Type
XMSG_PING
Direction
Inbound
Description
Verifies if the resource is alive.
typedef struct{
Format
XMsgHdr_t head; /* message header */
} XMsgPing_t;
#define XMSG_MAKE_PING(pMsg, trans, res, inst) \
{\
Macro
XMSG_MAKE_HEAD(pMsg, trans, res, inst, sizeof(XMsgPing_t),\
XMSG_PING, 0)\
}
•
•
General acknowledgement message (XMSG_ACK)
Error message (XMSG_ERROR) if error.
Response
5.5
Set-Parameter Message
Type
XMSG_SET_PARM (Sheet 1 of 2)
Direction
Inbound
Description
Sets a parameter to a resource.
24
API Reference Manual
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Common Control Message
Type
XMSG_SET_PARM (Sheet 2 of 2)
typedef struct{
XMsgHdr_t head;
/* message header */
Format
UINT16
UINT16
parmId; /* parameter id */
value; /* parameter value */
} XMsgSetParm_t;
#define XMSG_MAKE_SET_PARM(pMsg, trans, res, inst, id, val) \
{\
XMSG_MAKE_HEAD(pMsg, trans, res, inst, sizeof(XMsgSetParm_t),\
Macro
XMSG_SET_PARM, 0)\
((XMsgSetParm_t *)(pMsg))->parmId= id;\
((XMsgSetParm_t *)(pMsg))->value= val;\
}
•
•
General acknowledgement message (XMSG_ACK)
Error message (XMSG_ERROR) if error.
Response
5.6
Set-Multiple-Parameter Message
Type
XMSG_SET_MPARMS
Direction
Inbound
Description
Set multiple parameters to a resource
typedef struct{
XMsgHdr_t
UINT16
UINT16
head;
numParms;
parmIDs[XMAX_PARMS];
values[XMAX_PARMS];
/* message header */
/* number of parameters */
/* parameter id */
Format
UINT16
/* parameter value */
} XMsgSetxParms_t;
#define XMSG_MAKE_SET_MPARMS(pMsg, trans, res, inst, num) \
{\
XMSG_MAKE_HEAD(pMsg, trans, res, inst, sizeof(XMsgSetmParms_t),\
XMSG_SET_MPARMS, 0)\
((XMsgSetmParms_t *)(pMsg))->numParms = num; \
}
Macro
#define XMSG_FIELD_SET_MPARMS(pMsg, pIDs, pVals) \
{\
pIDs =
pVals =
((XMsgSetmParms_t *)(pMsg))->parmIDs;\
((XMsgSetmParms_t *)(pMsg))->values;\
}
•
General acknowledgement message (XMSG_ACK)
Error message (XMSG_ERROR) if error.
Response
•
API Reference Manual
25
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Common Control Message
5.7
Get-Parameter Message
Type
XMSG_GET_PARM
Direction
Inbound
Description
Gets a parameter from a resource.
typedef struct{
XMsgHdr_t
UINT16
head;
/* message header */
Format
parmId; /* parameter id */
} XMsgGetParm_t;
#define XMSG_MAKE_GET_PARM(pMsg, trans, res, inst, id) \
{\
XMSG_MAKE_HEAD(pMsg, trans, res, inst, sizeof(XMsgGetParm_t),\
XMSG_GET_PARM, 0)\
Macro
((XMsgGetParm_t *)(pMsg))->parmId= id;\
}
•
•
Specific acknowledgement message (XMSG_GET_PARM_ACK)
Error message (XMSG_ERROR) if error.
Response
5.8
Get-Parameter Acknowledge Message
Type
XMSG_GET_PARM_ACK
Direction
Outbound
Description
Resource returns the parameter enquired.
typedef struct{
XMsgHdr_t
UINT16
UINT16
head;
parmId;
value;
/* message header */
/* parameter id */
/* parameter value */
Format
Macro
} XMsgGetParmAck_t;
#define XMSG_FIELD_GET_PARM_ACK(pMsg, id, val)\
{\
id
val
= ((XMsgGetParmAck_t *)(pMsg))->parmId;\
= ((XMsgGetParmAck_t *)(pMsg))->value;\
}
5.9
Get-All-Parameters Message
Type
XMSG_GET_ALLPARMS
Direction
Inbound
Description
Gets all parameters from a resource.
26
API Reference Manual
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Common Control Message
Type
XMSG_GET_ALLPARMS
typedef struct{
Format
XMsgHdr_t head;
/* message header */
} XMsgGetAllParms_t;
#define XMSG_MAKE_GET_ALLPARMS(pMsg, trans, res, inst) \
{\
Macro
XMSG_MAKE_HEAD(pMsg, trans, res, inst, sizeof(XMsgGetAllParms_t),\
XMSG_GET_ALLPARMS, 0)\
}
Response
Specific acknowledgement message (XMSG_GET_ALLPARMS_ACK)
5.10
Get-All-Parameters Acknowledge Message
Type
XMSG_GET_ALLPARMS_ACK
Direction
Outbound
Description
Resource returns the parameter inquired.
typedef struct{
XMsgHdr_t
UINT16
UINT16
UINT16
} XMsgGetAllParmsAck_t;
head;
numParms;
parmIDs[XMAX_PARMS_GET];
values[XMAX_PARMS_GET];
/* message header */
/* number of parameters */
/* array of parameter IDs */
/* array of parameter values */
Format
Macro
#define XMSG_FIELD_GET_ALLPARMS_ACK(pMsg, num, pIDs, pVals)\
{\
num = ((XMsgGetAllParmsAck_t *)(pMsg))->numParms;\
pIDs = ((XMsgGetAllParmsAck_t *)(pMsg))->parmIDs;\
pVals = ((XMsgGetAllParmsAck_t *)(pMsg))->values;\
}
5.11
General-Acknowledge Message
Type
XMSG_ACK
Direction
Outbound
Description
Resource indicates the control message has been processed successfully.
typedef struct{
Format
XMsgHdr_t head;
} XMsgAck_t;
/* message header */
API Reference Manual
27
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Common Control Message
5.12
Error Message
Type
XMSG_ERROR
Direction
Outbound
Description
Resource reports an error condition. (See constant data section for error codes.)
typedef struct{
XMsgHdr_t
UINT32
UINT32
head;
code;
data1;
data2;
/* message header */
/* error code */
/* error data1 */
/* error data2 */
Format
UINT32
} XMsgError_t;
#define XMSG_FIELD_ERROR(pMsg, c, d1, d2)\
{\
c = ((XMsgError_t *)(pMsg))->code;\
d1 = ((XMsgError_t *)(pMsg))->data1;\
d2 = ((XMsgError_t *)(pMsg))->data2;\
}
Macro
5.13
Event Message
Type
XMSG_EVENT
Direction
Outbound
Description
Resource reports an event condition. (See constant data section for error codes.)
typedef struct{
XMsgHdr_t
UINT32
UINT32
head;
code;
data1;
data2;
/* message header */
/* event code */
/* event data1 */
/* event data2 */
Format
Macro
UINT32
} XMsgEvent_t;
#define XMSG_FIELD_EVENT(pMsg, c, d1, d2)\
{\
c = ((XMsgEvent_t *)(pMsg))->code;\
d1 = ((XMsgEvent_t *)(pMsg))->data1;\
d2 = ((XMsgEvent_t *)(pMsg))->data2;\
}
28
API Reference Manual
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Resource-Specific Control Messages
6.0
Resource-Specific Control Messages
This section defines the resource-specific messages.
6.1
CODEC Start Message
Type
XMSG_CODER_START
Direction
Inbound
Description
Format
Starts a decoder or encoder.
typedef struct{
XMsgHdr_t
UINT16
head;
codecType;
/* message header */
/* codec type */
UINT16
frmsPerPkt; /* number of frames per packet */
} XMsgCoderStart_t;
#define XMSG_MAKE_CODER_START(pMsg, trans, res, inst, cType, fpp)\
{\
XMSG_MAKE_HEAD(pMsg, trans, res, inst, sizeof(XMsgCoderStart_t),\
XMSG_CODER_START, 0)\
Macro
((XMsgCoderStart_t *)(pMsg))->codecType = cType;\
((XMsgCoderStart_t *)(pMsg))->frmsPerPkt = fpp;\
}
•
•
General acknowledgement message (XMSG_ACK)
Error message (XMSG_ERROR) if error.
Response
6.2
CODEC Stop-Acknowledgement Message
Type
XMSG_CODER_STOP_ACK
Direction
Outbound
Description
Decoder or encoder resource acknowledges the XMSG_STOPmessage
typedef struct{
XMsgHdr_t
UINT32
head;
numFrames;
/* message header */
/* total number of frames processed */
Format
Macro
UINT32
} XMsgCoderStopAck_t;
numBadFrames;
/* number of bad frames */
#define XMSG_FIELD_EVENT(pMsg, num, numBad)\
{\
num = ((XMsgCoderStopAck_t *)(pMsg))->numFrames;\
numBad = ((XMsgCoderStopAck_t *)(pMsg))->numBadFrames;\
}
API Reference Manual
29
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Resource-Specific Control Messages
6.3
Tone Generator Play Message
Type
Direction
XMSG_TG_PLAY
Inbound
Description Requires Tone Generator to play a tone string. (Tone ID’s are listed in the constant data section.)
typedef struct{
XMsgHdr_t
UINT8
head;
numTones;
/* message header */
/* number of tones to play */
Format
UINT8
toneId[XMAX_TONEBUFSIZE]; /* tone ID string */
} XMsgTGPlay_t;
#define XMSG_MAKE_TG_PLAY(pMsg, trans, inst, num)\
{\
XMSG_MAKE_HEAD(pMsg, trans, XMPR_TNGEN, inst, sizeof(XMsgTGPlay_t),\
XMSG_TG_PLAY, 0)\
((XMsgTGPlay_t *)(pMsg))->numTones = num;\
}
Macro
#define XMSG_FIELD_TG_PLAY(pMsg, pToneID) \
{\
pToneID= ((XMsgTGPlay_t *)(pMsg))->toneId;\
}
6.4
Tone Generator Play-FSK Message
Type
MSG_TG_PLAY_FSK
Direction
Inbound
Description Require Tone Generator to play a FSK modulated data
typedef struct{
XMsgHdr_t
UINT8
INT8
head;
numBytes;
data[XMAX_FSKDATASIZE];
/* message header */
/* number of bytes to play */
/* data string */
Format
} XMsgTGPlayFSK_t;
#define XMSG_MAKE_TG_PLAY_FSK(pMsg, trans, inst, num)\
{\
XMSG_MAKE_HEAD(pMsg, trans, XMPR_TNGEN, inst, sizeof(XMsgTGPlayFSK_t),\
XMSG_TG_PLAY_FSK, 0)\
((XMsgTGPlayFSK_t *)(pMsg))->numBytes = num;\
}
Macro
#define XMSG_FIELD_TG_PLAY_FSK(pMsg, pData) \
{\
pData= ((XMsgTGPlayFSK_t *)(pMsg))->data;\
}
Response
•
Tone Generator Play-Completed message (XMSG_TG_PLAY_CMPLT)
30
API Reference Manual
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Resource-Specific Control Messages
6.5
Tone Generator Play-Completed Message
Type
XMSG_TG_PLAY_CMPLT
Direction
Outbound
Description
Tone Generator indicates the completion of playing tones.
typedef struct{
XMsgHdr_t head;
UINT16 reason;
/* message header */
/* the reason of completion: */
/* XMSG_STOP_REASON_USER(1) */
/* XMSG_STOP_REASON_EOD(2) */
/* number of tones played. 0 if FSK data */
Format
UINT8
numTones;
} XMsgTGPlayCmplt_t;
#define XMSG_FIELD_TG_PLAY_CMPLT(pMsg, rsn, num)\
{\
Macro
reason
num
= ((XMsgTGPlayCmplt_t *)(pMsg))->reason;\
= ((XMsgTGPlayCmplt_t *)(pMsg))->numTones;\
}
6.6
Tone Detector Receive-Digit Message
Type
XMSG_TD_RCV
Direction
Inbound
Description
Require Tone Detector to receive a tone string.
typedef struct{
XMsgHdr_t head;
/* message header */
UINT16
UINT16
UINT16
totalTimeout;
/* total time out (in 10 ms unit) */
firstDigitTimeout; /* first digit time out (10 ms uint)*/
interDigitTimeout; /* inter digit time out (10 ms unit)*/
Format
UINT16
UINT8
termDigit;
numDigits;
/* OR'd terminate digit bits */
/* number of digits to receive */
} XMsgTDRcv_t;
#define XMSG_MAKE_TD_RCV(pMsg, trans, inst, num, term, tm, fstTm, intTm)\
{\
XMSG_MAKE_HEAD(pMsg, trans, XMPR_TNDET, inst,\
sizeof(XMsgTDRcv_t), XMSG_TD_RCV, 0)\
((XMsgTDRcv_t *)(pMsg))->numDigits = num;\
((XMsgTDRcv_t *)(pMsg))->termDigit = term;\
((XMsgTDRcv_t *)(pMsg))->totalTimeout = tm;\
((XMsgTDRcv_t *)(pMsg))->firstDigitTimeout = fstTm;\
((XMsgTDRcv_t *)(pMsg))->interDigitTimeout = intTm;\
}
Macro
Response
Tone detector receives completed message (XMSG_TD_RCV_CMPLT)
API Reference Manual
31
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Resource-Specific Control Messages
6.7
Tone Detector Receive-Completed Message
Type
XMSG_TD_RCV_CMPLT
Direction
Outbound
Description
Tone detector indicates the completion of receiving DTMF tones.
typedef struct{
XMsgHdr_t head;
/* message header */
UINT16
UINT8
UINT8
reason;
numDigits;
/* the reason of completion */
/* number of tones received */
digits[XMAX_DIGITBUFSIZE]; /* received tone IDs */
Format
} XMsgTDRcvCmplt_t;
where the reason may be:
#define XMSG_STOP_REASON_EOD
#define XMSG_STOP_REASON_TERM
#define XMSG_STOP_REASON_TIMEOUT
2
3
4
#define XMSG_FIELD_TD_RCV_CMPLT(pMsg, rsn, num, pBuf)\
{\
rsn = ((XMsgTDRcvCmplt_t *)(pMsg))->reason;\
num = ((XMsgTDRcvCmplt_t *)(pMsg))->numDigits;\
pBuf= ((XMsgTDRcvCmplt_t *)(pMsg))->digits;\
}
Macro
6.8
Tone Detector Receive-FSK Message
Type
MSG_TD_RCV_FSK
Direction
Inbound
Description
Require Tone Detector to receive FSK data
typedef struct{
XMsgHdr_t head;
/* message header */
/* total time out (in 10 ms unit) */
Format
UINT16
timeout;
} XMsgTDRcvFSK_t;
#define XMSG_MAKE_TD_RCV_FSK(pMsg, trans, inst, tmout)\
{\
XMSG_MAKE_HEAD(pMsg, trans, XMPR_TNDET, inst,\
sizeof(XMsgTDRcvFSK_t), XMSG_TD_RCV_FSK, 0)\
((XMsgTDRcvFSK_t *)(pMsg))->timeout = tmout;\
}
Macro
Response
Tone Detector FSK receive-completed message (XMSG_TD_RCV_FSK_CMPLT)
32
API Reference Manual
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Resource-Specific Control Messages
6.9
Tone Detector FSK-Receive-Completed Message
Type
XMSG_TD_RCV_FSK_CMPLT
Direction
Outbound
Description
Tone Detector indicates the completion of receiving FSK data
typedef struct{
XMsgHdr_t head;
/* message header */
UINT16
UINT8
UINT8
reason;
numBytes;
data[XMAX_FSKDATASIZE];
/* the reason of completion */
/* number of bytes received */
/* received data */
Format
} XMsgTDRcvFskCmplt_t;
where the reason may be:
#define XMSG_STOP_REASON_EOD
#define XMSG_STOP_REASON_TIMEOUT
2
4
#define XMSG_FIELD_TD_RCV_FSK_CMPLT(pMsg, rsn, num, pBuf)\
{\
rsn = ((XMsgTDRcvFskCmplt_t *)(pMsg))->reason;\
num = ((XMsgTDRcvFskCmplt_t *)(pMsg))->numBytes;\
pBuf= ((XMsgTDRcvFskCmplt_t *)(pMsg))->data;\
}
Macro
6.10
Player-Start Message
Type
XMSG_PLY_START (Sheet 1 of 2)
Direction
Inbound
Description
Start Player to play back pre-recorded audio data
API Reference Manual
33
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Resource-Specific Control Messages
Type
XMSG_PLY_START (Sheet 2 of 2)
typedef struct{
XMsgHdr_t
head;
/* message header */
XPlyMediaDesc_t mediaSeg[XMAX_PLY_SEG]; /* media segments to play */
UINT8
numSeg;
/* number of segments */
} XMsgPlyStart_t;
where the media segment data structure is defined as
typedef struct{
Format
INT32 offset;
INT32 length;
/* offset in byte where player starts */
/* length to play (in 10ms unit),
0 means playing till end of this segment*/
XMediaHandle_t handle; /* media storage handle */
INT16 next;
/* the relative index of next segment followed,
XPLY_MEDIA_SEG_EOP means end-of-play
at this segment */
} XPlyMediaDesc_t;
#define XMSG_MAKE_PLY_START(pMsg, trans, inst, num)\
{\
XMSG_MAKE_HEAD(pMsg, trans, XMPR_PLY, inst,\
sizeof(XMsgPlyStart_t), XMSG_PLY_START, 0)\
((XMsgPlyStart_t *)(pMsg))->numSeg = num;\
}
Macro
#define XMSG_FIELD_PLY_START(pMsg, pMedia) \
{\
pMedia = ((XMsgPlyStart_t *)(pMsg))->mediaSeg;\
}
Response
Player play-completed message (XMSG_PLY_CMPLT)
6.11
Player Play-Completed Message
Type
XMSG_PLY_CMPLT
Direction
Outbound
Description
Player indicates the completion of playing audio data.
typedef struct{
XMsgHdr_t head;
/* message header */
UINT16
reason;
/* the reason of completion */
} XMsgPlyCmplt_t;
Format
Macro
where the reason may be:
#define XMSG_STOP_REASON_USER
#define XMSG_STOP_REASON_EOD
1
2
#define XMSG_FIELD_PLY_CMPLT(pMsg, rsn)\
{\
rsn = ((XMsgPlyCmplt_t *)(pMsg))->reason;\
}
34
API Reference Manual
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Resource-Specific Control Messages
6.12
Get-Jitter-Buffer-Statistics Message
Type
XMSG_GET_JBSTAT
Direction
Inbound
Description
Format
Get the jitter buffer statistics from a Decoder instance.
typedef struct{
XMsgHdr_t head;
UINT16 reset;
/* message header */
/* reset flag, 1: reset statistics after
retrieve the information */
} XMsgGetJBStat_t;
#define XMSG_MAKE_GET_JBSTAT(pMsg, trans, inst, clr)\
{\
XMSG_MAKE_HEAD(pMsg, trans, XMPR_DEC, inst,\
sizeof(XMsgGetJBStat_t), XMSG_GET_JBSTAT, 0)\
((XMsgGetJBStat_t *)(pMsg))->reset = clr;\
}
Macro
Response
Complete message of getting jitter buffer statistics (XMSG_GET_JBSTAT_CMPLT)
6.13
Complete Message of Getting Jitter Buffer Statistics
Type
XMSG_GET_JBSTAT_CMPLT
Direction
Outbound
Description
Response to the message of getting the jitter buffer statistics.
typedef struct{
XMsgHdr_t
head; /* message header */
XJBStatistics_t
stat; /* jiter buffer statistics */
} XMsgGetJBStatCmplt_t;
where the XMsgGetJBStatCmplt_t date structure of jitter buffer statistics
is defined as
Format
typedef struct{
UINT32
UINT32
UINT32
UINT32
rcvdPackets;
lostPackets;
badFrames;
/* total packets received */
/* lost packets */
/* decoder bad frames */
/* RFC2833 packets received */
rcvdTonePackets;
} XJBStatistics_t;
#define XMSG_FIELD_GET_JBSTAT_CMPLT(pMsg, pStat)\
{\
Macro
pStat = &(((XMsgGetJBStatCmplt_t *)(pMsg))->stat);\
}
API Reference Manual
35
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Packet Data Interface
7.0
Packet Data Interface
®
The packet data interface is a protocol for the Intel IXP400 DSP Software to exchange the encoded
data packets with IP stack. This interface is defined as a packet format and two callback functions –
one is provided by DSP software release and another is provided by the user (IP stack).
7.1
Packet Formats
The ingress packet from the IP stack to the DSP software has an 8-byte header as shown below:
31
24 23 22
16 15
12 11
8
7
0
Channel ID
M
Payload Type
Media
Payload Length
Remote Time Stamp
:
Payload
:
Similarly, the egress packet from the DSP software to the IP stack has an 8-byte header as shown
below:
31
24 23 22
16 15
12 11
8
7
0
Channel ID
M
Payload Type
Media
Payload Length
Local Time Stamp
:
Payload
:
The fields of the packet header and the payload are described as:
Field
Description
Local Time Stamp
Remote Time Stamp
Payload Length
Packet arrival time as measured by a local clock.
Packet data sampling time measured by a remote clock.
Payload length in bytes.
4-bit media type field is defined as:
•
•
•
•
•
0x01 – Audio
0x02 – Tone (RFC 2833 event type)
0x04 – Tone (RFC 2833 tone type)
0x08 – T.38 UDP
Media
0x09 – T.38 TCP
Marker bit for the RTP packet. This bit set indicates the first speech packet after a
silence period or the first packet of a RFC-2833 tone event, otherwise 0.
M
Payload type
Payload
RTP payload type as defined in RFC 1990.
Encoded audio data or RFC-2838, tone-event information.
36
API Reference Manual
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Packet Data Interface
The corresponding data structure is defined as:
typedef struct{
UINT8
channelID;
/* channel ID */
UINT8
payloadType;
/* bit[0-6]payloadtype,bit[7] SID mark bit */
/* media type */
unsigned int mediaType:4;
unsigned int payloadLen:12;
/* payload length */
UINT32
timeStamp;
/* local or remote time stamp */
} __attribute__ ((packed)) XPacketHeader_t;
In ingress, the header information of Remote Time Stamp, Payload Type and Marker bit are directly
copied from a RTP packet. In egress, the header information is filled by DSP software except for the
Payload Type of RFC-2833 event packets. The RTP processing module is responsible to determine
the payload type if media type indicates a RFC-2833 tone-event packet.
7.2
Packet Delivery Mechanism
®
The packets are transferred between Intel IXP400 DSP Software and IP stack via the callback func-
tions. The packet delivery module calls the function and passes the packet each time when a packet
is produced. The rules of using the callback function to deliver the packets include:
• The packet receiver registers a callback function with the packet deliverer.
• The packet deliverer is responsible to prepare the memory for the packet.
• The packet receiver has to copy the data to its internal buffer immediately in the callback
function because the deliverer may reuse the same memory for the next packet (i.e., the packet
data may not be valid any more after the callback function returns).
• The packet receiver may perform some data processing in the callback function provided the
execution of such processing is predictable (i.e., the processing must be guaranteed to
complete within a certain short period of time).
The function that the DSP software receives the packets from the IP stack is provided as follows:
XStatus_t xPacketReceive (UNIT16 channel, XPacket_t *buffer);
Description
Input
Call-back function to receive packets.
Buffer– memory address of the packet
Channel– Channel numbers
Output
None
XSUCC– If successful
XERROR– If the packet receptor is unable to process the packet.
Return
IP stack has to build the data packets from the IP packets it received and deliver them to DSP soft-
ware by calling this function.
In egress direction, IP stack must provide a function to receive egress data packets. DSP software
will call the function each time when a packet generated. That function must be registered during
initialization as described in next section.
API Reference Manual
37
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Configuration and Initialization
8.0
Configuration and Initialization
®
The Intel IXP400 DSP Software is configurable at initialization time, allowing the user to specify
the HSS parameters, the number of resource instances to be created and the country-specific fea-
tures. The user-supplied call back functions are also registered at that time.
8.1
System Configuration
Prototype
void xDspSysInit(XDSPSysConfig_t *pSysConfig);
Input
pSysConfig– System configuration information
Output
Return
None
None
Description
This function performs the following procedures:
• Initialize and start HSS port
• Create TDM termination channels (i.e., Network Endpoint resource instance) and link them to
the HSS time slots sequentially. Error will occur if not enough time slots are enabled for all the
TDM channels
• Create the IP terminations (i.e., Decoder, Encoder, Tone Generator and Tone Detector
resources)
• Create media service resources (i.e., Player and Mixer)
• Enable country-specific call progress tones and set country-specific default parameters to the
resources
• Register user-supplied call back functions
38
API Reference Manual
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Configuration and Initialization
The configuration information in this function is defined as:
typedef struct{
int
int
int
int
int
int
int
int
numChTDM;
/* number of channels of TDM termination(1~4) */
/* number of channels of IP termination (1~4) */
/* number of Player instances (1~4) */
/* number of Audio Mixers (must be 1) */
/* number of ports per mixer (3~5) */
/* country code */
numChIP;
numPlayers;
numMixers;
numPortsPerMixer;
countryCode;
taskPriBase;
taskPriOrder;
/* the base priority of DSP module */
/* the priority ordering of the OS */
/* HSS port (must be Port 0) */
IxHssAccHssPort
port;
IxHssAccConfigParams *pHssCfgParms; /* HSS configuration parameters */
IxHssAccTdmSlotUsage *pHssTDMSlots; /* HSS TDM time slot mapping */
XDSPChanTdmSlots_t *pChanTsMap; /* channel vs. time slot mapping */
XPktRcvFxn_t
XMsgAgentDec_t
pktRcvFxn;
msgDecoder;
msgEncoder;
/* packet receiver function in egress */
/* optional message decoder function of MA */
/* optional message encoder function of MA */
XMsgAgentEnc_t
} XDSPSysConfig_t;
where:
typedef XStatus_t (*XPktRcvFxn_t)(UINT16 channel, void *pPacket);
typedef int (*XMsgAgentDec_t)(XMsgRef_t pUsrMsg, XMsgRef_t pNativeMsg, int sequenceNo);
typedef void (*XMsgAgentEnc_t)(XMsgRef_t pUsrReply, XMsgRef_t pNativeReply,
int sequenceNo, UINT8 usrMsgType);
The pChanTsMapfield is an array that specifies how the instances of Network Endpoint are linked
with the time slots of HSS. Each element of the array is defined as:
typedef struct{
int slotSample1;
int slotSample2;
/* time slot of the 1st sample */
/* time slot of the 2nd sample,
set to XCHAN_TDM_SLOT_NULL if narrowband */
} XDSPChanTdmSlots_t;
Assuming there are two channels – one wideband and one narrowband. The time slot locations for
the channels in a 32-slot frame are shown as:
0
1
2
...
16 17
...
31
...
...
2nd
WB
1st WB
sample
sample
API Reference Manual
39
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Configuration and Initialization
Then the array that describes such configuration is given as:
XDSPChanTdmSlots_t chanTsMapping[2] =
{
{0, 16},
/* channel 1 – WB, time slot 0 and 16 */
{2, XCHAN_TDM_SLOT_NULL} /* channel 2 – NB, time slot 2 */
};
If the pChanTsMapfield is given a NULLpointer, all the instances of Network Endpoint will be con-
figured to the narrowband mode and are linked to the active time slots sequentially.
Warning: This function must be called after downloading HSS NPE. An assertion occurs if any fatal errors
happen (e.g., memory exhausted) during the initialization. If the numbers of resources to be created
are not specified correctly, the default ones are applied, which can be retrieved by the
xDspGetResConfig() function.
8.2
Adding Tones to Tone Generator
XStatus_t xBuildToneTG(UINT16 toneId, UINT16 numSegs,
XTGToneSeg_t *pToneSegs, UINT32 *pErrCode);
Prototype
Input
• oneId— Tone ID, must be in the range of 16 ~ 255
• NumSegs — Number of segments of the tone
• pToneSegs — Array of tone segment definition
Output
Return
pErrCode – Error code if errors
• XSUCCif successful
•
Otherwise XERROR
Description
This function adds a new tone which can be played by the Tone Generator resources. Each new tone
can contains one or more segments which is defined as:
40
API Reference Manual
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Configuration and Initialization
typedef struct {
UINT16 repCount;
UINT16 segType;
/* repetition number of the segment. 0 means to repeat forever */
/* signal type (single or dual frequency wave or AM wave ) */
UINT32 durationOn; /* active duration in 1-ms unit. */
UINT32 durationOff;/* silence duration in 1-ms unit. */
INT16 freqA;
/* 1st frequency if single or dual frequency wave,
or the modulated carry frequency if AM wave, in 1Hz unit*/
/* 2nd frequency if dual frequency wave
INT16 freqB;
or the modulating frequency if AM wave,
ignored if single frequency wave */
INT16 ampA;
INT16 ampB;
/* amplitude of frequency A above, (0~ – 45 in 1dBm unit) */
/* amplitude of frequency B if dual frequency wave,
or modulation rate if AM wave (0~100 in 1% unit),
ignored if single frequency wave */
UINT16 mode;
INT16 nextSeg;
/* mode, overwrite or mix over the Decoder output */
/* the index of next segment relative to the current segement.
e.g., 1 means to go the following segment,
0 means repeat the current segment,
–2 means go back to previous 2 segments.
XTG_LASTSEG means end-of-tone */
} XTGToneSeg_t;
Warning: New tone definition must be added during the initialization after xDspSysInit(). The pre-
defined country-specific call progress tone will be overwritten if a new tone is added with the same
tone ID.
8.3
Adding Tones to Tone Detector
Status_t xBuildToneTD(UINT8 toneId, XTDToneInfo_t
*pToneInfo, UINT32 *pErrCode);
• toneId– Tone ID, must be in the range of 16 ~ 255
Prototype
Input
• pToneInfo — Tone detection criterion information
Output
Return
pErrCode – Error code if errors
• XSUCCif successful
•
Otherwise XERROR
Description
This function adds a criterion for the Tone Detector to detect a new tone. The criterion specify the
qualification ranges to a set of parameters defined as:
API Reference Manual
41
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Configuration and Initialization
/* segment data for tone detection template. */
typedef struct {
UINT16 type;
/* tone type (single or dual frequency tone) */
UINT16 criteria;
/* loose, medium or tight, use medium for normal
case, use loose to get higher detection probability
in poor SNR, use tight to get lower false
detection probability in good SNR */
UINT16 freqLowA;
UINT16 freqHighA;
UINT16 freqLowB;
UINT16 freqHighB;
/* low bound of the 1st frequency in Hz */
/* high bound of the 1st frequency in Hz */
/* low bound of the 2nd frequency in Hz */
/* high bound of the 2nd frequency in Hz */
/* low level of the 1st frequency in dBm */
/* high level of the 1st frequency in dBm
If both low and high are set to 0, the default
full range is applied */
INT16
INT16
ampLowA;
ampHighA;
INT16
INT16
ampLowB;
ampHighB;
/* low level of the 2nd frequency in dBm */
/* high level of the 2nd frequency in dBm,
If both low and high are set to 0, the default
full range is applied */
UINT8
attributes;
/* attribute (report the tone on, tone off or
both on/off) */
} XTDToneInfo_t;
Warning: New tone detection criterion must be added during the initialization before xDspSysInit().
8.4
Getting DSP Resource Configuration and Routing Information
Prototype
Input
void xDspGetResConfig(XDSPResConfig_t *pCfgInfo)
pCfgInfo – Pointer to DSP configuration data structure
The resource configuration and the assignment of the routing streams
None
Output
Return
Description
The user’s applications can call this function any time after xDspSysInit () to obtain the DSP
resource configuration and the stream IDs assigned to the T-Ports of each type of the resources. The
42
API Reference Manual
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Configuration and Initialization
data structure XDSPResConfig_tis defined as:
typedef struct{
int numChTDM;
int numChIP;
/* number of TDM termination channels */
/* number of IP termination channels */
/* number of player instances */
/* number of Audio Mixers */
int numPlayers;
int numMixers;
int numPortsPerMixer; /* number of ports per mixer */
int numStreams;
int streamBaseTDM;
int streamBaseIP;
int streamBasePly;
int streamBaseMix;
int countryCode;
/* number of total streams in the router */
/* T-Port stream ID of the first TMD termination channel */
/* T-Port stream ID of the first IP termination channel */
/* T-Port stream ID 1st port of the 1st Player instance */
/* T-Port stream ID of the first mixer port */
/* country code */
} XDSPResConfig_t;
The stream ID information is used for the application to connect the T-Ports and L-Ports of the re-
sources.
API Reference Manual
43
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Complementary Functions
9.0
Complementary Functions
9.1
Direct Parameter Access
The user’s applications can bypass the message and directly access the DSP parameters. This allows
quicker access without having to send a message and receive a response. All parameters can be di-
rectly read but only some of them can be directly modified. The functions to access the parameters
are:
XStatus_txDspParmRead(UINT8res,UINT16inst,UINT16parmId,
Prototype
UINT16 *pParmVal);
• res – DSP resource ID
• inst – Instance ID of the resource
• parmId – Parameter ID
Input
• pParmVal– Pointer to the variable that receives the returned parameter value
Output
Parameter value
• XSUCCif successful
Return
•
Otherwise XERROR
Description
This function retrieves the specified parameter value.
XStatus_t xDspParmWrite(UINT8 res, UINT16 inst,
Prototype
Input
UINT16 parmId, UINT16 parmVal, UINT32 transId);
• res – DSP resource ID
• inst– instaNce ID of the resource
• parmId – Parameter ID
• parmVal – Parameter value to be set
• transId – Transaction ID
Output
None
• XSUCCif successful
Return
•
Otherwise XERROR
Description
This function sets the value of the specified parameter.
9.2
Flash Hook Detection
Status_t xFlashHookDetect(UINT16 channel,
XHookState_t hookState, XUINT32 transId);
Prototype
Input
• channel – Channel number starting from 1
• hookState – Hook state, XHOOK_STATE_ON or XHOOK_STATE_OFF
• transId – Transaction ID
44
API Reference Manual
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Complementary Functions
Status_t xFlashHookDetect(UINT16 channel,
XHookState_t hookState, XUINT32 transId);
Prototype
Output
None
• XSUCCif successful
Return
•
Otherwise XERROR
This function is called by the SLIC driver to report the hook state changes via the event
message.
Description
If an on-hook transition followed by an off-hook one within the time specified by the
XPARMID_NET_FLASH_HK parameter, a flash hook event is reported.
The hook states are defined as:
typedef enum{
XHOOK_STATE_ON = 0,
XHOOK_STATE_OFF,
XHOOK_STATE_FLASH
}XHookState_t;
9.3
Cache Prompt Registration
Prototype
Input
XMediaHandle_t xDspRegCachePrompt(XCachePromptDesc_t *pDesc);
pDesc– The pointer to structure XCachePromptDesc_t.
None
Output
Return
XMediaHandle— Returns XMEDIA_HANDLE_NULL in the error case.
This function is called to register a cached prompt for playing at a later time.
XCachePromptDesc_tdescribes the data required to register a cached prompt.
Description
typedef struct{
UINT8 *pBuffer;
/* Pointer to the play buffer. */
size; /* The size of play buffer. */
INT32
XCoderType_t type; /* The type of data in play buffer.
The valid types are
XCODER_TYPE_G711MU_10MS,
XCODER_TYPE_G711A_10MS and
XCODER_TYPE_G729A */
} XCachePromptDesc_t;
API Reference Manual
45
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Complementary Functions
9.4
Get Version Number
Prototype
Input
char * xDspGetVersion(void );
None
Output
Return
None
Pointer to the version string.
This function returns a six-digit version string in ASCII format hard coded in each release
uniquely. The first two digits give the major version number, the 2 digits in the middle give the
minor number and the last two digits give the build number. Depending on each release, the
build number may indicate the release types like normal release, service package (SP), early
access release (EAR), etc. For example, the Intel® IXP400 DSP Software v2.5 EAR gives the
string 020501 and the production release has the string 020505.
Description
46
API Reference Manual
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Constant Data
10.0
Constant Data
This section lists up the definitions for constant data such as error codes and event codes.
10.1
Error Codes
Errors are reported via XMSG_ERRORmessage with an error code and two error data. The common
error codes are defined as:
#define XERR_SYSTEM
0x0001 /* system error */
#define XERR_HSSIF
0x0002 /* HSS interface error */
0x0003 /* memory error # */
#define XERR_MEMORY
#define XERR_INVALID_RES_ID
#define XERR_INVALID_CHAN_ID
#define XERR_INVALID_PARM_ID
0x0011 /* invalid resource id */
0x0012 /* invalid channel id */
0x0013 /* invalid parameter id */
#define XERR_INVALID_STREAM_ID 0x0014 /* invalid stream id */
#define XERR_PARM_READONLY
#define XERR_PARM_SET_FAIL
#define XERR_PARM_GET_FAIL
#define XERR_UNEXPECTED_MSG
#define XERR_UNSUPPORTED_MSG
#define XERR_ALGORITHM
0x0015 /* real only parameter */
0x0016 /* cannot set parameter */
0x0017 /* cannot get parameter */
0x0018 /* unexpected message */
0x0019 /* unsupported message */
0x0041 /* algorithm related error # */
0x00ff /* other errors */
#define XERR_OTHERS
The resource-specific error codes are defined as:
#define XERR_INVALID_CODE_TYPE
#define XERR_INVALID_FPP
0x401 /* invalid codec type */
0x402 /* invalid # frms per pkt */
0x403 /* invalid tone ID */
0x404 /* too many tone IDs */
0x405 /* too many FSK data */
0x406 /* too many digits */
0x407 /* resource is busy */
0x408 / * resource is idle */
0x409 /* deep recursive msg decoder*/
#define XERR_TG_INVALID_TONE_ID
#define XERR_TG_INVALID_TID_NUM
#define XERR_TG_INVALID_DATA_NUM
#define XERR_TD_INVALID_DIGIT_NUM
#define XERR_RESOURCE_BUSY
#define XERR_RESOURCE_IDLE
#define XERR_MA_DEEP_RECURSIVE
API Reference Manual
47
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Constant Data
10.2
Event Codes
Events are reported via XMSG_EVENT message with an event code and two event data. The resource
specific event codes are defined as:
#define XEVT_CODE_TD_TONEON
#define XEVT_CODE_TD_TONEOFF
#define XEVT_LOST_PACKET
#define XEVT_DEC_PACKET_CHNG
#define XEVT_NET_HOOK_STATE
#define XEVT_NET_TIMER
0x101
0x102
0x103
0x104
0x105
0x106
/* tone-on event */
/* tone-off event */
/* lost packet */
/* RTP payload type changed */
/* hook state change detected */
/* timer expired */
10.3
Tone IDs
The DTMF tone IDs used by the Tone Generator and Detector are defined as:
#define RFC_TID_DTMF_0
#define RFC_TID_DTMF_1
#define RFC_TID_DTMF_2
#define RFC_TID_DTMF_3
#define RFC_TID_DTMF_4
#define RFC_TID_DTMF_5
#define RFC_TID_DTMF_6
#define RFC_TID_DTMF_7
#define RFC_TID_DTMF_8
#define RFC_TID_DTMF_9
#define RFC_TID_DTMF_STAR
#define RFC_TID_DTMF_POUND
#define RFC_TID_DTMF_A
#define RFC_TID_DTMF_B
#define RFC_TID_DTMF_C
#define RFC_TID_DTMF_D
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Fax-tone IDs reported by the Tone Detector for fax bypass applications. Not supported by the Tone
Generator.
#define RFC_TID_FAX_CED
#define RFC_TID_FAX_CNG
#define RFC_TID_FAX_V21
32
36
40
48
API Reference Manual
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Constant Data
The general call-progress tone IDs used by the Tone Generator are defined as:
#define RFC_TID_DIAL
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#define RFC_TID_PBX_DIAL
#define RFC_TID_SP_DIAL
#define RFC_TID_2ND_DIAL
#define RFC_TID_RING
#define RFC_TID_SP_RING
#define RFC_TID_BUSY
#define RFC_TID_CONGESTION
#define RFC_TID_SP_INFO
#define RFC_TID_COMFORT
#define RFC_TID_HOLD
#define RFC_TID_REC
#define RFC_TID_CALLER_WT
#define RFC_TID_CALL_WT
#define RFC_TID_PAY
#define RFC_TID_POS_IND
#define RFC_TID_NEG_IND
#define RFC_TID_WARNING
#define RFC_TID_INSTRUSION
#define RFC_TID_CAL_CARD
#define RFC_TID_PAYPHONE
Currently only the following specific call progress tones are supported for tone generation:
• China (People’s Republic of China)
• Japan
• United States
Japan Call-Progress Tones
#define COUNTRY_CODE_JP
#define NTT_TID_DT
#define NTT_TID_RBT
#define NTT_TID_BT
#define NTT_TID_PDT
#define NTT_TID_SDT
#define NTT_TID_CPT
#define NTT_TID_HST
#define NTT_TID_IIT
#define NTT_TID_SIIT
#define NTT_TID_HOW
81
/* country code for Japan */
/* dial tone */
RFC_TID_DIAL
RFC_TID_RING
RFC_TID_BUSY
RFC_TID_PBX_DIAL
RFC_TID_2ND_DIAL
RFC_TID_POS_IND
RFC_TID_HOLD
RFC_TID_CALL_WT
110
/* ring back tone */
/* busy tone */
/* private dial tone */
/* 2nd dial tone */
/* acceptance tone */
/* hold service tone */
/* incoming id tone */
/* special incoming id tone */
RFC_TID_OFFHK_WARN /* howler tone */
API Reference Manual
49
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Constant Data
United States Call-Progress Tones
#define COUNTRY_CODE_US
#define US_TID_DIAL
#define US_TID_RING
#define US_TID_BUSY
#define US_TID_RC_DIAL
#define US_TID_PBX_DIAL
1
/* US country code */
/* dial tone */
RFC_TID_DIAL
RFC_TID_RING
RFC_TID_BUSY
/* ring back tone */
/* busy tone */
RFC_TID_SP_DIAL /* recall dial tone */
RFC_TID_PBX_DIAL /* PBX dial tone */
#define US_TID_CONGESTION RFC_TID_CONGESTION /* congestion tone */
#define US_TID_CALL_WT RFC_TID_CALL_WT /* call waiting tone */
#define US_TID_WARN_OPER 110
/* operator intervening tone */
China Call-Progress Tones
#define COUNTRY_CODE_PRC
#define PRC_TID_DIAL
86
/* China country code */
/* dial tone */
RFC_TID_DIAL
RFC_TID_RING
RFC_TID_BUSY
RFC_TID_SP_DIAL
#define PRC_TID_RING
/* ring back tone */
/* busy tone */
#define PRC_TID_BUSY
#define PRC_TID_SP_DIAL
#define PRC_TID_CONGESTION
/* special dial tone */
RFC_TID_CONGESTION /* congestion tone */
#define PRC_TID_UNAVAILABLE RFC_TID_UNAVAILABLE /* unavailable tone */
#define PRC_TID_TOLL
RFC_TID_COMFORT
RFC_TID_QUEUE
/* long distance tone */
/* queue tone */
#define PRC_TID_QUEUE
#define PRC_TID_CALL_WT
#define PRC_TID_THR_PARTY
RFC_TID_CALL_WT
RFC_TID_THR_PARTY
/* call waiting tone */
/* 3 party remind tone */
#define PRC_TID_CONFIRMATION RFC_TID_CONFIRMATION /* confirmation tone */
#define PRC_TID_OFFHK_WARN RFC_TID_OFFHK_WARN /* howler tone */
50
API Reference Manual
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Constant Data
10.4
Other Constants
The coder types used in the XPARMID_DEC_CTYPEand XPARMID_ENC_CTYPEparameters and
the XMSG_CODER_STARTmessage are defined as:
typedef enum{
XCODER_TYPE_PASSTHRU = 0,
XCODER_TYPE_G711MU_10MS,
XCODER_TYPE_G711A_10MS,
XCODER_TYPE_G729A,
XCODER_TYPE_G723,
XCODER_TYPE_G722,
XCODER_TYPE_G726_40,
XCODER_TYPE_G726_32,
XCODER_TYPE_G726_24,
XCODER_TYPE_G726_16,
XCODER_TYPE_G729 = 17,
XCODER_TYPE_UNDEF = -1
} XCoderType_t;
Mask bits used to specify the coder type subset in Decoder auto-switch parameter are defined as:
#define XPARM_DEC_AUTOSW_OFF
#define XPARM_DEC_AUTOSW_G711MU
#define XPARM_DEC_AUTOSW_G711A
#define XPARM_DEC_AUTOSW_G729A
#define XPARM_DEC_AUTOSW_G723
#define XPARM_DEC_AUTOSW_G722
#define XPARM_DEC_AUTOSW_G726_40
#define XPARM_DEC_AUTOSW_G726_32
#define XPARM_DEC_AUTOSW_G726_24
#define XPARM_DEC_AUTOSW_G726_16
#define XPARM_DEC_AUTOSW_ALL
0x0000
0x0001
0x0002
0x0004
0x0008
0x0010
0x0020
0x0040
0x0080
0x0100
0xffff
API Reference Manual
51
®
Intel IXP400 Digital Signal Processing (DSP) Software Version 2.5
Constant Data
Mask bits used to specify the termination digits in the XMSG_TD_RCVmessage are defined as:
#define XTD_TERM_DIGIT_NONE
#define XTD_TERM_DIGIT_0
#define XTD_TERM_DIGIT_1
#define XTD_TERM_DIGIT_2
#define XTD_TERM_DIGIT_3
#define XTD_TERM_DIGIT_4
#define XTD_TERM_DIGIT_5
#define XTD_TERM_DIGIT_6
#define XTD_TERM_DIGIT_7
#define XTD_TERM_DIGIT_8
#define XTD_TERM_DIGIT_9
#define XTD_TERM_DIGIT_STAR
#define XTD_TERM_DIGIT_POUND
#define XTD_TERM_DIGIT_A
#define XTD_TERM_DIGIT_B
#define XTD_TERM_DIGIT_C
#define XTD_TERM_DIGIT_D
0x0000
0x0001
0x0002
0x0004
0x0008
0x0010
0x0020
0x0040
0x0080
0x0100
0x0200
0x0400
0x0800
0x1000
0x2000
0x4000
0x8000
The stop-reasons in the XMSG_TG_PLAY_CMPLT, XMSG_TD_RCV_CMPLT,
XMSG_TD_RCV_FSK_CMPLT, and XMSG_PLY_CMPLTmessages are defined as:
#define XMSG_STOP_REASON_USER
#define XMSG_STOP_REASON_EOD
#define XMSG_STOP_REASON_TERM
1
2
3
/* stopped by XMSG_STOP message */
/* end of data */
/* stopped by the terminate digits */
/* time out */
#define XMSG_STOP_REASON_TIMEOUT 4
52
API Reference Manual
|