| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389 |
- /*********************************************************************/
- /* EhangCom: API Head file
- *
- * FILE: ipmlib.h
- * DESCRIPTION: Header File for EhangCom ipm library
- *
- * Copyright (c) 2004-2043 EhangCom Corp. All Rights Reserved
- *
- * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF EhangCom Corp.
- * The copyright notice above does not evidence any actual or
- * intended publication of such source code.
- */
- /********************************************************************/
- #ifndef __IPMLIB_H__
- #define __IPMLIB_H__
- #ifndef u8
- #define u8 CHAR
- #endif
- #ifndef u16
- #define u16 USHORT
- #endif
- #define MAX_IPM_DIGITS 0x20
- #pragma pack(1)
- typedef enum{
- Precedence_Routine = 0x00,
- Precedence_FlashOverride,
- Precedence_Immediate,
- Precedence_InternetworkControl,
- Precedence_Priority,
- Precedence_CRITIC_ECP,
- Precedence_Flash,
- Precedence_NetworkControl,
- }ePRECEDENCE;
- #ifndef AUDIOCODEC_DEF
- #define AUDIOCODEC_DEF 1
- typedef enum{
- AudioCodec_G711_ALAW_20MS = 0x00,
- AudioCodec_G711_ULAW_20MS = 0x01,
- AudioCodec_G726_16_20MS = 0x02,
- AudioCodec_G726_24_20MS = 0x03,
- AudioCodec_G726_32_20MS = 0x04,
- AudioCodec_G726_40_20MS = 0x05,
- AudioCodec_G727_16_20MS = 0x06,
- AudioCodec_G727_24_16_20MS = 0x07,
- AudioCodec_G727_24_20MS = 0x08,
- AudioCodec_G727_32_16_20MS = 0x09,
- AudioCodec_G727_32_24_20MS = 0x0a,
- AudioCodec_G727_32_20MS = 0x0b,
- AudioCodec_G727_40_16_20MS = 0x0c,
- AudioCodec_G727_40_24_20MS = 0x0d,
- AudioCodec_G727_40_32_20MS = 0x0e,
- AudioCodec_G723_5_3_30MS = 0x0f,
- AudioCodec_G723_6_3_30MS = 0x10,
- AudioCodec_G729_20MS = 0x11,
- AudioCodec_G711_ALAW_30MS = 0x12,
- AudioCodec_iLBC_20MS = 0x13,
- AudioCodec_iLBC_30MS = 0x14,
- AudioCodec_CLEAR_CHANNEL = 0x15,
- AudioCodec_GSM_FR = 0x16,
- AudioCodec_GSM_EFR = 0x17,
- AudioCodec_AMR_475_OA = 0x18,
- AudioCodec_AMR_515_OA = 0x19,/* 25 */
- AudioCodec_AMR_590_OA = 0x1a,
- AudioCodec_AMR_670_OA = 0x1b,
- AudioCodec_AMR_740_OA = 0x1c,
- AudioCodec_AMR_795_OA = 0x1d,
- AudioCodec_AMR_102_OA = 0x1e,/* 30 */
- AudioCodec_AMR_122_OA = 0x1f,
- AudioCodec_AMR_475_BE = 0x20,
- AudioCodec_AMR_515_BE = 0x21,
- AudioCodec_AMR_590_BE = 0x22,
- AudioCodec_AMR_670_BE = 0x23,/* 35 */
- AudioCodec_AMR_740_BE = 0x24,
- AudioCodec_AMR_795_BE = 0x25,
- AudioCodec_AMR_102_BE = 0x26,
- AudioCodec_AMR_122_BE = 0x27,/* 39 */
- AudioCodec_AMR_WB_66_BE = 0x28,
- AudioCodec_AMR_WB_885_BE = 0x29,
- AudioCodec_AMR_WB_1265_BE = 0x2A,
- AudioCodec_AMR_WB_1425_BE = 0x2B,
- AudioCodec_AMR_WB_1585_BE = 0x2C,
- AudioCodec_AMR_WB_1825_BE = 0x2D,
- AudioCodec_AMR_WB_1985_BE = 0x2E,
- AudioCodec_AMR_WB_2305_BE = 0x2F,
- AudioCodec_AMR_WB_2385_BE = 0x30,
- AudioCodec_AMR_WB_66_OA = 0x31,
- AudioCodec_AMR_WB_885_OA = 0x32,
- AudioCodec_AMR_WB_1265_OA = 0x33,
- AudioCodec_AMR_WB_1425_OA = 0x34,
- AudioCodec_AMR_WB_1585_OA = 0x35,
- AudioCodec_AMR_WB_1825_OA = 0x36,
- AudioCodec_AMR_WB_1985_OA = 0x37,
- AudioCodec_AMR_WB_2305_OA = 0x38,
- AudioCodec_AMR_WB_2385_OA = 0x39,
- AudioCodec_SILK_8KSS_20MS = 0x3A, //8K采样 [2015-4-28]
- AudioCodec_SILK_16KSS_20MS = 0x3B, //16K采样[2015-4-28]
- AudioCodec_OPUS_8KSS_20MS = 0x3C, //8K采样 [2015-4-28]
- AudioCodec_OPUS_16KSS_20MS = 0x3D, //16K采样[2015-4-28]
- AudioCodec_MaxNum, //This item is not a valid codec
- }eAUDIOCODEC;
- #endif
- // Type of Service
- typedef struct {
- u8 Valid; // Flag for validity of this structure,0 Invalidity, 1 Validity
- u8 Precedence; // Precedence. Refer to ePRECEDENCE
- u8 LowDelay; // Flag for low delay. 0 Normal delay ,1 Low delay
- u8 HighThroughout; // Flag for high throughout rate 0 Normal throughout rate 1 High throughout rate
- u8 HighReliability; // Flag for high reliability.0 Ordinary reliability 1 High reliability
- u8 LowCost; // Flag for low costs.
- // 0 ordinary costs
- // 1 low costs
- } IpConfig_TOS;
-
- // UDP Source Port Valid
- typedef struct {
- u8 Valid; // Flag for validity of this structure.
- u8 SourcePortValid; // Executes source port check.0 No execution1 Execution
- } IpConfig_UDPSourcePortValid;
-
- // Initial Media Inactivity Timeout
- typedef struct {
- u8 Valid; // Flag for validity of this structure // 0 Invalidity // 1 Validity
- u16 IMID; // Timeout value of the timer for initial media data inactivity detection in 10ms// 0 Deactivation// 1 Activation
- } IpConfig_IMID;
-
- // Media Inactivity Detection timer
- typedef struct {
- u8 Valid; // // Flag for validity of this structure.// 0 Invalidity// 1 Validity
- u16 MID; //// Timer for media inactivity detection in 10ms.// 0 Deactivation// 1 Activation
- } IpConfig_MID;
- typedef struct {
- IpConfig_TOS TOS; // TOS configuration information
- IpConfig_UDPSourcePortValid UDPSrcPortValid; // UDP source port check configuration
- IpConfig_IMID IMID; //Information about configuration of initial media inactivity detection
- IpConfig_MID MID; // Information about configuration of media inactivity detection
- } GeneralIpConfig;
- // Fax Type
- typedef struct {
- u8 Valid; // // Flag for validity of this structure.// 0 Invalidity// 1 Validity
- u8 FaxType; // // Fax configuration type. It includes the following:// 0 Disabling faxing;// 1 Relay (enabling the T.38 fax trunk);// 2 Bypass (fax bypass)
- } FaxConfig_FaxType;
-
- // Fax Bypass coder Type
- typedef struct {
- u8 Valid; // Flag for validity of this structure.// 0 Invalidity// 1 Validity
- u8 Decoder; // Voice codec type when the Fax type is Bypass
- u8 FaxBypassM; // Frame magnification in the range of 1-8
- } FaxConfig_BypassCoder;
- // T.38 FaxRelay ECM Mode
- typedef struct {
- u8 Valid; // Flag for validity of this structure.// 0 Invalidity// 1 Validity
- u8 EcmComptMode; // ECM compatibility mode.// 0 Backward compatibility// 1 Interoperability
- } FaxConfig_CompMode;
-
- //UDP Port Configuration
- typedef struct {
- u8 Valid; // Flag for validity of this structure.// 0 Invalidity// 1 Validity
- u16 UdpPort; // Udp port number
- } IpConfig_UdpPort;
- typedef struct {
- FaxConfig_FaxType FaxType; // Fax type
- FaxConfig_BypassCoder BypassCoder; // Bypass Coder
- FaxConfig_CompMode CompMode; // T.38 FaxRelay ECM Mode
- IpConfig_UdpPort SrcT38Port; // Src T.38 port
- IpConfig_UdpPort DstT38Port; // Dst T.38 port
- } FaxAttributeConfig;
- // RTP Payload Type
- typedef struct {
- u8 Valid; // Flag for validity of this structure.// 0 Invalidity// 1 Validity
- u8 PaylaodType; //Paylaod type
- } VoiceConfig_PayloadType;
- // RTP Payload size
- typedef struct {
- u8 Valid; // Flag for validity of this structure.// 0 Invalidity// 1 Validity
- u8 PayloadSize; //Payload basis package length magnification in the range of 1-8.// The default is 1
- } VoiceConfig_PayloadSize;
- // RTP Silence suppression
- typedef struct {
- u8 Valid; // Flag for validity of this structure.// 0 Invalidity// 1 Validity
- u8 SilenceSuppress; // Flag for activation of silence suppression.// 0 Disable silence suppression// 1 Enalbe silence suppression
- } VoiceConfig_SilenceSuppress;
- // RTP Echo Cancellation
- typedef struct {
- u8 Valid; // Flag for validity of this structure.// 0 Invalidity// 1 Validity
- u8 EchoCancel; // Flag for activation of echo cancelation.// 0 Disbale echo cancelation// 1 Enbale echo cancelation
- u8 EchoCancellerLength;// Echo cancelation length
- } VoiceConfig_EchoCancel;
- // Max Jitter buffer delay
- typedef struct {
- u8 Valid; // Flag for validity of this structure.// 0 Invalidity// 1 Validity
- u16 Value; // Jitter buffer delay value
- } VoiceConfig_JitterBufferDelay;
- // Jitter buffer adaptation Rate
- typedef struct {
- u8 Valid; // Flag for validity of this structure.// 0 Invalidity// 1 Validity
- u8 Value; // Adaptation rate in the range of 0-13ms
- } VoiceConfig_AdaptationRate;
- typedef struct {
- VoiceConfig_PayloadType PayloadType; // // Payload type
- VoiceConfig_PayloadSize PayloadSize; // Payload size
- VoiceConfig_SilenceSuppress SilenceSuppress; // Flag for silence suppression
- VoiceConfig_EchoCancel EchoCancel; // Flag for echo cancelation
- VoiceConfig_JitterBufferDelay MinJitterBuffer;// Minimum jitter buffer delay
- VoiceConfig_JitterBufferDelay MaxJitterBuffer;// Maximum jitter buffer delay:80 ~ 300
- VoiceConfig_AdaptationRate AdaptationRate; // Jitter buffer adaptation rate
- IpConfig_UdpPort SrcRTCPPort; // Source RTCP port number
- IpConfig_UdpPort DstRTCPPort; // Destination RTCP port number
- } VoiceAttributeConfig;
- typedef enum {
- DRM_ERASE_AND_NOT_RELAY = 0x00,
- DRM_ERASE_AND_RELAY = 0x01,
- DRM_KEEP_AND_NOT_RELAY = 0x02,
- DRM_ERASE_AND_RELAY_RFC2833 = 0x03
- } eDigitRelayMode;
- // DTMF Trunk Type
- typedef struct {
- u8 Valid; // Flag for validity of this structure.// 0 Invalidity// 1 Validity
- u8 DigitRelayMode; /* DTMF/MF trunk mode
- 0x00:erase DTMF/MF from audio stream and do not relay
- 0x01:erase DTMF/MF from audio stream and relay to remote
- 0x02:keep DTMF/MF in audio stream - do not relay
- 0x03:erase DTMF/MF from audio stream and relay to remote - according to RFC2833
- */
- } DtmfConfig_DigitRelay;
- // RFC2833 payload size
- typedef struct {
- u8 Valid; // Flag for validity of this structure.// 0 Invalidity// 1 Validity
- u8 DynamicPayload; // RFC2833 payload size in the range of 96-127
- } DtmfConfig_Dynamic_Payload;
- typedef struct {
- DtmfConfig_DigitRelay DigitRelay; // DTMF trunk type
- DtmfConfig_Dynamic_Payload DynamicPayload; //
- } DtmfConfig;
- //RTP packet redundancy class
- typedef struct {
- u8 Valid; // Flag for validity of this structure.// 0 Invalidity// 1 Validity
- u8 RedundancyDepth; // Redundancy class.// 0 No redundancy// 1 Redundancy class 1
- } Rfc2198Config_RTPPacketDepth;
- // FAX packet redundancy class
- typedef struct {
- u8 Valid; // Flag for validity of this structure.// 0 Invalidity// 1 Validity
- u8 RedundancyDepth; // Redundancy class.// 0 No redundancy// 1 Redundancy class 1// 2 Redundancy class 2
- } Rfc2198Config_FaxPacketDepth;
- // RFC2833 redundancy class
- typedef struct {
- u8 Valid; // Flag for validity of this structure.// 0 Invalidity// 1 Validity
- u8 RedundancyDepth; // redundancy class in the range of 0-3.// 0 No redundancy// 1 Redundancy 1// 2 Redundancy 2// 3 Redundancy 3
- } Rfc2198Config_Rfc2833PacketDepth;
- // RFC2198 packet load size
- typedef struct {
- u8 Valid; // Flag for validity of this structure.// 0 Invalidity// 1 Validity
- u8 DynamicPayload; // rfc2198 Dynamic payload size in the range of 96-127
- } Rfc2198Config_DynamicPayload;
- typedef struct {
- Rfc2198Config_RTPPacketDepth RtpPacketDepth; //RTP packet redundancy class
- Rfc2198Config_FaxPacketDepth FaxPacketDepth; //FAX packet redundancy class
- Rfc2198Config_Rfc2833PacketDepth Rfc2833PacketDepth; //RFC2833 redundancy class
- Rfc2198Config_DynamicPayload DynamicPayload; //RFC2198 packet payload size
- } Rfc2198Config;
- // Answer detector configuration information
- typedef struct {
- u8 Valid; // Flag for validity of this structure.// 0 Invalidity// 1 Validity
- u8 Active; // // Whether the answer detector is activated.// 0 Stop// 1 Active
- u8 ActivityDelay; // Activation delay of the answer detector in 100ms
- u8 Redirection; // Ditection direction.// 0 PCM// 1 IP network
- u8 SilenceTime; // Detects whether it is the voice end silence time in 100ms
- } IpMedia_AnswerDetectorInfo;
- // Automatic gain control configuration information
- typedef struct {
- u8 Valid; // Flag for validity of this structure.// 0 Invalidity// 1 Validity
- u8 Active; // // Flag for activation of AGC.// 0 Stop// 1 Active
- u8 GainSlop; // AGC gain adjustment slope in 1dBm/sec. The default is 3
- u8 Redirection; // AGC control direction.// 0 PCM// 1 IP network
- u8 TargetEnergy; // AGC target energy in –dBm. The default is 19
- } IpMedia_AgcInfo ;
- // Energy detector configuration information
- typedef struct {
- u8 Valid; // Flag for validity of this structure.// 0 Invalidity// 1 Validity
- u8 Active; // Flag for activation.// 0 Stop// 1 Active
- u8 Threshold; // Energy detection threshold
- u8 QualifyFactor; // Detection sensitiveness in the range of 0-10.// 0 and 10 indicate the minimum and maximum// sensitiveness respectively
- } IpMedia_EnergyDetectorInfo;
- typedef struct {
- IpMedia_AnswerDetectorInfo AnswerDetector; // Answer detector configuration information
- IpMedia_AgcInfo Agc; //Automatic gain control configuration information
- IpMedia_EnergyDetectorInfo EnergyDetector; // Energy detector configuration information
- } IpMediaConfig;
- typedef struct {
- u8 Valid; // Flag for validity of this structure.// 0 Invalidity// 1 Validity
- CHAR IpAddr[32]; //IP address
- } IpConfig_IP_addr;
- typedef enum{
- ConnMode_FullDup, //Full duplex
- ConnMode_RecvOnly, //Listening only
- ConnMode_SendOnly, //Speaking only
- ConnMode_Hold, //Hold. No voice data is received/sent
- }eCONN_MODE;
- typedef struct{
- IpConfig_IP_addr DstIpAddr;
- IpConfig_UdpPort DstRtpPort;
- UCHAR ConnMode;
- GeneralIpConfig GenIpCfg;
- FaxAttributeConfig FaxCfg;
- VoiceAttributeConfig VoiceCfg;
- DtmfConfig DtmfCfg;
- Rfc2198Config Rfc2189Cfg;
- IpMediaConfig IpMediaCfg;
- IpConfig_UdpPort SrcRtpPort;
- }XOIP_CFG;
- typedef struct{
- UINT LostPacket;
- UINT Jitter;
- UINT RoundTripLatency;
- }XOIP_QOS_INFO;
- typedef struct{
- UINT unLocalSR_TimeStamp;
- UINT unLocalSR_TxPackets;
- UINT unLocalSR_TxOctets;
- UINT unLocalSR_SendIndication;
- UINT unLocalRR_FractionLost;
- UINT unLocalRR_CumulativeLost;
- UINT unLocalRR_SeqNumber;
- UINT unLocalRR_ValidInfo;
- UINT unRemoteSR_TimeStamp;
- UINT unRemoteSR_TxPackets;
- UINT unRemoteSR_TxOctets;
- UINT unRemoteSR_SendIndication;
- UINT unRemoteRR_FractionLost;
- UINT unRemoteRR_CumulativeLost;
- UINT unRemoteRR_SeqNumber;
- UINT unRemoteRR_ValidInfo;
- } XOIP_RTCP_SESSION_INFO;
- typedef struct{
- XOIP_QOS_INFO QosInfo;
- XOIP_RTCP_SESSION_INFO RtcpInfo;
- }XOIP_SESSION_INFO;
- typedef struct{
- IpConfig_IP_addr IpAddr;
- IpConfig_UdpPort RtpPort;
- }XOIP_SRCADD;
- /************************************************************************/
- /*
- Description
- This structure is IPMEV_ANSWER event data and provides answer state and remote address information.
- The NAT penetration function can be achieved by using this information.
- Field Description
- The data fields of IPMEV_ANSWER_INFO are described as follows:
- ucEvtType: Is used to indicate answer detection. That is, 0 - voice stops, 1 - voice starts
- RemoteIpAddr: Remote IP address
- RemoteUdpPort: Remote port number
- */
- /************************************************************************/
- typedef struct{
- UCHAR ucEvtType; //Is used to indicate answer detection.//That is, 0 - voice stop, 1 - voice start
- char RemoteIpAddr[EHANG_MAX_IP_LEN]; //Remote IP address
- USHORT RemoteUdpPort; //Remote port number
- } IPMEV_ANSWER_INFO;
- /*ISXE_ipm_SetParam() function paramter*/
- #define IPM_PARMID_RTP_CODEC 0 //ISXE_ipm_SetParam() function param id. refer to IPM_RTP_CODEC_PARM
- #define IPM_PARMID_RTPS_PARAM_4RTP 1 //ISXE_ipm_SetParam() function param id. refer to RTPS_PARAM
- #define IPM_PARMID_RTPS_PARAM_4RTCP 2 //ISXE_ipm_SetParam() function param id. refer to RTPS_PARAM
- typedef struct{
- UCHAR ucCodec; //voice codec, refer to eAUDIOCODEC
- UCHAR ucPayload; //RTP payload type.
- //VOID* pCodecParam;
- }IPM_RTP_CODEC_PARM;
- //////////////////////////////////////////////////////////////////////////
- //Rtp Proxy data struct
- #ifndef EV_RTPPROXY
- #define EV_RTPPROXY 0x0001
- #endif
- typedef enum {
- RTPS_CHAN_TYPE_NAT_NULL = 0, //NAT:没有状态,直接在WAN/LAN间转发包;只修改包的MAC/IP/UDP,不修改RTP部分;
- RTPS_CHAN_TYPE_NAT_WANCROSS = 1, //NAT带WAN口穿透功能:功能与NAT相同,支持WAN口穿透;
- RTPS_CHAN_TYPE_NBUP = 2 //NbUP:在WAN口支持NbUP协议;只有NbUP连接建立后,才开始启动WAN/LAN的包转发功能。
- //在转发中除了修改MAC/IP/UDP,还会修改RTP头的内容;在LAN->WAN过程中,要增加NbUP的头;
- //在WAN->LAN过程中,要消除NbUP头。
- } eRTPS_CHAN_TYPE;
- typedef struct {
- CHAR IpAddr[32];
- USHORT UdpPort;
- } RTPS_ENDPOINT;
- /* NbUP Coder类型定义 */
- typedef enum {
- NBUP_VOCODER_NONE = 0x00000000,
- NBUP_VOCODER_GSM_AMR_12_2Kbps = 0x00000001,
- NBUP_VOCODER_GSM_AMR_10_2Kbps = 0x00000002,
- NBUP_VOCODER_GSM_AMR_7_95Kbps = 0x00000004,
- NBUP_VOCODER_GSM_AMR_7_4Kbps = 0x00000008,
- NBUP_VOCODER_GSM_AMR_6_7Kbps = 0x00000010,
- NBUP_VOCODER_GSM_AMR_5_9Kbps = 0x00000020,
- NBUP_VOCODER_GSM_AMR_5_15Kbps = 0x00000040,
- NBUP_VOCODER_GSM_AMR_4_75Kbps = 0x00000080,
- NBUP_VOCODER_GSM_AMR_SID = 0x00000100,
- NBUP_VOCODER_SILENCE = 0x00000200,
- NBUP_VOCODER_G711_5MS = 0x00000400,
- NBUP_VOCODER_G711_20MS = 0x00000800
- }eRTPS_NBUP_CODER;
- //注意:
- //Coder分成两类,不要混合使用:
- //AMR:可以有NBUP_VOCODER_GSM_AMR_12_2Kbps~NBUP_VOCODER_SILENCE;
- //G.711:NBUP_VOCODER_G711_5MS和NBUP_VOCODER_G711_20MS。
- #define MAX_RTPS_NBUP_CODERS 16 /* Coder的最大数量 */
- typedef struct {
- UINT nCoder; //refer to eRTPS_NBUP_CODER
- UINT CoderType[MAX_RTPS_NBUP_CODERS];
- } RTPS_NBUP_CODER, *PRTPS_NBUP_CODER;
- /* NbUP在数据传输时采用的PDU类型定义 */
- typedef enum {
- RTPS_NBUP_MEDIA_PDU_TYPE_0 = 0, /* 带CRC校验的数据传输方式 */
- RTPS_NBUP_MEDIA_PDU_TYPE_1 = 1, /* 不带CRC校验的数据传输方式 */
- MAX_RTPS_NBUP_MEDIA_PDU_TYPES
- }eRTPS_NBUP_MEDIA_PDU_TYPE;
- /* Start命令中,NbUP的参数 */
- typedef struct {
- UCHAR wanPT; /* 发送包的PayloadType */
- UCHAR lanPT; /* 发送给LAN是采用的PayloadType */
- UCHAR RFCI;
- UCHAR SendInitialization; /* 主动发送初始化还是等待对方发送init消息 */
- UCHAR MediaPduType; /* 0: PDU Type 0, 1: PDU Type 1 , refer to eRTPS_NBUP_MEDIA_PDU_TYPE*/
- UINT InitTimerDuration; /* 发送Init命令的间隔,单位ms,缺省1000ms */
- UINT InitRetryCount; /* 发送Init命令的重试次数,缺省3 */
- RTPS_NBUP_CODER Coder;
- } RTPS_NBUP_PARAM, *PRTPS_NBUP_PARAM;
- typedef struct {
- UCHAR ChanType; //refer to eRTPS_CHAN_TYPE
- union {
- RTPS_NBUP_PARAM nbup;
- CHAR rvr[1024]; //保留
- }u;
- } RTPS_PARAM;
- typedef struct {
- UINT CoderType;
- }NBUP_CODERTYPE;
- //Progress:NbUP协商进展;
- typedef enum {
- RTPS_NBUP_PROGRESS_NONE = 0,
- RTPS_NBUP_PROGRESS_INITIALISATION = 1,
- RTPS_NBUP_PROGRESS_DATA_TRANSFER = 2,
- RTPS_NBUP_PROGRESS_FAILED = 3
- }eRTPS_NBUP_PROGRESS;
- //State:NbUP协商状态;
- typedef enum {
- RTPS_NBUP_STATE_NONE = 0,
- RTPS_NBUP_STATE_VALID_INIT_RECEIVED = 1,
- RTPS_NBUP_STATE_INVALID_INIT_RECEIVED = 2,
- RTPS_NBUP_STATE_VALID_ACK_RECEIVED = 3,
- RTPS_NBUP_STATE_INVALID_ACK_RECEIVED = 4,
- RTPS_NBUP_STATE_VALID_NACK_RECEIVED = 5,
- RTPS_NBUP_STATE_INVALID_NACK_RECEIVED = 6,
- RTPS_NBUP_STATE_INITIALIZATION_FAILED = 7
- }eRTPS_NBUP_STATE;
- //ErrorCode:NbUP协商错误码;
- #define RTPS_NBUP_ERRCODE_0 0 //: CRC error of frame header.
- #define RTPS_NBUP_ERRCODE_1 1 //: CRC error of frame payload.
- #define RTPS_NBUP_ERRCODE_2 2 //: Unexpected frame number.
- #define RTPS_NBUP_ERRCODE_3 3 //: Frame loss.
- #define RTPS_NBUP_ERRCODE_4 4 //: PDU type unknown.
- #define RTPS_NBUP_ERRCODE_5 5 //: Unknown procedure.
- #define RTPS_NBUP_ERRCODE_6 6 //: Unknown reserved value.
- #define RTPS_NBUP_ERRCODE_7 7 //: Unknown field.
- #define RTPS_NBUP_ERRCODE_8 8 //: Frame too short.
- #define RTPS_NBUP_ERRCODE_9 9 //: Missing fields.
- //#define RTPS_NBUP_ERRCODE_10–15 : spare.
- #define RTPS_NBUP_ERRCODE_16 16 //: Unexpected PDU type.
- //#define RTPS_NBUP_ERRCODE_17 : spare.
- #define RTPS_NBUP_ERRCODE_18 18 //: Unexpected procedure.
- #define RTPS_NBUP_ERRCODE_19 19 //: Unexpected RFCI.
- #define RTPS_NBUP_ERRCODE_20 20 //: Unexpected value.
- //#define RTPS_NBUP_ERRCODE_21–41 : spare.
- #define RTPS_NBUP_ERRCODE_42 42 //: Initialisation failure.
- #define RTPS_NBUP_ERRCODE_43 43 //: Initialisation failure (network error, timer expiry).
- #define RTPS_NBUP_ERRCODE_44 44 //: Initialisation failure (Iu UP function error, repeated NACK).
- #define RTPS_NBUP_ERRCODE_45 45 //: Rate control failure.
- #define RTPS_NBUP_ERRCODE_46 46 //: Error event failure.
- #define RTPS_NBUP_ERRCODE_47 47 //: Time Alignment not supported.
- #define RTPS_NBUP_ERRCODE_48 48 //: Requested Time Alignment not possible.
- #define RTPS_NBUP_ERRCODE_49 49 //: Iu UP Mode version not supported.
- //#define RTPS_NBUP_ERRCODE_50–63 : spare.
- typedef struct {
- UCHAR Progress; //NbUP协商进展, refer to eRTPS_NBUP_PROGRESS
- UCHAR State; //NbUP协商状态, refer toeRTPS_NBUP_STATE
- UCHAR ErrorCode; //协商错误码, refer to RTPS_NBUP_ERRCODE_x
- }NBUP_STATUS;
- typedef struct {
- INT iRetVal;
- INT ChanId;
- UINT uLen;
- union{
- RTPS_ENDPOINT endpoint;
- NBUP_CODERTYPE nbupcoder;
- NBUP_STATUS nbupstatus;
- }u;
- }RTPS_EVTDATA;
- #pragma pack()
- typedef enum{
- ECLength10MSec=0,
- ECLength15MSec=1,
- ECLength20MSec=2,
- ECLength25MSec=3,
- // ECLength30MSec=4,
- ECLength32MSec=4,
- // ECLength35MSec=5,
- // ECLength40MSec=6,
- // ECLength45MSec=7,
- // ECLength50MSec=8,
- // ECLength55MSec=9,
- // ECLength60MSec=10,
- // ECLength64MSec=11,
- ECLength128MSec=22
- }eECLength;
- typedef enum{
- AGC_GAIN_SLOPE_0_25_DB_SEC=0,
- AGC_GAIN_SLOPE_0_50_DB_SEC=1,
- AGC_GAIN_SLOPE_0_75_DB_SEC=2,
- AGC_GAIN_SLOPE_1_00_DB_SEC=3,
- AGC_GAIN_SLOPE_1_25_DB_SEC=4,
- AGC_GAIN_SLOPE_1_50_DB_SEC=5,
- AGC_GAIN_SLOPE_1_75_DB_SEC=6,
- AGC_GAIN_SLOPE_2_00_DB_SEC=7,
- AGC_GAIN_SLOPE_2_50_DB_SEC=8,
- AGC_GAIN_SLOPE_3_00_DB_SEC=9,
- AGC_GAIN_SLOPE_3_50_DB_SEC=10,
- AGC_GAIN_SLOPE_4_00_DB_SEC=11,
- AGC_GAIN_SLOPE_4_50_DB_SEC=12,
- AGC_GAIN_SLOPE_5_00_DB_SEC=13,
- AGC_GAIN_SLOPE_5_50_DB_SEC=14,
- AGC_GAIN_SLOPE_6_00_DB_SEC=15,
- AGC_GAIN_SLOPE_7_00_DB_SEC=16,
- AGC_GAIN_SLOPE_8_00_DB_SEC=17,
- AGC_GAIN_SLOPE_9_00_DB_SEC=18,
- AGC_GAIN_SLOPE_10_00_DB_SEC=19,
- AGC_GAIN_SLOPE_11_00_DB_SEC=20,
- AGC_GAIN_SLOPE_12_00_DB_SEC=21,
- AGC_GAIN_SLOPE_13_00_DB_SEC=22,
- AGC_GAIN_SLOPE_14_00_DB_SEC=23,
- AGC_GAIN_SLOPE_15_00_DB_SEC=24,
- AGC_GAIN_SLOPE_20_00_DB_SEC=25,
- AGC_GAIN_SLOPE_25_00_DB_SEC=26,
- AGC_GAIN_SLOPE_30_00_DB_SEC=27,
- AGC_GAIN_SLOPE_35_00_DB_SEC=28,
- AGC_GAIN_SLOPE_40_00_DB_SEC=29,
- AGC_GAIN_SLOPE_50_00_DB_SEC=30,
- AGC_GAIN_SLOPE_70_00_DB_SEC=31
- }eAGC_GAIN_SLOPE;
- typedef struct ipm_close_info_tag
- {
- INT nRFU;
- }IPM_CLOSE_INFO, *PIPM_CLOSE_INFO;
- typedef struct ipm_stop_info_tag
- {
- INT nRFU;
- }IPM_STOP_INFO, * PIPM_STOP_INFO;
- typedef enum
- {
- STOP_RECEIVE_DIGITS = 0x02,
- STOP_MEDIA = 0x06,
- STOP_ALL = 0x07
- }eIPM_STOP_OPERATION;
- #ifndef eIPM_DIGIT_TYPE
- typedef enum
- {
- DIGIT_ALPHA_NUMERIC = 0x00, //DTMF
- DIGIT_USER_DEFINED_TONES= 0x01, //user define TONE
- DIGIT_MF_R1,
- DIGIT_MF_R2_FORWARD,
- DIGIT_MF_R2_BACKWARD,
- DIGIT_LINE,
- DIGIT_CALL_PROGRESS,
- }eIPM_DIGIT_TYPE;
- #endif
- #ifndef eIPM_DIGIT_DIRECTION
- typedef enum
- {
- DIGIT_TDM = 0x00, //TDM
- DIGIT_IP = 0x01, //IP(RFC 2833)
- DIGIT_H324M = 0x02, //3G-324M
- DIGIT_IP_INBAND = 0x03 //IP(inbound)
- }eIPM_DIGIT_DIRECTION;
- #endif
- typedef struct ipm_digit_info_tag
- {
- eIPM_DIGIT_TYPE eDigitType; /* Type of digits - DTMF, ALPHA-NUMERIC */
- eIPM_DIGIT_DIRECTION eDigitDirection; /* The direction of flow of digits */
- CHAR cDigits[MAX_IPM_DIGITS];/* the digits */
- UINT unNumberOfDigits; /* Number of digits */
- UINT unTimeStamp;
- UINT unExpirationTime;
- UINT unDuration;
- UINT unInterval;
- CHAR cState[MAX_IPM_DIGITS]; /* Digit State */
- } IPM_DIGIT_INFO, *PIPM_DIGIT_INFO;
- typedef enum
- {
- SIGNAL_STATE_OFF = 0x0,
- SIGNAL_STATE_ON = 0x1
- }eIPM_SIGNAL_STATE;
- typedef enum
- {
- SIGNAL_ID_EVENT_DTMF_0 = 0x0,
- SIGNAL_ID_EVENT_DTMF_1 = 0x1,
- SIGNAL_ID_EVENT_DTMF_2 = 0x2,
- SIGNAL_ID_EVENT_DTMF_3 = 0x3,
- SIGNAL_ID_EVENT_DTMF_4 = 0x4,
- SIGNAL_ID_EVENT_DTMF_5 = 0x5,
- SIGNAL_ID_EVENT_DTMF_6 = 0x6,
- SIGNAL_ID_EVENT_DTMF_7 = 0x7,
- SIGNAL_ID_EVENT_DTMF_8 = 0x8,
- SIGNAL_ID_EVENT_DTMF_9 = 0x9,
- SIGNAL_ID_EVENT_DTMF_STAR = 0xa,
- SIGNAL_ID_EVENT_DTMF_POUND = 0xb,
- SIGNAL_ID_EVENT_DTMF_A = 0xc,
- SIGNAL_ID_EVENT_DTMF_B = 0xd,
- SIGNAL_ID_EVENT_DTMF_C = 0xe,
- SIGNAL_ID_EVENT_DTMF_D = 0xf,
- SIGNAL_ID_EVENT_DTMF_FLASH = 0x10,
- SIGNAL_ID_EVENT_LINE_OFFHOOK = 0x40,
- SIGNAL_ID_EVENT_LINE_ONHOOK = 0x41,
- SIGNAL_ID_EVENT_LINE_DIAL_TONE = 0x42,
- SIGNAL_ID_EVENT_LINE_PABX_INTERNALDIAL_TONE = 0x43,
- SIGNAL_ID_EVENT_LINE_SPECIALDIAL_TONE = 0x44,
- SIGNAL_ID_EVENT_LINE_SECONDDIAL_TONE = 0x45,
- SIGNAL_ID_EVENT_LINE_RINGING_TONE = 0x46,
- SIGNAL_ID_EVENT_LINE_SPECIALRINGING_TONE = 0x47,
- SIGNAL_ID_EVENT_LINE_BUSY_TONE = 0x48,
- SIGNAL_ID_EVENT_LINE_CONGESTION_TONE = 0x49,
- SIGNAL_ID_EVENT_LINE_SPECIALINFORMATION_TONE = 0x4a,
- SIGNAL_ID_EVENT_LINE_COMFORT_TONE = 0x4b,
- SIGNAL_ID_EVENT_LINE_HOLD_TONE = 0x4c,
- SIGNAL_ID_EVENT_LINE_RECORD_TONE = 0x4d,
- SIGNAL_ID_EVENT_LINE_CALLERWAITING_TONE = 0x4e,
- SIGNAL_ID_EVENT_LINE_CALLWAITING_TONE = 0x4f,
- SIGNAL_ID_EVENT_LINE_PAY_TONE = 0x50,
- SIGNAL_ID_EVENT_LINE_POSITIVEINDICATION_TONE = 0x51,
- SIGNAL_ID_EVENT_LINE_NEGATIVEINDICATION_TONE = 0x52,
- SIGNAL_ID_EVENT_LINE_WARNING_TONE = 0x53,
- SIGNAL_ID_EVENT_LINE_INTRUSION_TONE = 0x54,
- SIGNAL_ID_EVENT_LINE_CALLINGCARDSERVICE_TONE = 0x55,
- SIGNAL_ID_EVENT_LINE_PAYPHONERECOGNITION_TONE = 0x56,
- SIGNAL_ID_EVENT_LINE_CPE_ALERTINGSIGNAL_ID_CAS = 0x57,
- SIGNAL_ID_EVENT_LINE_OFFHOOKWARNING_TONE = 0x58,
- SIGNAL_ID_EVENT_LINE_RING = 0x59,
- SIGNAL_ID_EVENT_LINE_ACCEPTANCE_TONE = 0x60,
- SIGNAL_ID_EVENT_LINE_CONFIRMATION_TONE = 0x61,
- SIGNAL_ID_EVENT_LINE_DIALTONE_RECALL = 0x62,
- SIGNAL_ID_EVENT_LINE_ENDOFTHREEPARTYSERVICE_TONE= 0x63,
- SIGNAL_ID_EVENT_LINE_FACILITIES_TONE = 0x64,
- SIGNAL_ID_EVENT_LINE_LINELOCKOUT_TONE = 0x65,
- SIGNAL_ID_EVENT_LINE_NUMBERUNOBTAINABLE_TONE = 0x66,
- SIGNAL_ID_EVENT_LINE_OFFERING_TONE = 0x67,
- SIGNAL_ID_EVENT_LINE_PERMANENTSIGNAL_ID_TONE = 0x68,
- SIGNAL_ID_EVENT_LINE_PREEMPTION_TONE = 0x69,
- SIGNAL_ID_EVENT_LINE_QUEUE_TONE = 0x6a,
- SIGNAL_ID_EVENT_LINE_REFUSAL_TONE = 0x6b,
- SIGNAL_ID_EVENT_LINE_ROUTE_TONE = 0x6c,
- SIGNAL_ID_EVENT_LINE_VALID_TONE = 0x6d,
- SIGNAL_ID_EVENT_LINE_WAITING_TONE = 0x6e,
- SIGNAL_ID_EVENT_LINE_WARNING_TONE_ENDOFPERIOD = 0x6f,
- SIGNAL_ID_EVENT_LINE_WARNING_TONE_PIPTONE = 0x70,
- SIGNAL_ID_EVENT_TRUNK_MF_0 = 0x80,
- SIGNAL_ID_EVENT_TRUNK_MF_1 = 0x81,
- SIGNAL_ID_EVENT_TRUNK_MF_2 = 0x82,
- SIGNAL_ID_EVENT_TRUNK_MF_3 = 0x83,
- SIGNAL_ID_EVENT_TRUNK_MF_4 = 0x84,
- SIGNAL_ID_EVENT_TRUNK_MF_5 = 0x85,
- SIGNAL_ID_EVENT_TRUNK_MF_6 = 0x86,
- SIGNAL_ID_EVENT_TRUNK_MF_7 = 0x87,
- SIGNAL_ID_EVENT_TRUNK_MF_8 = 0x88,
- SIGNAL_ID_EVENT_TRUNK_MF_9 = 0x89,
- SIGNAL_ID_EVENT_TRUNK_MF_K0_OR_KP_STARTOFPULSING= 0x8a,
- SIGNAL_ID_EVENT_TRUNK_MF_K1 = 0x8b,
- SIGNAL_ID_EVENT_TRUNK_MF_K2 = 0x8c,
- SIGNAL_ID_EVENT_TRUNK_MF_S0_TO_ST_ENDOFPULSING = 0x8d,
- SIGNAL_ID_EVENT_TRUNK_MF_S1 = 0x8e,
- SIGNAL_ID_EVENT_TRUNK_MF_S2 = 0x8f,
- SIGNAL_ID_EVENT_TRUNK_ABCD_SIGNALING_0 = 0x90,
- SIGNAL_ID_EVENT_TRUNK_ABCD_SIGNALING_1 = 0x91,
- SIGNAL_ID_EVENT_TRUNK_ABCD_SIGNALING_2 = 0x92,
- SIGNAL_ID_EVENT_TRUNK_ABCD_SIGNALING_3 = 0x93,
- SIGNAL_ID_EVENT_TRUNK_ABCD_SIGNALING_4 = 0x94,
- SIGNAL_ID_EVENT_TRUNK_ABCD_SIGNALING_5 = 0x95,
- SIGNAL_ID_EVENT_TRUNK_ABCD_SIGNALING_6 = 0x96,
- SIGNAL_ID_EVENT_TRUNK_ABCD_SIGNALING_7 = 0x97,
- SIGNAL_ID_EVENT_TRUNK_ABCD_SIGNALING_8 = 0x98,
- SIGNAL_ID_EVENT_TRUNK_ABCD_SIGNALING_9 = 0x99,
- SIGNAL_ID_EVENT_TRUNK_ABCD_SIGNALING_10 = 0x9a,
- SIGNAL_ID_EVENT_TRUNK_ABCD_SIGNALING_11 = 0x9b,
- SIGNAL_ID_EVENT_TRUNK_ABCD_SIGNALING_12 = 0x9c,
- SIGNAL_ID_EVENT_TRUNK_ABCD_SIGNALING_13 = 0x9d,
- SIGNAL_ID_EVENT_TRUNK_ABCD_SIGNALING_14 = 0x9e,
- SIGNAL_ID_EVENT_TRUNK_ABCD_SIGNALING_15 = 0x9f,
- SIGNAL_ID_EVENT_TRUNK_WINK = 0xa0,
- SIGNAL_ID_EVENT_TRUNK_WINKOFF = 0xa1,
- SIGNAL_ID_EVENT_TRUNK_INCOMING_SEIZURE = 0xa2,
- SIGNAL_ID_EVENT_TRUNK_SEIZURE = 0xa3,
- SIGNAL_ID_EVENT_TRUNK_UNSEIZE_CIRCUIT = 0xa4,
- SIGNAL_ID_EVENT_TRUNK_CONTINUITY_TEST = 0xa5,
- SIGNAL_ID_EVENT_TRUNK_DEFAULT_CONTINUITY_TONE = 0xa6,
- SIGNAL_ID_EVENT_TRUNK_CONTINUITY_TONE_SINGLETONE= 0xa7,
- SIGNAL_ID_EVENT_TRUNK_CONTINUITY_TESTSEND = 0xa8,
- SIGNAL_ID_EVENT_TRUNK_CONTINUITY_VERIFIED = 0xa9,
- SIGNAL_ID_EVENT_TRUNK_LOOPBACK = 0xaa,
- SIGNAL_ID_EVENT_TRUNK_OLD_MILLIWATT_TONE = 0xab,
- SIGNAL_ID_EVENT_TRUNK_NEW_MILLIWATT_TONE = 0xac
- } eIPM_RFC2833_SIGNAL_ID;
- typedef struct ipm_rfc2833_signalid_info_tag
- {
- eIPM_RFC2833_SIGNAL_ID eSignalID;//Signal ID value. Refer to the ipmlib.h
- //or RFC2833 standard
- eIPM_SIGNAL_STATE eState; //State. 0 indicates OFF. 1 indicates ON. It is
- //valid only when usOnTime is (USHORT)-1
- USHORT usOnTime; //Duration that shall not exceed 8000 ms
- }IPM_RFC2833_SIGNALID_INFO;
- typedef enum
- {
- EVT_RFC2833 = 0x0200,
- EVT_ENERGY_DETECTOR = 0x0400,
- EVT_ANSWER_DETECTOR = 0x0401,
- EVT_FAX = 0x0402,
- EVT_RTP_TIMEOUT = 0x0403,
- }eIPM_EVENT;
- /*
- * ISX_ipm_SwitchVF (cDirection)
- */
- enum{
- IPM_SWITCH_VOICE2FAX = 0,
- IPM_SWITCH_FAX2VOICE = 1,
- };
- /* Event list */
- #define IPMEV_MASK 0x9000
- #define IPMEV_STARTMEDIA (IPMEV_MASK | 0x02)
- #define IPMEV_STOPPED (IPMEV_MASK | 0x03)
- #define IPMEV_GET_SESSION_INFO (IPMEV_MASK | 0x05)
- #define IPMEV_SEND_DIGITS (IPMEV_MASK | 0x09)
- #define IPMEV_RECEIVE_DIGITS (IPMEV_MASK | 0x0a)
- #define IPMEV_DIGITS_RECEIVED (IPMEV_MASK | 0x0b)
- #define IPMEV_EVENT_ENABLED (IPMEV_MASK | 0x0c)
- #define IPMEV_EVENT_DISABLED (IPMEV_MASK | 0x0d)
- #define IPMEV_SET_PARM (IPMEV_MASK | 0x13)
- #define IPMEV_GET_PARM (IPMEV_MASK | 0x14)
- #define IPMEV_SEND_SIGNAL_TO_IP (IPMEV_MASK | 0x16)
- #define IPMEV_ERROR (IPMEV_MASK | 0x1e)
- #define IPMEV_ENERGY (IPMEV_MASK | 0x20)
- #define IPMEV_ANSWER (IPMEV_MASK | 0x21)
- #define IPMEV_FAX (IPMEV_MASK | 0x22)
- #define IPMEV_RTP_TIMEOUT (IPMEV_MASK | 0x23)
- #define IPMEV_SWITCH_VF (IPMEV_MASK | 0x24)
- #if defined(__cplusplus)
- extern "C" {
- #endif
- /************************************************************************/
- /* Function: ISX_ipm_Open()
- Description:
- The function opens an IPM channel device. If the opening is successful, a device handle is returned.
- The IPM channel device can only be opened by one process. That is, if process A has opened a IPM
- channel device successfully and process B tries to open the same device, failure is returned,
- unless process A has closed the IPM channel device.
- The device handle returned by the function is defined by Ehangcom itself, and it’s not a standard
- operating system file handle. Therefore, using operating system commands such as read(), write()
- or ioctl() to operate the handle may cause unpredictable results.
-
- Note: if channel=-1 then open xoip board device handle.
- Return value:
- >0 returns a device handle
- -1 failure
- Parameter:
- -nodenum
- Node number. The parameter nodeno indicates an ISX4000 node number.
- -brdnum
- IPM daughter board number
- -channel
- IPM channel number
- -pusrattr
- Pointer to buffer where a user defined attribute is stored
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ipm_Open(CHAR nodenum, CHAR brdnum, SHORT channel, VOID* pusrattr = 0);
- /************************************************************************/
- /* Function: ISX_ipm_Close()
- Description:
- Description
- The function closes a IPM channel device handle (that is returned after the device is opened by
- ISX_ipm_Close()). The function does not change any state of the device (such as switch state).
- It only releases the device handle and breaks the link between the calling process and the device.
- Note: ISX_ipm_Close( ) prohibits all events related to the device.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -nDeviceHandle
- IPM channel device handle
- -pCloseInfo
- Reserved for the future expansion
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ipm_Close(INT nDeviceHandle, IPM_CLOSE_INFO* pCloseInfo = NULL);
- /************************************************************************/
- /* Function: ISX_ipm_Listen()
- Description:
- The function establishes switching between the receiving terminal of the IPM channel device
- (receiving time slot) and a time slot (transmitting terminal of another device) so that this
- IPM channel device can receive the data from this time slot and this function sets up a
- half-switching of the IPM channel. Both switching devices must be located in the same node.
- Cross-node device switching must use the optical interface trunk channel. For details, refer to
- relevant documents.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -nDeviceHandle
- IPM channel device handle returned by the ISX_ipm_Open( ) function
- -sc_tsinfop
- Specifies a pointer to the SC_TSINFO structure
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ipm_Listen( INT nDeviceHandle, SC_TSINFO *sc_tsinfop );
- /************************************************************************/
- /* Function: ISX_ipm_UnListen()
- Description:
- The function disconnects the switching between the receiving terminal of the IPM channel
- device and the connected transmitting time slot. Successful calling of ISX_ipm_Listen()
- automatically disconnects the original switching between the receiving terminal of the IPM
- channel device and the connected transmitting time slot. Therefore, when the connection is
- changed, the ISX_ipm_Unlisten( ) function need not be called.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -nDeviceHandle
- IPM channel device handle returned by the ISX_ipm_Open( ) function
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ipm_UnListen( INT nDeviceHandle );
- /************************************************************************/
- /* Function: ISX_ipm_GetXmitSlot()
- Description:
- The ISX_ipm_GetXmitSlot function returns the time slot of the transmitting terminal of a
- specified IPM channel device. Time slot information is stored in the SC_TSINFO structure.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -nDeviceHandle
- Valid IPM channel device handle
- -sc_tsinfop
- Pointer to the SC_TSINFO structure to obtain time slot information
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ipm_GetXmitSlot( INT nDeviceHandle, SC_TSINFO *sc_tsinfop);
- /************************************************************************/
- /* Function: ISX_ipm_Set2Default()
- Description:
- The ISX_ipm_Set2Default() function initializes the fields of the XOIP_CFG structure
- to the default value of SDK.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -pXoipCfg
- Pointer to the IPM parameter structure. For details, refer to the description of XOIP_CFG.
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ipm_Set2Default(XOIP_CFG* pXoipCfg);
- /************************************************************************/
- /* Function: ISX_ipm_SetParm()
- Description:
- The ISX_ipm_SetParm() function sets IPM channel parameters.
- Termination events:
- IPMEV_SET_PARM: The operation is successful. Specified channel parameters have been successfully modified.
- IPMEV_ERROR: It indicates that the function calling fails.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -nDeviceHandle
- IPM device handle
- -pXoipCfg
- Pointer to IPM parameters. For details, refer to the description of the XOIP_CFG structure.
- -usMode
- Asynchronous/synchronous mode
- -ulOperIndex
- Operation number: Valid for the asynchronous operation only
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ipm_SetParm(INT nDeviceHandle, XOIP_CFG *pXoipCfg, USHORT usMode, UINT ulOperIndex = 0);
- /************************************************************************/
- /* Function: ISX_ipm_GetParm()
- Description:
- The ISX_ipm_GetParm() function obtains the current parameters of the IPM channel.
- Termination events:
- IPMEV_GET_PARM: The operation is successful. Specified channel parameters are copied to the pXoipCfg structure.
- IPMEV_ERROR: It indicates that the function calling fails.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -nDeviceHandle
- IPM device handle
- -pXoipCfg
- Pointer to IPM parameters. For details, refer to the description of the XOIP_CFG structure.
- -usMode
- Asynchronous/synchronous mode
- -ulOperIndex
- Operation number: Valid for the asynchronous operation only
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ipm_GetParm(INT nDeviceHandle, XOIP_CFG *pXoipCfg, USHORT usMode, UINT ulOperIndex = 0);
- /************************************************************************/
- /* Function: ISX_ipm_GetSessionInfo()
- Description:
- The ISX_ipm_GetSessionInfo() function queries statistical information about QOS and RTCP
- of the media session of a specified IPM channel.
- Termination events:
- IPMEV_GET_SESSION_INFO: The operation is successful. Session Info is stored in the address
- at which pSessionInfo points.
- IPMEV_ERROR: It indicates that the function calling fails.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -nDeviceHandle
- IPM device handle
- -pSessionInfo
- Pointer to the address where the queried Session Info is stored. Refer to the description of
- the XOIP_SESSION_INFO structure.
- -usMode
- Asynchronous/synchronous mode
- -ulOperIndex
- Operation number: Valid for the asynchronous operation only
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ipm_GetSessionInfo(INT nDeviceHandle, XOIP_SESSION_INFO *pSessionInfo, USHORT usMode, UINT ulOperIndex = 0);
- /************************************************************************/
- /* Function: ISX_ipm_StartMedia()
- Description:
- The ISX_ipm_StartMedia() function sets IPM channel media attributes and then activates a session.
- This function activates an RTP stream. Information about RTP/RTCP, encoder, etc. is specified in
- the XOIP_CFG structure.
- Termination events:
- IPMEV_START_MEDIA: The operation is successful. The channel parameters have been successfully
- set and the session activated.
- IPMEV_ERROR: It indicates that the function calling fails.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -nDeviceHandle
- IPM device handle
- -pSrcAddr
- Pointer to the source address information. Refer to the description of the XOIP_SRCADD structure.
- -pXoipCfg
- IPM channel parameter. Refer to the description of the XOIP_CFG structure.
- -usMode
- Asynchronous/synchronous mode
- 0ulOperIndex
- Operation number: Valid for the asynchronous operation only
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ipm_StartMedia(INT nDeviceHandle, XOIP_SRCADD* pSrcAddr, XOIP_CFG* pCfg, USHORT usMode, UINT ulOperIndex = 0);
- /************************************************************************/
- /* Function: ISX_ipm_Stop()
- Description:
- The ISX_ipm_Stop() function stops some operations of the IPM channel (such as Media
- Session, digit receiving, etc.)
- Termination events:
- IPMEV_STOPPED: The operation is successful. Corresponding operations have stopped.
- IPMEV_ERROR: It indicates that the function calling fails.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -nDeviceHandle
- IPM device handle
- -eOperation
- Specifies an operation to be stopped. Refer to eIPM_STOP_OPERATION. It includes the following:
- STOP_RECEIVE_DIGITS: Stops receiving digits.
- STOP_MEDIA: Stops media sessions.
- STOP_ALL: Stops all operations.
- -usMode
- Asynchronous/synchronous mode
- -ulOperIndex
- Operation number: Valid for the asynchronous operation only
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ipm_Stop(INT nDeviceHandle, eIPM_STOP_OPERATION eOperation, USHORT usMode, UINT ulOperIndex = 0);
- /************************************************************************/
- /* Function: ISX_ipm_SendDigits()
- Description:
- The ISX_ipm_SendDigits() function sends digits in a specified direction (TDM or IP address).
- Digits that are sent in the IP address direction can only be inband and shall not be RFC2833.
- Currently, digits can be sent only in the TDM direction.
- Termination events:
- IPMEV_SEND_DIGITS: The operation is successful. It indicates that digits
- have been successfully sent.
- IPMEV_ERROR: It indicates that the function calling fails.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -nDeviceHandle
- IPM device handle
- -pDigitInfo
- Buffer address of digits to be sent. For details, refer to the description of the
- IPM_DIGIT_INFO structure.
- -usMode
- Asynchronous/synchronous mode
- -ulOperIndex
- Operation number: Valid for the asynchronous operation only
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ipm_SendDigits(INT nDeviceHandle, IPM_DIGIT_INFO *pDigitInfo, USHORT usMode, UINT ulOperIndex = 0);
- /************************************************************************/
- /* Function: ISX_ipm_ReceiveDigits()
- Description:
- The ISX_ipm_ReceiveDigits() function enables the receiving of digits from an IP network or TDM.
- If you want to disable the receiving of digits, call ISX_ipm_Stop(nDeviceHandle, eSTOP_RECEIVE_DIGITS,…).
- Termination events:
- IPMEV_RECEIVE_DIGITS: The operation is successful, but it does not indicate that digits have been received.
- IPMEV_ERROR: It indicates that the function calling fails.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -nDeviceHandle
- IPM device handle
- -pDigitInfo
- return digit information for the synchronous operation
- -usMode
- Asynchronous/synchronous mode
- -ulOperIndex
- Operation number: Valid for the asynchronous operation only
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ipm_ReceiveDigits(INT nDeviceHandle, IPM_DIGIT_INFO *pDigitInfo, USHORT usMode, UINT ulOperIndex = 0);
- /************************************************************************/
- /* Function: ISX_ipm_SendRFC2833SignalIDToIP()
- Description:
- The ISX_ipm_SendRFC2833SignalIDToIP() function sends an RFC2833 signal to an IP address.
- Termination events:
- IPMEV_SEND_SIGNAL_TO_IP: The operation is successful. It indicates that the RFC2833 signal
- has been successfully sent.
- IPMEV_ERROR: It indicates that the function calling fails.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -nDeviceHandle
- IPM device handle
- -pSignalInfo
- Address of RFC2833 signal information to be sent. For details, refer to the description of
- the IPM_RFC2833_SIGNALID_INFO structure.
- -usMode
- Asynchronous/synchronous mode
- -ulOperIndex
- Operation number: Valid for the asynchronous operation only
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ipm_SendRFC2833SignalIDToIP(INT nDeviceHandle, IPM_RFC2833_SIGNALID_INFO *pSignalInfo, USHORT usMode, UINT ulOperIndex = 0);
- /************************************************************************/
- /* Function: ISX_ipm_EnableEvents()
- Description:
- The ISX_ipm_EnableEvents() function enables the receiving of IP notification events such as
- detected DTMF, fax start, etc. After the receiving of an event is enabled, this event is
- generated and SDK sends this event to a channel event queue. The user can obtain the event
- details through the SRL function.
- Termination events:
- IPMEV_EVENT_ENABLED: The operation is successful. The receiving of a specified event is enabled.
- This event has no additional data.
- IPMEV_ERROR: It indicates that the function calling fails.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -nDeviceHandle
- IPM device handle
- -pEvents
- Pointer to the address of the event list to be enabled. Refer to eIPM_EVENT.
- Event types include the following:
- EVT_ENERGY_DETECTOR: Energy event;
- EVT_ANSWER_DETECTOR: Answer event;
- EVT_FAX: Fax event;
- EVT_RTP_TIMEOUT: RTP timeout event.
- -unNumofEvents
- Number of event types to be enabled
- -usMode
- Asynchronous/synchronous mode
- -ulOperIndex
- Operation number: Valid for the asynchronous operation only
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ipm_EnableEvents(INT nDeviceHandle, eIPM_EVENT *pEvents, UINT unNumofEvents, USHORT usMode, UINT ulOperIndex = 0);
- /************************************************************************/
- /* Function: ISX_ipm_DisableEvents()
- Description:
- The ISX_ipm_DisableEvents() function disables the receiving of IP notification events such as
- detected DTMF, fax start, etc. When the receiving of an event is disabled and the system detects
- this event, SDK omits it.
- Termination events:
- IPMEV_EVENT_DISABLED: The operation is successful. The receiving of a specified event is disabled.
- This event has no additional data.
- IPMEV_ERROR: It indicates that the function calling fails.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -nDeviceHandle
- IPM device handle
- -pEvents
- Pointer to the address of the event list to be disabled. Refer to eIPM_EVENT.
- -unNumofEvents
- Number of event types to be disabled
- -usMode
- Asynchronous/synchronous mode
- -ulOperIndex
- Operation number: Valid for the asynchronous operation only
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ipm_DisableEvents(INT nDeviceHandle, eIPM_EVENT *pEvents, UINT unNumofEvents, USHORT usMode, UINT ulOperIndex = 0);
- /************************************************************************/
- /* Function: ISX_ipm_GetUsrAttr()
- Description:
- The ISX_ipm_GetUsrAttr() function obtains the user-defined attributes (that are set through
- ISX_ipm_Open() or ISX_ipm_SetUsrAttr()).
- Return value:
- 0 success
- -1 failure
- Parameter:
- -dev
- Valid IPM device handle
- -usr_attrp
- Pointer to the address where the user attributes are obtained
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ipm_GetUsrAttr(INT dev, VOID **usr_attrp);
- /************************************************************************/
- /* Function: ISX_ipm_SetUsrAttr()
- Description:
- The ISX_ipm_SetUsrAttr() function sets channel attributes (user-defined). User attributes
- that are set by the user can be obtained through the ISX_ipm_GetUsrAttr() function.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -dev
- IPM device handle
- -usr_attr
- User defined attributes that the application can obtain through the ISX_ipm_GetUsrAttr() function
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ipm_SetUsrAttr(INT dev, VOID *usr_attr);
- /************************************************************************/
- /* Function: ISX_ipm_SwitchVF()
- Description:
- The ISX_ipm_SwitchVF() function performs changeover between the voice and fax modes of the IPM
- channel. This function is generally called after GCEV_SIP_RECVREINVITE event is received.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -nDeviceHandle
- IPM device handle
- -cDirection
- Switchover mode. It includes the following:
- IPM_SWITCH_VOICE2FAX: Voice..fax switchover
- IPM_SWITCH_FAX2VOICE: Fax..voice switchover
- -usMode
- Asynchronous/synchronous mode
- -ulOperIndex
- Operation number: Valid for the asynchronous operation only
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ipm_SwitchVF(INT nDeviceHandle, CHAR cDirection, USHORT usMode, UINT ulOperIndex = 0);
- /************************************************************************/
- /* Function: ISXE_ipm_SetParam()
- Description:
- The ISXE_ipm_SetParam() function set XOIP's parameter.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -dev
- Xoip board device for ISX_ipm_Open().
- -parmid
- parameter id:
- IPM_PARMID_RTP_CODEC
- IPM_PARMID_RTPS_PARAM_4RTP
- IPM_PARMID_RTPS_PARAM_4RTCP
- -pParam
- Point to parameter:
- IPM_PARMID_RTP_CODEC refer to IPM_RTP_CODEC_PARM
- IPM_PARMID_RTPS_PARAM_4RTP refer to RTPS_PARAM
- IPM_PARMID_RTPS_PARAM_4RTCP refer to RTPS_PARAM
- -usMode
- Asynchronous/synchronous mode
- Note: not support Asynchronous now.
- -ulOperIndex
- Operation number: Valid for the asynchronous operation only
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISXE_ipm_SetParam(INT dev, INT parmid, VOID* pParam, USHORT usMode=EV_SYNC, UINT ulOperIndex=0);
- /************************************************************************/
- /* Function: ISXE_ipm_GetParam()
- Description:
- The ISXE_ipm_GetParam() function get XOIP's parameter.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -dev
- Xoip board device for ISX_ipm_Open().
- -parmid
- parameter id:
- IPM_PARMID_RTP_CODEC
- -pParam
- Point to parameter:
- IPM_PARMID_RTP_CODEC refer to IPM_RTP_CODEC_PARM
- -usMode
- Asynchronous/synchronous mode
- Note: not support Asynchronous now.
- -ulOperIndex
- Operation number: Valid for the asynchronous operation only
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISXE_ipm_GetParam(INT dev, INT parmid, VOID* pParam, USHORT usMode=EV_SYNC, UINT ulOperIndex=0);
- //{{for inner test
- ISXAPI_FUNC_STDCL(INT) ISXT_ipm_SetParm(UCHAR ucIsxNo, UCHAR ucBrdNo, USHORT usCh, XOIP_CFG *pXoipCfg, USHORT usMode, UINT ulOperIndex = 0);
- ISXAPI_FUNC_STDCL(INT) ISXT_ipm_GetParm(UCHAR ucIsxNo, UCHAR ucBrdNo, USHORT usCh, XOIP_CFG *pXoipCfg, USHORT usMode, UINT ulOperIndex = 0);
- //}}
- //////////////////////////////////////////////////////////////////////////
- //RTP-Proxy Interface
- /************************************************************************/
- /* Function: ISX_ipm_RTPS_StartConnect()
- Description:
- The ISX_ipm_RTPS_StartConnect() function start RtpProxy Server.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -szServerIp
- RtpProxy Server's IP
- -iServerPort
- RtpProxy Server's PORT
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ipm_RTPS_StartConnect(CHAR* szServerIp, INT iServerPort);
- /************************************************************************/
- /* Function: ISX_ipm_RTPS_StopConnect()
- Description:
- The ISX_ipm_RTPS_StopConnect() function stop RtpProxy.
- Return value:
- 0 success
- -1 failure
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ipm_RTPS_StopConnect();
- /************************************************************************/
- /* Function: ISX_ipm_RTPS_OpenChannel()
- Description:
- The ISX_ipm_RTPS_OpenChannel() function open idle channel for RtpProxy Server.
- Return value:
- >0 dev handle
- -1 failure
- Parameter:
- -pConnAddr
- return RtpProxy Connect Address(WAN's IP)
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ipm_RTPS_OpenChannel(RTPS_ENDPOINT* pConnAddr);
- /************************************************************************/
- /* Function: ISX_ipm_RTPS_CloseChannel()
- Description:
- The ISX_ipm_RTPS_CloseChannel() function close channel for RtpProxy Server.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -dev
- Close dev handle for ISX_ipm_RTPS_OpenChannel()
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ipm_RTPS_CloseChannel(INT dev);
- #if defined(__cplusplus)
- }
- #endif
-
- #endif
|