Intel IXP400 User Manual

Intel® IXP400 Digital Signal Processing (DSP) Software Version 2.5
API Reference Manual
December 2004
Document Number: 273811-007a
INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL® PRODUCTS. EXCEPT AS PROVIDED IN INTEL'S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY RELATING TO SALE AND/OR USE OF INTEL PRODUCTS, INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT, OR OTHER INTELLECTUAL PROPERTY RIGHT.
Intel Corporation may have patents or pending patent applications, trademarks, copyrights, or other intellectual property rights that relate to the presented subject matter. The furnishing of documents and other materials and information does not provide any license, express or implied, by estoppel or otherwise, to any such patents, trademarks, copyrights, or other intellectual property rights.
Intel products are not intended for use in medical, life saving, life sustaining, critical control or safety systems, or in nuclear facility applications. Intel may make changes to specifications and product descriptions at any time, without notice. Designers must not rely on the absence or characteristics of any features or instructions marked “reserved” or “un defined.” Intel reserves these for
future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. Contact your local Intel sales office or your distributor to obtain the latest specifications and before placing your produ ct order. Copies of documents which have an ordering number and are referenced in this document, or other Intel literature may be obtained by calling
1-800-548-4725 or by visiting Intel's website at http://www.intel.com. BunnyPeople, Celeron, Chips, Dialogic, EtherExpress, ETOX, FlashFile, i386, i486, i960, iCOMP, InstantIP, Intel, Intel Centrino, Intel Centrino logo,
Intel logo, Intel386, Intel486, Intel740, IntelDX2, IntelDX4, IntelSX2, Intel Inside, Intel Inside logo, Intel NetBurst, Intel NetMerge, Intel NetStructure, Intel SingleDriver, Intel SpeedStep, Intel StrataFlash, Intel Xeon, Intel XScale, IPLink, Itanium, MCS, MMX, MMX logo, Optimizer logo, OverDrive, Paragon, PDCharm, Pentium, Pentium II Xeon, Pentium III Xeon, Performance at Your Command, Sound Mark, The Computer Inside, The Journey Inside, VTune, and Xircom are trademarks or registe r ed trademarks of Intel Corporation or its subsidiaries in the United States and other countries.
Copyright © Intel Corporation, 2004 *Other names and brands may be claimed as the property of others.
Intel® IXP400 Digital Signal Processing (DSP) Software Version 2. 5

Contents

1.0 Introduction............................................................................................................ 7
1.1 General............................................................................................................ 7
1.2 Scope.............................................................................................................. 7
1.3 Audience ......................................................................................................... 7
1.4 Acronyms ........................................................................................................ 7
2.0 Architectural Overview...................................................................................... 9
3.0 Media Processing Resource Components.............................................. 10
3.1 Network Endpoint Resource Component............................ ... ....................... 10
3.2 Decoder Resource Component..................................................................... 11
3.3 Encoder Resource Component..................................................................... 13
3.4 Tone Generation Resource Component ....................................................... 15
3.5 Tone Detection Resource Component.......................................................... 16
3.6 Audio Player Resource Component.............................................................. 17
3.7 Audio Mixer Resource Component ............................................................... 17
3.8 T.38 Fax Resource Component.................................................................... 18
3.9 Message Agent Resource Component ......................................................... 19
4.0 Message Format and Delivery Mechanism.............................................. 20
4.1 Message Functions......... ....................................... ....................................... 20
4.2 Message Header Format............................................................................... 21
4.3 Message Type List. ... ... ....................................... ...................................... .... 22
5.0 Common Control Message............................................................................. 23
5.1 Reset Message ............................................................................................. 23
5.2 Start Message.... .... ...................................... ....................................... .......... 23
5.3 Stop Message ..................................... ...................................... .................... 24
5.4 Ping Message................................................................................................ 24
5.5 Set-Parameter Message ............................................................................... 24
5.6 Set-Multiple-Parameter Message.................................................................. 25
5.7 Get-Parameter Message............................................................................... 26
5.8 Get-Parameter Acknowledge Message......................................................... 26
5.9 Get-All-Parameters Message........................................................................ 26
5.10 Get-All-Parameters Acknowledge Message.................................................. 27
5.11 General-Acknowledge Message ................................................................... 27
5.12 Error Message............................................................................................... 28
5.13 Event Message................... .... ... ... ... .... ... ... ....................................... ............. 28
6.0 Resource-Specific Control Messages....................................................... 29
6.1 CODEC Start Message................................................................................. 29
6.2 CODEC Stop-Acknowledgement Message................................................... 29
6.3 Tone Generator Play Message ..................................................................... 30
6.4 Tone Generator Play-FSK Message ............................................................. 30
6.5 Tone Generator Play-Completed Message................................................... 31
6.6 Tone Detector Receive-Digit Message.......................................................... 31
6.7 Tone Detector Receive-Completed Message ............................................... 32
API Reference Manual 3
Intel® IXP400 Digital Signal Processing (DSP) Software Version 2.5
6.8 Tone Detector Receive-FSK Message...........................................................32
6.9 Tone Detector FSK-Receive-Completed Message........................................33
6.10 Player-Start Message.....................................................................................33
6.11 Player Play-Completed Message.................... .... ... ... ... ... .... ... ... ... .... ...... ... ... ..34
6.12 Get-Jitter-Buffer-Statistics Message ..............................................................35
6.13 Complete Message of Getting Jitter Buffer Statistics.....................................35
7.0 Packet Data Interface.........................................................................................36
7.1 Packet Formats......................... ... ... ... ....................................... .....................36
7.2 Packet Delivery Mechanism............... .... ... ... ... ....................................... ........37
8.0 Configuration and Initialization.....................................................................38
8.1 System Configuration.....................................................................................38
8.2 Adding Tones to Tone Generator...................................................................40
8.3 Adding Tones to Tone Detector .....................................................................41
8.4 Getting DSP Resource Configuration and Routing Information................ ... ..42
9.0 Complementary Functions..............................................................................44
9.1 Direct Parameter Access ...............................................................................44
9.2 Flash Hook Detection.....................................................................................44
9.3 Cache Prompt Registration............................................................................45
9.4 Get Version Number ......................................................................................46
10.0 Constant Data.......................................................................................................47
10.1 Error Codes.................. ... ... ... .... ... ... ....................................... ........................47
10.2 Event Codes...................................................................................................48
10.3 Tone IDs.........................................................................................................48
10.4 Other Constants.............................................................................................51

Figures

1 Architecture of Intel® IXP400 DSP Software v2.5............................................9
2 Resource Component Identifiers....................................................................10

Tables

None.

Revision History

Date Revision Description
December 2004 008 Updated product branding.
September 2004 007
June 2004 006 Updates for the release of Intel
January 2004 005
September 2003 004
September 2003 003
March 2003 002
January 2003 001 First release of this document.
Intel® IXP400 Digital Signal Processing (DSP) Software Version 2. 5
®
Further updates for the release of Intel v2.5. Change bars indicate areas of change.
Updates for the release of Intel Version 2.4.
Clarified input for XStatus_t xMsgReceive message function.
Updates for the release of Intel Version 2.3
Added minor updates to represent features of Intel DSP Software Version 1.1.
IXP400 DSP Software
®
IXP400 DSP Software v2.5.
®
IXP400 DSP Software
®
IXP400 DSP Software
®
IXP400
API Reference Manual 5
Intel® IXP400 Digital Signal Processing (DSP) Software Version 2.5
This page intentionally left blank.
Intel® IXP400 Digital Signal Processing (DSP) Software Version 2. 5

1.0 Introduction

The Intel® IXP400 DSP Software v2.5 is a software module that provides the basic voice processing functionalities for V oIP 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.
Introduction

1.2 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.

1.3 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 Automatic Gain Control for voice data towards IP network ALC Automatic Level Control CPE Consumer Premise Equipment EC Echo Cancellation FSK Frequency Shift Keying IP Internet Protocol ISR Interrupt Service Routine
API Reference Manual 7
Intel® IXP400 Digital Signal Processing (DSP) Software Version 2.5
Introduction
NLP Non-linear Processing (for EC) SP Signal Processing VAD Voice Activity Detection
8 API Reference Manual
Intel® IXP400 Digital Signal Processing (DSP) Software Version 2. 5

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 streams are processed by appropriate algorithms. Figure 1 shows the architecture of the module.
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
Control
Messages
Intel® IXP400 DSP
Software Control Interface
Replies and
Events
Architectural Overview
User-Defined
Control
Messages
and Replies
User-Defined
Control Interface
Network
Endpoint
SLIC
Interface
Common Control Logic and
Generic Control Engine
Decoder Encoder
PCM Data
Interface
Sync
PCM
Data
Tone
Generator
Data-Processing
Algorithms and
Components
Real-Time Execution Environment
Tone
Detector
Encoded
Packets
Audio
Player
Message
Agent
Packet
Interface
Audio Mixer
T.38
Control Layer
Data Processing Layer
IP
Stack
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

As shown in Figure 1, the addressable control entities of Intel® IXP400 DSP Software are media 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 serv er 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, /* any resource, not currently supported */ XMPR_NET, /* Network Endpoint resource */ XMPR_DEC, /* Decoder resource */ XMPR_ENC, /* Encoder resource */ XMPR_TNGEN, /* Tone generator resource */ XMPR_TNDET, /* Tone detector resource */ XMPR_PLY, /* Audio player resource */ XMPR_MIX, /* Audio mixer resource */
XMPR_T38, /* T38 IP fax resource */
XMPR_MA /* Message Agent resource */
} 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
Parameters
Intel® IXP400 Digital Signal Processing (DSP) Software Version 2. 5
Media Processing Resource Components
Identifier Description, Values Attr.
XPARMID_RES_STATE Current state (0: idle, 1: active) R N XPARMID_NET_LP_STREAM
XPARMID_NET_LAW
XPARMID_NET_ECENABLE
XPARMID_NET_ECTAIL
XPARMID_NET_ECNLP
XPARMID_NET_ECFREEZE
XPARMID_NET_DELAYCOMP
XPARMID_NET_FLASH_HK
XPARMID_NET_TIMER
XPARMID_NET_GAIN_RX
XPARMID_NET_GAIN_TX
XPARMID_NET_HSS_BYPASS
The L-Port stream ID. Default: the stream assigned to the IP termination’s T­Port of the same channel if exist, otherwise –1.
PCM data format on HSS TDM bus. XPARM_NET_ALAW or
XPARM_NET_MULAW.
XPARM_NET_MULAW
Default: EC enabling flag,
XPARM_ON
Default: 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_ON or XPARM_OFF.
XPARM_OFF, XPARM_EC_NLP_ON or
XPARM_EC_NLP_SUP_ON.
XPARM_OFF
Default: EC freezing flag,
Typically, freeze is used only in debug situations. Default: 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 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
Output gain of HSS interface (+15 ~ –40 in 1-dB units) Default: 0
TDM short bypass flag, connection made within NPE between the corresponding time slots if enabled. Do not enable it in wideband mode.
XPARM_OFF
Default:
XPARM_ON (freeze) or XPARM_OFF (adaptive).
XPARM_OFF
XPARM_ON or XPARM_OFF. The low latency
Direct
Write
R/W N
R/W N
R/W Y
R/W N
R/W N
R/W N
R/W Y
R/W Y
R/W Y
R/W N
R/W N
R/W N
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
Identifier Description and Values Attr.
XPARMID_RES_STATE Current state (0: idle, 1: active) R N
XPARMID_DEC_VOL
XPARMID_DEC_ALC
XPARMID_DEC_CNG
Decoder volume adjustment; +15 ~ -40 in 1-dB units. Default: 0 (Set to -99 to mute)
ALC enable flag.
XPARM_ON
Default: CNG enable flag.
XPARM_ON or XPARM_OFF.
XPARM_ON or XPARM_OFF. Default:
XPARM_OFF
Coder type. Currently supported types are
R/W N
R/W N
R/W Y
Direct
Write
XCODER_TYPE_G711MU_10MS, XCODER_TYPE_G711A_10MS, XCODER_TYPE_G729A or XCODE_TYPE_G723, XCODER_TYPE_G722,
XPARMID_DEC_CTYPE
XCODER_TYPE_G726_40, XCODER_TYPE_G726_32,
R/W N
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
XPARMID_DEC_EVT_PKT
XPARMID_DEC_EVT_PKTCHNG
XPARMID_DEC_AUTOSW
XPARMID_DEC_JB_MAXDLY
XPARMID_DEC_JB_PLR
provide packets to the decoder.
XPARM_OFF
Default: Report RTP payload type change.
XPARM_OFF.
XPARM_ON.
Default: Auto-Switch mask bits. This specifies which coder types are
allowed to be auto-switched based on input RTP payload type.
XPARM_DEC_AUTOSW_ALL
Default: Jitter buffer maximum delay (0 ~ 500 in 1-ms units).
Default: 200. Jitter buffer packet loss rate in 0.1% units.
Default: 1
XPARM_ON or XPARM_OFF.
XPARM_ON or
R/W Y
R/W Y
R/W Y
R/W N
R/W N
12 API Reference Manual
Intel® IXP400 Digital Signal Processing (DSP) Software Version 2. 5
Media Processing Resource Components
Identifier Description and Values Attr.
XPARMID_DEC_G726_40_RTP_PLD
XPARMID_DEC_G726_32_RTP_PLD
XPARMID_DEC_G726_24_RTP_PLD
XPARMID_DEC_G726_16_RTP_PLD
XPARMID_DEC_G726_PACK
Events
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. 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. 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 3551 format, or format.
Default:
XPARM_G726_PACK_MSB for I.366.2 Annex E
XPARM_G726_PACK_LSB
XPARM_G726_PACK_LSB for RFC
Direct
Write
R/W Y
R/W Y
R/W Y
R/W Y
R/W N
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
Identifier Description and values Attr.
XPARMID_RES_STATE Current state (0: idle, 1: active) R N XPARMID_ENC_LP_STREAM
XPARMID_ENC_AGC
XPARMID_ENC_VAD
L-Port stream ID. Default: the stream assigned to the TDM termination’s T-Port of the same channel if exist, otherwise –1.
AGC enable flag.
XPARM_OFF
Default: VAD enable flag.
XPARM_OFF
Default: Coder type. Currently supported types are
XPARM_ON or XPARM_OFF.
XPARM_ON or XPARM_OFF.
Direct
Write
R/W N
R/W N
R/W N
XCODER_TYPE_G711MU_10MS, XCODER_TYPE_G711A_10MS, XCODER_TYPE_G729A or XCODE_TYPE_G723, XCODER_TYPE_G722,XCODER_TYPE_G726_40,
XPARMID_ENC_CTYPE
XCODER_TYPE_G726_32,
R/W N
XCODER_TYPE_G726_24, XCODER_TYPE_G726_16,
and XCODER_TYPE_G729.
XCODER_TYPE_G711MU_10MS
Default: Number of frames per packet. Supported range is 1~6 for G.711 and
XPARMID_ENC_MFPP
XPARMID_ENC_EVT_PKT
XPARMID_ENC_G726_40_RTP_PLD
XPARMID_ENC_G726_32_RTP_PLD
XPARMID_ENC_G726_24_RTP_PLD
XPARMID_ENC_G726_16_RTP_PLD
G.722, 1~8 for G.723, 1~9 for G.726 40 Kbps, 1~12 for G.726 32Kbps, 1~16 for G.726 24 Kbps, and 1~24 for G.729 and G.726 16 Kbps.
Default: 1. Enable packet lost event.
Default: XPARM_OFF 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. 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.
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
XPARM_ON or XPARM_OFF.
R/W N
R/W Y
R/W Y
R/W Y
R/W Y
R/W Y
XPARMID_ENC_G726_PACK
XPARMID_ENC_VOL
G.726 packing format. Set to format, or
Default: Encoder gain adjustment, +15 ~ – 40 in 1-dB units.
Default: 0 (Set to -99 to mute)
XPARM_G726_PACK_MSB for I.366.2 Annex E format.
XPARM_G726_PACK_LSB
XPARM_G726_PACK_LSB for RFC 3551
R/W N
R/W N
Events
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
Identifier Description and values Attr.
XPARMID_RES_STATE Current state (0: idle, 1: active) R N
XPARMID_TNGEN_VOL
XPARMID_TNGEN_FSK_MOD
XPARMID_TNGEN_FSK_CS
Tone Generator’s volume adjustment, +15 ~ –20 in 1-dB units. Default: 0
FSK modulator mode.
XPARM_TNGEN_FSK_B202.
XPARM_TNGEN_FSK_B202 if country code set to
Default:
COUNTRY_CODE_US or COUNTRY_CODE_PRC, otherwise XPARM_TNGEN_FSK_V23
CS bit length of FSK modulator (in bit unit). Default: 300 if country code set to
XPARM_TNGEN_FSK_V23 or
COUNTRY_CODE_US or
R/W N
R/W Y
R/W Y
Direct
Write
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_US or
R/W Y
COUNTRY_CODE_PRC, otherwise 100.
FSK modulator baud rate (XPARM_TNGEN_FSK_R1200,
XPARMID_TNGEN_FSK_RATE
XPARMID_TNGEN_FSK_POSTMK
XPARMID_TNGEN_RFC2833
XPARM_TNGEN_FSK_R600, XPARM_TNGEN_FSK_R300, XPARM_TNGEN_FSK_R150 or XPARM_TNGEN_FSK_R75).
XPARM_TNGEN_FSK_R1200, i.e., 1200 bps
Default: Postmark bit length of FSK modulator (in bit unit)
Default: 72 RFC2833 enable flag.
XPARM_ON
Default:
XPARM_ON or XPARM_OFF.
R/W N
R/W Y
R/W N
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
Identifier Description and values Attr.
XPARMID_RES_STATE Current state (0: idle, 1: active) R N XPARMID_TD_LP_STREAM
XPARMID_TD_TC
XPARMID_TD_TC_FRAMES
L-Port stream ID. Default: the stream assigned to the DTM termination’s T-Port of the same channel if exist, otherwise –1.
Tone Clamping enable flag. Default:
XPARM_OFF
Tone Clamping buffer size. 0 ~ 3 in 10 ms unit. Default: 3
Tone event enable flag.
XPARM_ON or XPARM_OFF.
XPARM_OFF,
Direct
Write
R/W N
R/W Y
R/W N
XPARM_TD_RPT_TONE_ON,
XPARMID_TD_RPT_EVENTS
XPARMID_TD_RFC2833E_ENABLE
XPARMID_TD_RFC2833E_UPDATERATE
XPARMID_TD_RFC2833E_NUMEOE
XPARMID_TD_RFC2833E_NUMBOE
XPARMID_TD_RFC2833E_AUDIOSUPRESS
XPARMID_TD_RFC2833E_PAYLOADTYPE
XPARM_TD_RPT_TONE_OFF or XPARM_TD_RPT_TONE_ON_OFF.
XPARM_OFF
Default: RFC2833 event enable flag.
XPARM_OFF
Default: RFC 2833 packet rate in 10-ms units, i.e., the period between
the packets generated when a tone event is detected. Default: 5
Redundancy of end-of-event packet. Range 0-255. Default: 3
Redundancy of begin-of-event packet. Range 0-255. Default: 0
Flag of audio encoding suppression when event detected.
XPARM_ON or XPARM_OFF.
XPARM_ON or XPARM_OFF.
XPARM_ON
Default: RFC 2833 Payload type, Range is in the RTP dynamic payload
type range of 96 to 127. Default: 0x65.
R/W Y
R/W Y
R/W N
R/W Y
R/W Y
R/W N
R/W Y
16 API Reference Manual
Intel® IXP400 Digital Signal Processing (DSP) Software Version 2. 5
Media Processing Resource Components
Identifier Description and values Attr.
XPARMID_TD_FSK_CS
Minimum CS-bit length required by FSK receiver. Default: 200 if country code set to COUNTRY_CODE_US or
COUNTRY_CODE_PRC, otherwise 0.
XPARMID_TD_FSK_MARK
Minimum mark-bit length required by FSK receiver. Default: 100 if country code set to
COUNTRY_CODE_US or
COUNTRY_CODE_PRC, otherwise 60.
XPARMID_TD_FSK_STOP
XPARMID_TD_FSK_RATE
Extra stop bits allowed between data. Default: 20
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
data1 gives the tone ID and data2 gives the time stamp in 10-ms units.

3.6 Audio Player Resource Component

Resource Type: XMPR_PLY
Direct
Write
R/W Y
R/W Y
R/W Y
R/W Y
Media Processing Functions
Play back recorded audio data.
Resource-Specific Control Messages
XMSG_PLY_START (inbound)
XMSG_PLY_CMPLT (outbound)
Parameters
Identifier Description and values Attr.
XPARMID_RES_STATE Current state (0: idle, 1: active) R N XPARMID_PLY_VOL Volume adjustment (+15 ~ –30 in 1dB unit), Default: 0 R/W N
Events
None.

3.7 Audio Mixer Resource Component

Direct
Write
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
Identifier Description and values Attr.
XPARMID_RES_STATE Current state (0: idle, 1: active) R N XPARMID_MIX_LP_STREAM The first L-Port stream ID. Default: –1 R/W N XPARMID_MIX_LP_STREAM+1 The 2nd L-Port stream ID. Default: –1 R/W N XPARMID_MIX_LP_STREAM+n-1 The nth L-Port stream ID. Default: –1 R/W N
Direct
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.
Write
Parameters
Identifier Description and Values Attr.
XPARMID_RES_STATE Current state (0: idle, 1: active) R N
XPARMID_T38_ELLIPSIS
XPARMID_T38_FEC
XPARMID_T38_REDUNDANCY
Flag of enabling ellipsis.
XPARM_OFF
Default: Flag of enabling FEC.
XPARM_OFF
Default: Redundancy level, (0 ~ 7)
Default: 0
XPARM_ON or XPARM_OFF.
XPARM_ON or XPARM_OFF.
R/W N
R/W N
R/W N
18 API Reference Manual
Direct
Write
Intel® IXP400 Digital Signal Processing (DSP) Software Version 2. 5
Media Processing Resource Components
Identifier Description and Values Attr.
Method of modem rate negotiation.
XPARM_T38_RATE_NEG_LOCAL or
XPARMID_T38_RATE_NEG
XPARAID_T38_TCF_THRSHLD
XPARMID_T38_TRANSPORT
XPARMID_T38_MODE
XPARM_T38_RATE_NEG_REMOTE.
Default:XPARM_T38_RATE_NEG_REMOTE if packet transferred over UDP, otherwise
TCF error threshold (in percentage). Default: 5
Protocol used to transfer T.38 packets over IP network.
XPARMID_T38_TRANS_UDP or XPARMID_T38_TRANS_TCP.
Default: Special mode,
XPARM_T38_MODE_CHINA.
Default:
XPARM_T38_RATE_NEG_LOCAL
XPARMID_T38_TRANS_UDP
XPARM_T38_MODE_ITU or
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
Direct
Write
R/W N
R/W N
R/W N
R/W N
Media Processing Functions
No media processing function.
Converting the user-defined messages and executing the control accordingly.
Resource-Specific Control Messages
None.
Parameters
Identifier Description and values Attr.
XPARMID_RES_STATE Current state (0: idle, 1: active) R N
Enable trace during processing user’s messages.
XPARMID_MA_DEBUG
Default: XPARM_OFF R/W Y
XPARM_OFF
Default: XPARM_OFF
XPARM_ON or
Direct
Write
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 Sends a control message to the in-bound message queue Input Output None
Return
Caution Message buffer requires 4-byte alignment. Note Message buffer can be used for any other purpose after sending.
pMsgBuf – Pointer to the message buffer.
XSUCC — If successful XERROR — If errors
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)
Input
Output None
Return
Caution
XStatus_t xMsgWrite (void *pMsgBuf); (Sheet 1 of 2)
Description Input pMsgBuf — Pointer to the message buffer.
Output None
timeout – Waiting flag
XWAIT_NONE — If return immediately
XWAIT_FOREVER — If never time out (no other values are valid.)
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.
Posts a message (e.g. an user defined external event message) to the out-bound queue so that it can be retrieved by
XMsgReceive().
20 API Reference Manual
Intel® IXP400 Digital Signal Processing (DSP) Software Version 2. 5
XStatus_t xMsgWrite (void *pMsgBuf); (Sheet 2 of 2)
Return
Caution Message buffer requires 4-byte alignment. Note The message buffer can be used for any other purpose, after posting.
XSUCC — If successful XERROR — If errors

4.2 Message Header Format

typedef struct{
UINT32 transactionId; /* used by apps to track the message */ UINT16 instance; /* instance ID (1-0xffff), 0:reserved */ UINT8 resource; /* MPR resource type */
Format
Caution Message content must follow the header in contiguous memory.
UINT8 reserved; /* reserved for future */ UINT16 size; /* total size in bytes */ UINT8 type; /* message type */ UINT8 attribute; /* attribute, reserved for future */
} XMsgHdr_t, *XMsgRef_t_t;
Message Format and Delivery Mechanism
Macros
#define XMSG_MAKE_HEAD(pMsg, trans, res, inst, sz, typ, attr) \
((XMsgRef_t)(pMsg))->transactionId = trans;\ ((XMsgRef_t)(pMsg))->instance = inst;\ ((XMsgRef_t)(pMsg))->resource = res;\ ((XMsgRef_t)(pMsg))->reserved = 0;\ ((XMsgRef_t)(pMsg))->size = sz;\ ((XMsgRef_t)(pMsg))->type = typ;\
((XMsgRef_t)(pMsg))->attribute = attr;
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, /* Begin list */ XMSG_RESET, /* reset a resource */ XMSG_START, /* start media processing a SP resource */ XMSG_STOP, /* stop a current action on a SP resource */ XMSG_PING, /* ping a SP resource */ XMSG_SET_PARM, /* set a parameter on a SP resource */ XMSG_SET_MPARMS, /* set multiple parameters on a SP resource */ XMSG_GET_PARM, /* get a parameter from a SP resource */ XMSG_GET_PARM_ACK, /* acknowledgement to get parameter message */ XMSG_GET_ALLPARMS, /* get all parameters from a SP resource */ XMSG_GET_ALLPARMS_ACK, /* acknowledgement to get all parameter message */ XMSG_ACK, /* general acknowledgement message */ XMSG_ERROR, /* error message from SP resource */ XMSG_EVENT, /* event message from SP resource */ XMSG_CODER_START, /* start a codec resource */ XMSG_CODER_STOP_ACK, /* acknowledgement to stop message */ XMSG_TG_PLAY, /* play a digit string on a TG instance */ XMSG_TG_PLAY_FSK, /* play FSK modulated data */ XMSG_TG_PLAY_CMPLT, /* play-completed message from a TG instance */ XMSG_TD_RCV, /* receive a digit string on a TD instance */ XMSG_TD_RCV_CMPLT, /* receive-completed message from a channel */ XMSG_TD_RCV_FSK, /* receive a FSK signal on a TD instance */ XMSG_TD_RCV_FSK_CMPLT, /* receive-completed message from TD instance */ XMSG_PLY_START, /* start playing audio on a Player instance */ XMSG_GET_JBSTAT, /* get jitter buffer statistics from Dec */ XMSG_GET_JBSTAT_CMPLT, /* response to the get-JB-statistics msg */ XMSG_PLY_CMPLT, /* play-completed message from Player */ XMSG_END /* end of list */
} XMsgType_t;
22 API Reference Manual
Intel® IXP400 Digital Signal Processing (DSP) Software Version 2. 5

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
Macro
Response
Caution Any intermediate results are discarded.
XMsgHdr_t head;/* message header */ } XMsgReset_t;
#define XMSG_MAKE_RESET(pMsg, trans, res, inst) \ {\ XMSG_MAKE_HEAD(pMsg, trans, res, inst, sizeof(XMsgReset_t),\ XMSG_RESET, 0)\ }
• General acknowledgement message (XMSG_ACK)
• Error message (
XMSG_ERROR) if error.
Common Control Message

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
Response
Caution This message is not applicable to Tone Generator and Player resources.
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.
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
Macro
Response Resource returns the processing results or states, if any, depending on the resources and current actions.
XMsgHdr_t head; /* message header */ } XMsgStop_t;
#define XMSG_MAKE_STOP(pMsg, trans, res, inst)\ {\ XMSG_MAKE_HEAD(pMsg, trans, res, inst, sizeof(XMsgStop_t),\ XMSG_STOP, 0)\ }

5.4 Ping Message

Type XMSG_PING Direction Inbound
Description Verifies if the resource is alive.
typedef struct{
Format
Macro
Response
XMsgHdr_t head; /* message header */
} XMsgPing_t; #define XMSG_MAKE_PING(pMsg, trans, res, inst) \
{\ XMSG_MAKE_HEAD(pMsg, trans, res, inst, sizeof(XMsgPing_t),\ XMSG_PING, 0)\ }
• General acknowledgement message (XMSG_ACK)
• Error message (XMSG_ERROR) if error.

5.5 Set-Parameter Message

Type XMSG_SET_PARM Direction Inbound
Description Sets a parameter to a resource.
(Sheet 1 of 2)
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 parmId; /* parameter id */ UINT16 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;\
}
Response
• General acknowledgement message (XMSG_ACK)
• Error message (XMSG_ERROR) if error.

5.6 Set-Multiple-Parameter Message

Type XMSG_SET_MPARMS Direction Inbound
Description Set multiple parameters to a resource
typedef struct{
XMsgHdr_t head; /* message header */
Format
Macro
Response
UINT16 numParms; /* number of parameters */ UINT16 parmIDs[XMAX_PARMS]; /* parameter id */ UINT16 values[XMAX_PARMS]; /* 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; \
}
#define XMSG_FIELD_SET_MPARMS(pMsg, pIDs, pVals) \ {\
pIDs = ((XMsgSetmParms_t *)(pMsg))->parmIDs;\ pVals = ((XMsgSetmParms_t *)(pMsg))->values;\ }
• General acknowledgement message (XMSG_ACK)
• Error message (XMSG_ERROR) if error.
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{
Format
Macro
Response
XMsgHdr_t head; /* message header */ UINT16 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)\
((XMsgGetParm_t *)(pMsg))->parmId= id;\
}
• Specific acknowledgement message (XMSG_GET_PARM_ACK)
• Error message (XMSG_ERROR) if error.

5.8 Get-Parameter Acknowledge Message

Type XMSG_GET_PARM_ACK Direction Outbound
Description Resource returns the parameter enquired.
typedef struct{
XMsgHdr_t head; /* message header */
Format
Macro
UINT16 parmId; /* parameter id */ UINT16 value; /* parameter value */
} XMsgGetParmAck_t; #define XMSG_FIELD_GET_PARM_ACK(pMsg, id, val)\
{\
id = ((XMsgGetParmAck_t *)(pMsg))->parmId;\ val = ((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 head; /* message header */
Format
Macro
UINT16 numParms; /* number of parameters */ UINT16 parmIDs[XMAX_PARMS_GET]; /* array of parameter IDs */ UINT16 values[XMAX_PARMS_GET];
/* array of parameter values */
} XMsgGetAllParmsAck_t; #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
} XMsgAck_t;
API Reference Manual 27
XMsgHdr_t head; /* message header */
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 head; /* message header */
Format
Macro
UINT32 code; /* error code */ UINT32 data1; /* error data1 */ UINT32 data2; /* error data2 */
} 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;\
}

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 head; /* message header */
Format
Macro
UINT32 code; /* event code */ UINT32 data1; /* event data1 */ UINT32 data2; /* event data2 */
} 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 Starts a decoder or encoder.
typedef struct{
XMsgHdr_t head; /* message header */
Format
Macro
Response
UINT16 codecType; /* 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)\ ((XMsgCoderStart_t *)(pMsg))->codecType = cType;\ ((XMsgCoderStart_t *)(pMsg))->frmsPerPkt = fpp;\
}
• General acknowledgement message (XMSG_ACK)
• Error message (XMSG_ERROR) if error.

6.2 CODEC Stop-Acknowledgement Message

Type XMSG_CODER_STOP_ACK Direction Outbound
Description Decoder or encoder resource acknowledges the
typedef struct{
Format
Macro
XMsgHdr_t head; /* message header */ UINT32 numFrames; /* total number of frames processed */ UINT32 numBadFrames; /* number of bad frames */ } XMsgCoderStopAck_t;
#define XMSG_FIELD_EVENT(pMsg, num, numBad)\ {\
num = ((XMsgCoderStopAck_t *)(pMsg))->numFrames;\
numBad = ((XMsgCoderStopAck_t *)(pMsg))->numBadFrames;\ }
XMSG_STOP message
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 XMSG_TG_PLAY Direction Inbound
Description Requires Tone Generator to play a tone string. (Tone ID’s are listed in the constant data section.)
typedef struct{
Format
Macro
XMsgHdr_t head; /* message header */ UINT8 numTones; /* number of tones to play */ 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;\ }
#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{
Format
Macro
Response • Tone Generator Play-Completed message (XMSG_TG_PLAY_CMPLT)
XMsgHdr_t head; /* message header */ UINT8 numBytes; /* number of bytes to play */ INT8 data[XMAX_FSKDATASIZE]; /* data string */
} 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;\
}
#define XMSG_FIELD_TG_PLAY_FSK(pMsg, pData) \ {\
pData= ((XMsgTGPlayFSK_t *)(pMsg))->data;\
}
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; /* message header */ UINT16 reason; /* the reason of completion: */
Format
Macro
UINT8 numTones;
} XMsgTGPlayCmplt_t;
#define XMSG_FIELD_TG_PLAY_CMPLT(pMsg, rsn, num)\ {\
reason = ((XMsgTGPlayCmplt_t *)(pMsg))->reason;\ num = ((XMsgTGPlayCmplt_t *)(pMsg))->numTones;\
}
/* XMSG_STOP_REASON_USER(1) */ /* XMSG_STOP_REASON_EOD(2) */
/* number of tones played. 0 if FSK data */

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 totalTimeout; /* total time out (in 10 ms unit) */
Format
Macro
Response Tone detector receives completed message (XMSG_TD_RCV_CMPLT)
UINT16 firstDigitTimeout; /* first digit time o ut (10 ms uint)*/ UINT16 interDigitTimeout; /* inter digit time o ut (10 ms unit)*/ UINT16 termDigit; /* OR'd terminate digit bits */ UINT8 numDigits; /* 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;\ }
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 reason; /* the reason of completion */ UINT8 numDigits; /* number of tones received */ UINT8 digits[XMAX_DIGITBUFSIZE]; /* received tone IDs */
Format
Macro
} XMsgTDRcvCmplt_t;
where the reason may be: #define XMSG_STOP_REASON_EOD 2 #define XMSG_STOP_REASON_TERM 3 #define XMSG_STOP_REASON_TIMEOUT 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;\ }

6.8 Tone Detector Receive-FSK Message

Type MSG_TD_RCV_FSK Direction Inbound
Description Require Tone Detector to receive FSK data
typedef struct{
Format
Macro
Response Tone Detector FSK receive-completed message (XMSG_TD_RCV_FSK_CMPLT)
XMsgHdr_t head; /* message header */ UINT16 timeout; /* total time out (in 10 ms unit) */
} 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;\
}
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 reason; /* the reason of completion */ UINT8 numBytes; /* number of bytes received */
Format
Macro
UINT8 data[XMAX_FSKDATASIZE]; /* received data */ } XMsgTDRcvFskCmplt_t;
where the reason may be: #define XMSG_STOP_REASON_EOD 2
#define XMSG_STOP_REASON_TIMEOUT 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;\ }

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]; UINT8 numSeg; /* number of segments */ } XMsgPlyStart_t;
where the media segment data structure is defined as
Format
Macro
typedef struct{
INT32 offset; /* offset in byte where player starts */ INT32 length; /* 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;\
}
/* media segments to play */
#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 */
Format
Macro
} XMsgPlyCmplt_t;
where the reason may be: #define XMSG_STOP_REASON_USER 1
#define XMSG_STOP_REASON_EOD 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 Get the jitter buffer statistics from a Decoder instance.
typedef struct{ XMsgHdr_t head; /* message header */
Format
Macro
Response Complete message of getting jitter buffer statistics (XMSG_GET_JBSTAT_CMPLT)
UINT16 reset; /* 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;\
}

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
Format
Macro
is defined as typedef struct{ UINT32 rcvdPackets; /* total packets received */ UINT32 lostPackets; /* lost packets */ UINT32 badFrames; /* decoder bad frames */ UINT32 rcvdTonePackets; /* RFC2833 packets received */ } XJBStatistics_t;
#define XMSG_FIELD_GET_JBSTAT_CMPLT(pMsg, pStat)\ {\ 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 Packet arrival time as measured by a local clock. Remote Time Stamp Packet data sampling time measured by a remote clock. Payload Length Payload length in bytes.
4-bit media type field is defined as:
• 0x01 – Audio
Media
M Payload type RTP payload type as defined in RFC 1990.
Payload Encoded audio data or RFC-2838, tone-event information.
• 0x02 – Tone (RFC 2833 event type)
• 0x04 – Tone (RFC 2833 tone type)
• 0x08 – T.38 UDP
• 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.
36 API Reference Manual
Intel® IXP400 Digital Signal Processing (DSP) Software Version 2. 5
The corresponding data structure is defined as:
typedef struct{
UINT8 channelID; /* channel ID */ UINT8 payloadType;
/* bit[0-6]payloadtype,bit[7] SID mark bit */
unsigned int mediaType:4; /* media type */ 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 T ype 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.
Packet Data Interface
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 Call-back function to receive packets.
Input
Output None
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.
Buffer – memory address of the packet Channel – Channel numbers
XSUCC – If successful XERROR – If the packet receptor is unable to process the packet.
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 Input pSysConfig – System configuration information
Output None Return None
void xDspSysInit(XDSPSysConfig_t *pSysConfig);
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 numChTDM; /* number of channels of TDM termination(1~4) */ int numChIP; /* numb er of cha nnels of I P ter mination (1~4 ) */ int numPlayers; /* number of Player instances (1~4) */ int numMixers; /* number of Audio Mixers (must be 1) */ int numPortsPerMixer; /* number of ports per mixer (3~5) */ int countryCode; /* country code */ int taskPriBase; /* the base priority of DSP module */ int taskPriOrder; /* the priority ordering of the OS */ IxHssAccHssPort port; /* HSS port (must be Port 0) */ IxHssAccConfigParams *pHssCfgParms; /* HSS configuration parameters */
IxHssAccTdmSlotUsage *pHssTDMSlots; /* HSS TDM time slot mapping */
XDSPChanTdmSlots_t *pChanTsMap; /* channel vs. time slot mapping */
XPktRcvFxn_t pktRcvFxn; /* packet receiver function in egress */ XMsgAgentDec_t msgDecoder; XMsgAgentEnc_t msgEncoder; /* optional message encoder function of MA */ } XDSPSysConfig_t;
/* optional message decoder function of MA */
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
pChanTsMap field 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; /* time slot of the 1st sample */ int slotSample2; /* 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
MSA
1st WB sample
LSB
µ-law
NB Sample
...
MSB
2nd WB
sample
LSB
...
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
pChanTsMap field is given a NULL pointer, 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

Prototype
Input
Output pErrCode – Error code if errors
Return
XStatus_t xBuildToneTG(UINT16 toneId, UINT16 numSegs, XTGToneSeg_t *pToneSegs, UINT32 *pErrCode);
oneId — Tone ID, must be in the range of 16 ~ 255 NumSegs — Number of segments of the tone
pToneSegs — Array of tone segment definition
XSUCC if 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; /* 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,
INT16 freqB; /* 2nd frequency if dual frequency wave
INT16 ampA; /* amplitude of frequency A above, (0~ – 45 in 1dBm unit) */ INT16 ampB; /* amplitude of frequency B if dual frequency wave,
UINT16 mode; /* mode, overwrite or mix over the Decoder output */ INT16 nextSeg; /* the index of next segment relative to the current segement.
} XTGToneSeg_t;
/* repetition number of the segment. 0 means to repeat forever */
or the modulated carry frequency if AM wave, in 1Hz unit*/
or the modulating frequency if AM wave, ignored if single frequency wave */
or modulation rate if AM wave (0~100 in 1% unit), ignored if single frequency wave */
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 */
Warning: New tone definition must be added during the initialization after
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

Prototype
Input
Output
Return
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:
Status_t xBuildToneTD(UINT8 toneId, XTDToneInfo_t
*pToneInfo, UINT32 *pErrCode);
toneId – Tone ID, must be in the range of 16 ~ 255 pToneInfo — Tone detection criterion information
pErrCode – Error code if errors
XSUCC if successful
• Otherwise
XERROR
xDspSysInit(). The pre-
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; /* low bound of the 1st frequency in Hz */ UINT16 freqHighA; /* high bound of the 1st frequency in Hz */ UINT16 freqLowB; /* low bound of the 2nd frequency in Hz */ UINT16 freqHighB; /* high bound of the 2nd frequency in Hz */ INT16 ampLowA; /* low level of the 1st frequency in dBm */ INT16 ampHighA; /* high level of the 1st frequency in dBm
If both low and high are set to 0, the default
full range is applied */ INT16 ampLowB; /* low level of the 2nd frequency in dBm */ INT16 ampHighB; /* 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 pCfgInfo – Pointer to DSP configuration data structure
Output The resource configuration and the assignment of the routing streams Return None
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
void xDspGetResConfig(XDSPResConfig_t *pCfgInfo)
42 API Reference Manual
Intel® IXP400 Digital Signal Processing (DSP) Software Version 2. 5
Configuration and Initialization
data structure XDSPResConfig_t is defined as:
typedef struct{
int numChTDM; /* number of TDM termination channels */ int numChIP; /* number of IP termination channels */ int numPlayers; /* number of player instances */ int numMixers; /* number of Audio Mixers */ int numPortsPerMixer; /* number of ports per mixer */ int numStreams; /* number of total streams in the router */ int streamBaseTDM; / int streamBaseIP; /* T-Port stream ID of the first IP termination channel */ int streamBasePly; /* T-Port stream ID 1st port of the 1st Player instance */ int streamBaseMix; /* T-Port stream ID of the first mixer port */ int countryCode; /* country code */
} XDSPResConfig_t;
* T-Port stream ID of the first TMD termination channel */
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:
Prototype
Input
Output Parameter value
Return
Description This function retrieves the specified parameter value.
XStatus_t xDspParmRead(UINT8 res, UINT16 inst, UINT16 parmId, UINT16 *pParmVal);
res – DSP resource ID
inst – Instance ID of the resource
parmId – Parameter ID
pParmVal – Pointer to the variable that receives the returned parameter value
XSUCC if successful
• Otherwise
XERROR
Prototype
Input
Output None
Return
Description This function sets the value of the specified parameter.
XStatus_t xDspParmWrite(UINT8 res, UINT16 inst,
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
XSUCC if successful
• Otherwise
XERROR

9.2 Flash Hook Detection

Prototype
Input
Status_t xFlashHookDetect(UINT16 channel, XHookState_t hookState, XUINT32 transId);
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
Prototype
Output None
Return
Description
Status_t xFlashHookDetect(UINT16 channel, XHookState_t hookState, XUINT32 transId);
XSUCC if successful
• Otherwise
This function is called by the SLIC driver to report the hook state changes via the event message.
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.
XERROR
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 pDesc – The pointer to structure XCachePromptDesc_t. Output None Return
Description
XMediaHandle_t xDspRegCachePrompt(XCachePromptDesc_t *pDesc);
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_t describes the data required to register a cached prompt.
typedef struct{
UINT8 *pBuffer; /* Pointer to the play buffer. */ INT32 size; /* The size of play buffer. */ 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 None Output None Return Pointer to the version string.
Description
char * xDspGetVersion(void );
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 string 020501 and the production release has the string 020505.
®
IXP400 DSP Software v2.5 EAR gives the
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_ERROR message 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 */ #define XERR_MEMORY 0x0003 /* memory error # */ #define XERR_INVALID_RES_ID 0x0011 /* invalid resource id */ #define XERR_INVALID_CHAN_ID 0x0012 /* invalid channel id */ #define XERR_INVALID_PARM_ID 0x0013 /* invalid parameter id */ #define XERR_INVALID_STREAM_ID 0x0014 /* invalid stream id */ #define XERR_PARM_READONLY 0x0015 /* real only parameter */ #define XERR_PARM_SET_FAIL 0x0016 /* cannot set parameter */ #define XERR_PARM_GET_FAIL 0x0017 /* cannot get parameter */ #define XERR_UNEXPECTED_MSG 0x0018 /* unexpected message */ #define XERR_UNSUPPORTED_MSG 0x0019 /* unsupported message */ #define XERR_ALGORITHM 0x0041 /* algorithm related error # */ #define XERR_OTHERS 0x00ff /* other errors */
The resource-specific error codes are defined as:
#define XERR_INVALID_CODE_TYPE 0x401 /* invalid codec type */ #define XERR_INVALID_FPP 0x402 /* invalid # frms per pkt */ #define XERR_TG_INVALID_TONE_ID 0x403 /* invalid tone ID */ #define XERR_TG_INVALID_TID_NUM 0x404 /* too many tone IDs */ #define XERR_TG_INVALID_DATA_NUM 0x405 /* too many FSK data */ #define XERR_TD_INVALID_DIGIT_NUM 0x406 /* too many digits */ #define XERR_RESOURCE_BUSY 0x407 /* resource is busy */ #define XERR_RESOURCE_IDLE 0x408 / * resource is idle */ #define XERR_MA_DEEP_RECURSIVE 0x409 /* deep recursive msg decoder*/
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 0x101 /* tone-on event */ #define XEVT_CODE_TD_TONEOFF 0x102 /* tone-off event */ #define XEVT_LOST_PACKET 0x103 /* lost packet */ #define XEVT_DEC_PACKET_CHNG 0x104 /* RTP payload type changed */ #define XEVT_NET_HOOK_STATE 0x105 /* hook state change detected */ #define XEVT_NET_TIMER 0x106 /* 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 0 #define RFC_TID_DTMF_1 1 #define RFC_TID_DTMF_2 2 #define RFC_TID_DTMF_3 3 #define RFC_TID_DTMF_4 4 #define RFC_TID_DTMF_5 5 #define RFC_TID_DTMF_6 6 #define RFC_TID_DTMF_7 7 #define RFC_TID_DTMF_8 8 #define RFC_TID_DTMF_9 9 #define RFC_TID_DTMF_STAR 10 #define RFC_TID_DTMF_POUND 11 #define RFC_TID_DTMF_A 12 #define RFC_TID_DTMF_B 13 #define RFC_TID_DTMF_C 14 #define RFC_TID_DTMF_D 15
Fax-tone IDs reported by the Tone Detector for fax bypass applications. Not supported by the Tone Generator.
#define RFC_TID_FAX_CED 32 #define RFC_TID_FAX_CNG 36 #define RFC_TID_FAX_V21 40
48 API Reference Manual
Intel® IXP400 Digital Signal Processing (DSP) Software Version 2. 5
The general call-progress tone IDs used by the Tone Generator are defined as:
#define RFC_TID_DIAL 66 #define RFC_TID_PBX_DIAL 67 #define RFC_TID_SP_DIAL 68 #define RFC_TID_2ND_DIAL 69 #define RFC_TID_RING 70 #define RFC_TID_SP_RING 71 #define RFC_TID_BUSY 72 #define RFC_TID_CONGESTION 73 #define RFC_TID_SP_INFO 74 #define RFC_TID_COMFORT 75 #define RFC_TID_HOLD 76 #define RFC_TID_REC 77 #define RFC_TID_CALLER_WT 78 #define RFC_TID_CALL_WT 79 #define RFC_TID_PAY 80 #define RFC_TID_POS_IND 81 #define RFC_TID_NEG_IND 82 #define RFC_TID_WARNING 83 #define RFC_TID_INSTRUSION 84 #define RFC_TID_CAL_CARD 85 #define RFC_TID_PAYPHONE 86
Constant Data
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 81 /* country code for Japan */ #define NTT_TID_DT RFC_TID_DIAL /* dial tone */ #define NTT_TID_RBT RFC_TID_RING /* ring back tone */ #define NTT_TID_BT RFC_TID_BUSY /* busy tone */ #define NTT_TID_PDT RFC_TID_PBX_DIAL /* private dial tone */ #define NTT_TID_SDT RFC_TID_2ND_DIAL /* 2nd dial tone */ #define NTT_TID_CPT RFC_TID_POS_IND /* acceptance tone */ #define NTT_TID_HST RFC_TID_HOLD /* hold service tone */ #define NTT_TID_IIT RFC_TID_CALL_WT /* incoming id tone */ #define NTT_TID_SIIT 110 #define NTT_TID_HOW RFC_TID_OFFHK_WARN /* howler tone */
/* special incoming id 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 1 /* US country code */ #define US_TID_DIAL RFC_TID_DIAL /* dial tone */ #define US_TID_RING RFC_TID_RING /* ring back tone */ #define US_TID_BUSY RFC_TID_BUSY /* busy tone */ #define US_TID_RC_DIAL RFC_TID_SP_DIAL /* recall dial tone */ #define US_TID_PBX_DIAL 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 86 /* China country code */ #define PRC_TID_DIAL RFC_TID_DIAL /* dial tone */ #define PRC_TID_RING RFC_TID_RING /* ring back tone */ #define PRC_TID_BUSY RFC_TID_BUSY /* busy tone */ #define PRC_TID_SP_DIAL RFC_TID_SP_DIAL /* special dial tone */ #define PRC_TID_CONGESTION RFC_TID_CONGESTION /* congestion tone */ #define PRC_TID_UNAVAILABLE RFC_TID_UNAVAILABLE /* unavailable tone */ #define PRC_TID_TOLL RFC_TID_COMFORT /* long distance tone */ #define PRC_TID_QUEUE RFC_TID_QUEUE /* queue tone */ #define PRC_TID_CALL_WT RFC_TID_CALL_WT /* call waiting tone */ #define PRC_TID_THR_PARTY RFC_TID_THR_PARTY /* 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

10.4 Other Constants

The coder types used in the XPARMID_DEC_CTYPE and XPARMID_ENC_CTYPE parameters and the XMSG_CODER_START message 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;
Constant Data
Mask bits used to specify the coder type subset in Decoder auto-switch parameter are defined as:
#define XPARM_DEC_AUTOSW_OFF 0x0000 #define XPARM_DEC_AUTOSW_G711MU 0x0001 #define XPARM_DEC_AUTOSW_G711A 0x0002 #define XPARM_DEC_AUTOSW_G729A 0x0004 #define XPARM_DEC_AUTOSW_G723 0x0008 #define XPARM_DEC_AUTOSW_G722 0x0010 #define XPARM_DEC_AUTOSW_G726_40 0x0020 #define XPARM_DEC_AUTOSW_G726_32 0x0040 #define XPARM_DEC_AUTOSW_G726_24 0x0080 #define XPARM_DEC_AUTOSW_G726_16 0x0100 #define XPARM_DEC_AUTOSW_ALL 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_RCV message are defined as:
#define XTD_TERM_DIGIT_NONE 0x0000 #define XTD_TERM_DIGIT_0 0x0001 #define XTD_TERM_DIGIT_1 0x0002 #define XTD_TERM_DIGIT_2 0x0004 #define XTD_TERM_DIGIT_3 0x0008 #define XTD_TERM_DIGIT_4 0x0010 #define XTD_TERM_DIGIT_5 0x0020 #define XTD_TERM_DIGIT_6 0x0040 #define XTD_TERM_DIGIT_7 0x0080 #define XTD_TERM_DIGIT_8 0x0100 #define XTD_TERM_DIGIT_9 0x0200 #define XTD_TERM_DIGIT_STAR 0x0400 #define XTD_TERM_DIGIT_POUND 0x0800 #define XTD_TERM_DIGIT_A 0x1000 #define XTD_TERM_DIGIT_B 0x2000 #define XTD_TERM_DIGIT_C 0x4000 #define XTD_TERM_DIGIT_D 0x8000
The stop-reasons in the
XMSG_TD_RCV_FSK_CMPLT, and XMSG_PLY_CMPLT messages are defined as:
XMSG_TG_PLAY_CMPLT, XMSG_TD_RCV_CMPLT,
#define XMSG_STOP_REASON_USER 1 /* stopped by XMSG_STOP message */ #define XMSG_STOP_REASON_EOD 2 /* end of data */ #define XMSG_STOP_REASON_TERM 3 /* stopped by the terminate digits */ #define XMSG_STOP_REASON_TIMEOUT 4 /* time out */
52 API Reference Manual
Loading...