| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939 |
- /*********************************************************************/
- /* EhangCom: API Head file
- *
- * FILE: aglib.h
- * DESCRIPTION: Header File for EhangCom analog 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 __AGLIB_H__
- #define __AGLIB_H__
- #include "IsxApi.h"
- #include "voclib.h"
- #define MAX_RING_GAP 7*1000 //Ring the maximum interval, if the interval exceeds this value, then re-calculate the number of rings
- #define MAX_RNGOFF_LEN 5*1000 //The default maximum length RINGOFF, unit: ms
- #ifndef AG_BRDTYPE_FXO
- #define AG_BRDTYPE_NULL -2 //The type of this daughter board is unknown now. Please re-query later.
- #define AG_BRDTYPE_FXO 0 //FXO daughter board. All channels of this daughter board are FXO ports.
- #define AG_BRDTYPE_FXS 1 //FXS daughter board. All channels of this daughter board are FXS ports.
- #define AG_BRDTYPE_AHR 2 //High impedance record board.
- #endif
- #define AG_ONHOOK 0 //On-hook
- #define AG_OFFHOOK 1 //Off-hook
- #define AG_CALLP 1 /* Turn on Call Analysis */
- #define MOEV_DIAL 0x100 /* Dial Completed */
- #define MOEV_CALLP 0x101 /* Call Progress Completed */
- #define MOEV_SETHOOK 0x103 /* SetHook Completed */
- #define AGEV_ERROR 0x104 /* Error Event */
- #define MSEV_RING 0x14D /* MSI Ring successful event */
- #define MSEV_NORING 0x14e /* MSI ring unsuccessful event */
- #define MSEV_SIGEVT 0x14f /* Signalling event generated */
- #define MOEV_WTRING 0x150 /* wait ring completed */
- #define MOEV_RINGS 0x151 /* FXO Rings received event */
- #define MOEV_RNGOFF 0x152 /* caller hang up event (incoming call is dropped before being accepted) */
- #define AGEV_DIGITS 0x153 /* Digit Received event */
- #define AGEV_SENDTONE 0x154 /* send tone complete */
- #define MOEV_RONHOOK 0x155 /* remote on hook */
- #define MOEV_RNGON 0x156 /* Incoming call */
- #define MSEV_RINGS 0x157 /* FXS Rings received event */
- #define MOEV_CALLERID 0x158 /* FXO CallerId event*/
- #define MHEV_SETHOOK 0x180 /* High impedance record board SetHook Completed*/
- #define AGEV_LAST 0x1ff
- #define MSEV_SIGMSK 0x140 /* Equate to be used in setevtmsk */
- /*
- * Message mask and event equates
- */
- #define MSMM_OFFHOOK 0x0001 /* Mask for channel went off hook */
- #define MSMM_RNGOFFHK 0x0002 /* Solicited off hook */
- #define MSMM_RNGSTOP 0x0004 /* User stopped ringing by stopfn() cmd */
- #define MSMM_ONHOOK 0x0008 /* Mask for channel went on hook */
- #define MSMM_HOOKFLASH 0x0010 /* Mask for hook flash detection */
- #define MSMM_TERM 0x00020 /* Mask for ring termination */
- //#define MSMM_FIRSTRING 0x0040 /* Mask for first ring off
- #define MOMM_RINGS 0x0080 /* Mask for fxo rings */
- #define MOMM_RNGOFF 0x0100 /* Mask for fxo caller hang up event */
- #define AGMM_DIGITS 0x0200 /* Mask for fxs/fxo digits */
- #define MSMM_RINGS 0x0400 /* Mask for fxs rings */
- #define MOMM_CALLERID 0x0800 /* Mask for fxo caller id event */
- #define MTF_RING 0x8a /* Stop Ringing */
- /*
- * Call Analysis termination type.
- */
- #define CR_SS_TELNUM 0 /* Send tele number succ. (weil) */
- #define CR_BUSY 7 /* Line busy */
- #define CR_NOANS 8 /* No answer */
- #define CR_NORB 9 /* No ringback */
- #define CR_CNCT 10 /* Call connected */
- #define CR_CEPT 11 /* Operator intercept */
- #define CR_STOPD 12 /* Call analysis stopped */
- #define CR_NODIALTONE 17 /* No dialtone detected */
- #define CR_FAXTONE 18 /* Fax tone detected */
- #define CR_SF_TELNUM 19 /* Send tele number fail. (weil) */
- #define CR_ERROR 0x100 /* Call analysis error */
- /*
- * Tone ID types
- */
- #define TONEID_FIRST 0
- #define TONEID_BUSY 0
- #define TONEID_DIAL 1
- #define TONEID_RINGBACK 2
- #define TONEID_HOWLER 3
- #define TONEID_BUSY1 4
- #define TONEID_RINGBACK2 5
- #define TONEID_FAX1 6
- #define TONEID_FAX2 7
- #define TONEID_HUMAN1 8
- #define TONEID_HUMAN2 9
- //...reserve
- #define TONEID_SYSEND 31
- #define TONEID_USER 32
- //User define TONE to do... 32~254
- #define TONEID_LAST 254
- #define TONEALL 0xff
- /*
- * GTD Defines
- */
- #ifndef DM_TONEON
- #define DM_TONEON 0x01 /* Tone ON Mask */
- #define DM_TONEOFF 0x02 /* Tone OFF Mask */
- #endif
- /*
- * Action values for ag_SetEvtMsk() function
- */
- #define AGACT_SETMSK 0 /* set all mask bits & clear all others */
- #define AGACT_ADDMSK 1 /* set all mask bits & ignore all others */
- #define AGACT_SUBMSK 2 /* clr all mask bits & ignore all others */
- /*
- * Equates for generic caller ID message type IDs
- */
- #define CLIDINFO_CMPLT 0x100 /* complete caller ID message */
- #define CLIDINFO_GENERAL 0x101 /* date,time,phone #,name */
- #define CLIDINFO_CALLID 0x102 /* caller ID */
- #define CLIDINFO_FRAMETYPE 0x103 /* see frame type equates */
- /*
- * Equates for CLASS
- */
- #define CLASSFRAME_SDM 0x04 /* Single Data Message caller ID frame */
- #define CLASSFRAME_MDM 0x80 /* Multiple Data Message caller ID frame */
- /* CLASS MDM message IDs */
- #define MCLASS_DATETIME 0x01 /* date and time w/o '/" & ':' */
- #define MCLASS_DN 0x02 /* calling line directory number */
- #define MCLASS_DDN 0x03 /* dialed number */
- #define MCLASS_ABSENCE1 0x04 /* caller ID absence: 'O' or 'P' */
- #define MCLASS_REDIRECT 0x05 /* call frwd-universal,busy,or unanswered */
- #define MCLASS_QUALIFIER 0x06 /* 'L' for long distance */
- #define MCLASS_NAME 0x07 /* caller name */
- #define MCLASS_ABSENCE2 0x08 /* name absence- 'O' or 'P' */
- /*
- * Equates for CLIP
- */
- #define CLIPFRAME_MDM 0x80 /* Multiple Data Message caller ID frame */
- /* CLIP message IDs */
- #define CLIP_DATETIME 0x01 /* date and time (w/o '/" & ':') */
- #define CLIP_DN 0x02 /* calling line directory number */
- #define CLIP_DDN 0x03 /* dialed number */
- #define CLIP_ABSENCE1 0x04 /* caller ID absence: 'O' or 'P' */
- #define CLIP_NAME 0x07 /* caller name */
- #define CLIP_ABSENCE2 0x08 /* name absence- 'O' or 'P' */
- #define CLIP_CALLTYPE 0x11 /* voice call,rng-bck-when-free call or msg waiting call */
- #define CLIP_NETMSG 0x13 /* no. of message waiting */
- /*
- * Equates for A-CLIP
- */
- #define ACLIPFRAME_SDM 0x04 /* Single Data Message caller ID frame */
- #define ACLIPFRAME_MDM 0x80 /* Multiple Data Message caller ID frame */
- /* A-CLIP MDM message IDs */
- #define MACLIP_DATETIME 0x01 /* date and time (w/o '/" & ':' */
- #define MACLIP_DN 0x02 /* calling line directory number */
- #define MACLIP_DDN 0x03 /* dialed number */
- #define MACLIP_ABSENCE1 0x04 /* caller ID absence: 'O' or 'P' */
- #define MACLIP_REDIRECT 0x05 /* call frwd-universal,busy,or unanswered */
- #define MACLIP_QUALIFIER 0x06 /* 'L' for long distance */
- #define MACLIP_NAME 0x07 /* caller name */
- #define MACLIP_ABSENCE2 0x08 /* name absence- 'O' or 'P' */
- /*
- * Equates for Japan Caller ID JCLIP
- */
- #define JCLIPFRAME_MDM 0x40 /* Multiple Data Message caller ID frame */
- #define JCLIP_DN 0x02 /* calling line directory number */
- #define JCLIP_DDN 0x09 /* dialed number */
- #define JCLIP_ABSENCE1 0x04 /* caller ID absence: 'O' or 'P' */
- #define JCLIP_ABSENCE2 0x08 /* name absence- 'O' or 'P' */
- /*
- * AG_CAP
- *
- * Call Analysis parameters
- * [NOTE: All user-accessible structures must be defined so as to be
- * unaffected by structure packing.]
- */
- typedef struct ag_cap {
- USHORT ca_nbrdna; /* # of rings before no answer. */
- USHORT ca_stdely; /* Delay after dialing before analysis. */
- USHORT ca_cnosig; /* Duration of no signal time out delay. */
- SHORT ca_lcdly; /* Delay after dial before lc drop connect */
- USHORT ca_lcdly1; /* Delay after lc drop con. before msg. */
- USHORT ca_hedge; /* Edge of answer to send connect message. */
- USHORT ca_cnosil; /* Initial continuous noise timeout delay. */
- USHORT ca_lo1tola; /* % acceptable pos. dev of SHORT low sig. */
- USHORT ca_lo1tolb; /* % acceptable neg. dev of SHORT low sig. */
- USHORT ca_lo2tola; /* % acceptable pos. dev of long low sig. */
- USHORT ca_lo2tolb; /* % acceptable neg. dev of long low sig. */
- USHORT ca_hi1tola; /* % acceptable pos. dev of high signal. */
- USHORT ca_hi1tolb; /* % acceptable neg. dev of high signal. */
- USHORT ca_lo1bmax; /* Maximum interval for shrt low for busy. */
- USHORT ca_lo2bmax; /* Maximum interval for long low for busy. */
- USHORT ca_hi1bmax; /* Maximum interval for 1st high for busy */
- USHORT ca_nsbusy; /* Num. of highs after nbrdna busy check. */
- USHORT ca_logltch; /* Silence deglitch duration. */
- USHORT ca_higltch; /* Non-silence deglitch duration. */
- USHORT ca_lo1rmax; /* Max. SHORT low dur. of double ring. */
- USHORT ca_lo2rmin; /* Min. long low dur. of double ring. */
- USHORT ca_intflg; /* Operator intercept mode. */
- USHORT ca_intfltr; /* Minimum signal to qualify freq. detect. */
- USHORT ca_1strngbak; /* No response in before, waiting for the first ringback tone maximum delay time (unit: 10ms), the default is 30 seconds */
- USHORT rfu2; /* reserved for future use */
- USHORT rfu3; /* reserved for future use */
- USHORT rfu4; /* reserved for future use */
- USHORT ca_hisiz; /* Used to determine which lowmax to use. */
- USHORT ca_alowmax; /* Max. low before con. if high >hisize. */
- USHORT ca_blowmax; /* Max. low before con. if high <hisize. */
- USHORT ca_nbrbeg; /* Number of rings before analysis begins. */
- USHORT ca_hi1ceil; /* Maximum 2nd high dur. for a retrain. */
- USHORT ca_lo1ceil; /* Maximum 1st low dur. for a retrain. */
- USHORT ca_lowerfrq; /* Lower allowable frequency in hz. */
- USHORT ca_upperfrq; /* Upper allowable frequency in hz. */
- USHORT ca_timefrq; /* Total duration of good signal required. */
- USHORT ca_rejctfrq; /* Allowable % of bad signal. */
- USHORT ca_cnct_t; /* After the ringback tone, FXO port is used to determine the maximum time CR_CNCT is switched on (default 50), unit: 10ms*/
- //USHORT ca_maxansr; /* Maximum duration of answer. ==ca_cnct_t*/
- USHORT ca_ansrdgl; /* Silence deglitching value for answer. */
- USHORT ca_mxtimefrq; /* max time for 1st freq to remain in bounds */
- USHORT ca_lower2frq; /* lower bound for second frequency */
- USHORT ca_upper2frq; /* upper bound for second frequency */
- USHORT ca_time2frq; /* min time for 2nd freq to remains in bounds */
- USHORT ca_mxtime2frq; /* max time for 2nd freq to remain in bounds */
- USHORT ca_lower3frq; /* lower bound for third frequency */
- USHORT ca_upper3frq; /* upper bound for third frequency */
- USHORT ca_time3frq; /* min time for 3rd freq to remains in bounds */
- USHORT ca_mxtime3frq; /* max time for 3rd freq to remain in bounds */
- USHORT ca_dtn_pres; /* Length of a valid dial tone (def=1sec) */
- USHORT ca_dtn_npres; /* Max time to wait for dial tone (def=5sec)*/ //v
- USHORT ca_dtn_deboff; /* The dialtone off debouncer (def=100ms) */
- USHORT ca_pamd_failtime; /* Wait for AMD/PVD after cadence break(default=4sec)*/
- USHORT ca_pamd_minring; /* min allowable ring duration (def=1.9sec)*/
- UCHAR ca_pamd_spdval; /* Set to 2 selects quick decision (def=1) */
- UCHAR ca_pamd_qtemp; /* The Qualification template to use for PAMD */
- USHORT ca_noanswer; /* time before no answer after first ring (default=30sec) */
- USHORT ca_maxintering; /* Max inter ring delay before connect (8 sec) */
- } AG_CAP;
- #ifdef __cplusplus
- extern "C" { // C Plus Plus function bindings
- #define extern
- #endif
- /*
- * Useful declaration specification.
- */
- /*
- * Module Definition file compatibility.
- */
- #if (defined (__BORLANDC__) || defined (__cplusplus) || defined( __STDC__ ))
- /* Function Prototypes - ANSI C & C++ */
- /************************************************************************/
- /* Function: ISX_ag_open()
- Description:
- The ISX_ag_open() function opens an analog line channel device. If the opening is successful,
- a device handle is returned. The analog line channel device can only be opened by one process.
- That is, if process A has opened an analog line channel device successfully and process B tries
- to open the same device, failure is returned, unless process A has closed the analog line 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.
- Return value:
- >0 returns the device handle
- -1 failure
- Parameter:
- -nodeno
- Node number
- -brdno
- Analog line daughter board number
- -channel
- Analog line channel number
- -iDspChH
- DSP voice channel device handle bound to this analog line channel. In case of no binding, it is set to -1.
- -usrattr
- Pointer to buffer where a user defined attribute is stored
- */
- /************************************************************************/
- #ifndef EHANG_ISXAPI_STD_C
- ISXAPI_FUNC_STDCL(INT) ISX_ag_open(CHAR nodenum, CHAR brdnum, CHAR channel, INT iDspChH=-1, VOID* pusrattr=NULL);
- #else
- ISXAPI_FUNC_STDCL(INT) ISX_ag_open(CHAR nodenum, CHAR brdnum, CHAR channel, INT iDspChH, VOID* pusrattr);
- #endif
- /************************************************************************/
- /* Function: ISX_ag_close()
- Description:
- The function closes an analog line channel device handle (that is returned after the device is
- opened by ISX_ag_open()). The function does not change any state of the device (such as switching
- state). It only releases the device handle and breaks the link between the calling process and the
- device.
- Note: After ISX_ipm_Close( ) runs successfully, it disables all events related to the device.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -dev
- Specifies a valid device handle returned by ISX_ag_open()
- -oflags
- Reserved for future use. Currently, it is useless.
- */
- /************************************************************************/
- #ifndef EHANG_ISXAPI_STD_C
- ISXAPI_FUNC_STDCL(INT) ISX_ag_close(INT dev, INT oflags = 0);
- #else
- ISXAPI_FUNC_STDCL(INT) ISX_ag_close(INT dev, INT oflags);
- #endif
- /************************************************************************/
- /* Function: ISX_ag_getbrdtype()
- Description:
- The ISX_ag_getbrdtype( ) function queries the board type of a specified analog daughter board.
- Return value:
- -1: The function calling fails. Please check the parameters.
- AG_BRDTYPE_FXO: FXO daughter board. All channels of this daughter board are FXO ports.
- AG_BRDTYPE_FXS: FXS daughter board. All channels of this daughter board are FXS ports.
- AG_BRDTYPE_NULL: The type of this daughter board is unknown now. Please re-query later.
- Parameter:
- -ucIsxNo
- Node number
- -ucBrdNo
- Analog daughter board number
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ag_getbrdtype(UCHAR ucIsxNo, UCHAR ucBrdNo);
- /************************************************************************/
- /* Function: ISX_ag_GetUsrAttr()
- Description:
- The ISX_ag_GetUsrAttr( ) function obtains the user-defined attributes (that are set through
- ISX_ag_open() and ISX_ag_SetUsrAttr()).
- Return value:
- 0 success
- <0 failure
- Parameter:
- -dev
- Valid analog line channel handle
- -usr_attrp
- Pointer to the address where the user attributes are obtained
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ag_GetUsrAttr(INT dev, VOID **usr_attrp);
- /************************************************************************/
- /* Function: ISX_ag_SetUsrAttr()
- Description:
- The ISX_ag_SetUsrAttr( ) function sets channel attributes (user-defined). User attributes that
- are set by the user can be obtained through the ISX_ag_GetUsrAttr() function.
- Return value:
- 0 success
- <0 failure
- Parameter:
- -dev
- Valid analog line channel handle
- -usrattr
- User defined attributes that the application can obtain through the ISX_ag_GetUsrAttr() function.
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ag_SetUsrAttr(INT dev, VOID *usr_attr);
- /************************************************************************/
- /* Function: ISX_ag_getxmitslot()
- Description:
- The ISX_ag_getxmitslot( ) function returns the time slot of the transmitting terminal of a specified
- analog line channel. Time slot information is stored in the SC_TSINFO structure.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -dev
- Valid analog line channel device handle
- -sc_tsinfop
- Pointer to the SC_TSINFO structure to obtain time slot information
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ag_getxmitslot(INT dev, SC_TSINFO *sc_tsinfop);
- /************************************************************************/
- /* Function: ISX_ag_listen()
- Description:
- The function establishes switching between the receiving terminal of the analog line
- channel device (receiving time slot) and a time slot (transmitting terminal of another
- device) so that this analog line channel can receive the data from this time slot and
- this function sets up a half-switching of the 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:
- -dev
- Analog line channel device handle returned by the ISX_ag_open( ) function
- -sc_tsinfop
- Specifies a pointer to the SC_TSINFO structure
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ag_listen(INT dev, SC_TSINFO *sc_tsinfop );
- /************************************************************************/
- /* Function: ISX_ag_unlisten()
- Description:
- This function interrupts the switching between the receiving terminal of the analog
- line channel device and the connected transmitting time slot.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -dev
- Analog line channel device handle returned by the ISX_ag_open( ) function
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ag_unlisten(INT dev );
- /************************************************************************/
- /* Function: ISX_ago_sethook()
- Description:
- This function performs off-hook or on-hook operation on a specified analog line channel.
- This function only applies to an FXO port line.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -dev
- Analog line channel device handle ISX_ag_open( )
- -HookState
- Flag for off-hook and on-hook: It includes the following:
- AG_OFFHOOK: Off-hook
- AG_ONHOOK: On-hook
- -mode
- Synchronous/asynchronous mode:
- EV_SYNC: Synchronous
- EV_ASYNC: Asynchronous
- -ulOperIndex
- Operation number. In the asynchronous operation mode, the number can be obtained through the
- ISX_sr_getevtoperindex() function when MOEV_SETHOOK or AGEV_ERROR is generated upon the completion
- of the operation.
- */
- /************************************************************************/
- #ifndef EHANG_ISXAPI_STD_C
- ISXAPI_FUNC_STDCL(INT) ISX_ago_sethook(INT dev, INT HookState, USHORT mode=EV_ASYNC, UINT ulOperIndex=0);
- #else
- ISXAPI_FUNC_STDCL(INT) ISX_ago_sethook(INT dev, INT HookState, USHORT mode, UINT ulOperIndex);
- #endif
- /************************************************************************/
- /* Function: ISX_ago_dial()
- Description:
- The ISX_ago_dial( ) function activates a call on a specified analog line. This function only
- applies to an FXO port analog line.
- Return value:
- Asynchronous mode: 0 success, -1 failure
- Synchronous mode:
- -1: failure
- CR_SF_TELNUM: Sent number
- Parameter:
- -dev
- Analog line channel device handle returned by ISX_ag_open( )
- -dialstrp
- Dialing number that is a string ending in 0. The numbers are characters '0'-'9', 'a', 'b',
- 'c', 'd', '*', '#' and ','. Where, ',' is a space character that indicates an interval
- of 2.5s. The maximum number length shall not exceed MAX_AGTELNUM_LEN.
- -capp
- The call progress analysis parameter AG_CAP structure. Refer to the description of the structure.
- If it is NULL, the system default parameters are used.
- -iPrdDev
- PRD device handle. Currently, an analog daughter board is unable to generate DTMF and the dialing
- required by this function is achieved by a DSP voice channel playing a DTMF voice file. Therefore,
- the device handle of the PRD where the DTMF file is located must be set.
- -mode
- Call mode. Synchronous/asynchronous mode:
- AG_CALLP: Enables call progress analysis. Audio testing of signals such as dialing tones and busy
- tones can be performed only in this mode.
- EV_SYNC: Synchronous
- EV_ASYNC: Asynchronous
- -ulOperIndex
- Operation number. In the asynchronous operation mode, the number can be obtained through the
- ISX_sr_getevtoperindex() function when MOEV_CALLP or MOEV_DIAL is generated upon the completion
- of the operation.
- */
- /************************************************************************/
- #ifndef EHANG_ISXAPI_STD_C
- ISXAPI_FUNC_STDCL(INT) ISX_ago_dial(INT dev, const CHAR *dialstrp, const AG_CAP *capp, INT iPrdDev=-1, USHORT mode=EV_ASYNC, UINT ulOperIndex=0);
- #else
- ISXAPI_FUNC_STDCL(INT) ISX_ago_dial(INT dev, const CHAR *dialstrp, const AG_CAP *capp, INT iPrdDev, USHORT mode, UINT ulOperIndex);
- #endif
- /************************************************************************/
- /* Function: ISX_ago_wtring()
- Description:
- The function waits for a specified number of rings. If a specified number of rings
- is detected, the state is off-hook or on-hook state (that is decided by the HookState
- parameter). This function only applies to the FXO port analog line.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -dev
- Analog line channel device handle returned by ISX_ag_open( )
- -numRings
- Waits for a specified number of rings
- -HookState
- Flag for off-hook and on-hook. If it is AG_OFFHOOK, off-hook is automatically performed after
- numRings is received. If it is AG_ONHOOK, off-hook is not performed and the on-hook state is
- kept after numRings is received.
- -timeout
- Timeout duration in ms. If it is -1, it indicates infinite waiting. It takes effect only in the
- synchronous mode.
- -mode
- Synchronous/asynchronous mode:
- EV_SYNC: Synchronous
- EV_ASYNC: Asynchronous
- -ulOperIndex
- Operation number. In the asynchronous operation mode, the number can be obtained through the
- ISX_sr_getevtoperindex() function when MOEV_WTRINGis generated upon the completion of the operation.
- */
- /************************************************************************/
- #ifndef EHANG_ISXAPI_STD_C
- ISXAPI_FUNC_STDCL(INT) ISX_ago_wtring(INT dev, INT numRings, INT HookState, INT timeout, USHORT mode=EV_ASYNC, UINT ulOperIndex=0);
- #else
- ISXAPI_FUNC_STDCL(INT) ISX_ago_wtring(INT dev, INT numRings, INT HookState, INT timeout, USHORT mode, UINT ulOperIndex);
- #endif
- /************************************************************************/
- /* Function: ISX_ago_gtcallid()
- Description:
- The ISX_ago_gtcallid( ) function obtains information about a calling number.
- The calling number is generally sent in the interval of the first ring.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -dev
- Analog line channel device handle returned by ISX_ag_open( )
- -bufp
- Saves information about a calling number. The maximum length of the calling
- number information is MAX_CALLID_DATA_LEN.
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ago_gtcallid( INT dev, CHAR *bufp);
- /************************************************************************/
- /* Function: ISX_ago_gtextcallid()
- Description:
- The ISX_ago_gtextcallid( ) function obtains information about CALLER ID. CALLER ID is
- generally sent in the interval of the first ring.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -dev
- Analog line channel device handle returned by ISX_ag_open( )
- -infotype
- CALLER ID Information type
- CLIDINFO_CMPLT :
- Complete CALLERID information (including the information header and length) that is up to 240 bytes
- CLIDINFO_GENERAL:
- Ordinary CALLERID information (only including the date and time, calling number and user name)
- CLIDINFO_CALLID: Calling number
- CLIDINFO_FRAMETYPE: Frame type; not supported now
- -bufp
- Stores CALLER ID information. The maximum length of the information is MAX_CALLID_DATA_LEN.
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ago_gtextcallid( INT dev, INT infotype, CHAR *bufp);
- /************************************************************************/
- /* Function: ISX_ags_RingParam()
- Description:
- The ISX_ags_RingParam( ) function sets ringing parameters. This function only applies
- to nodes with an analog line.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -ucIsxNo
- Node number
- -usRingOnDuration
- Ringing duration in ms. It shall not be 0.
- -usRingOffDuration
- Interval between two rings in ms. It shall not be 0.
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ags_RingParam(UCHAR ucIsxNo, USHORT usRingOnDuration, USHORT usRingOffDuration);
- /************************************************************************/
- /* Function: ISX_ags_SetHookParam()
- Description:
- The function ISX_ags_SetHookParam( ) sets a time interval for switchhook flash identification.
- That is, an event is a switchhook event if the time is within the defined duration; an event is
- an on-hook event if the time exceeds this duration. This function only applies to nodes with an
- analog line.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -ucIsxNo
- Node number
- -usHookFlashTime
- Detects the switchhook flash time in 10ms. It shall not be 0.
- The default is 50 time units, i.e. 500ms.
- */
- /************************************************************************/
- #ifndef EHANG_ISXAPI_STD_C
- ISXAPI_FUNC_STDCL(INT) ISX_ags_SetHookParam(UCHAR ucIsxNo, USHORT usHookFlashTime=50); //10 msec units
- #else
- ISXAPI_FUNC_STDCL(INT) ISX_ags_SetHookParam(UCHAR ucIsxNo, USHORT usHookFlashTime); //10 msec units
- #endif
- /************************************************************************/
- /* Function: ISX_ags_genring()
- Description:
- The ISX_ags_genring( ) function performs ringing on a specified analog line.
- This function only applies to an FXS port analog line. If off-hook is performed during
- ringing, ringing is terminated. When the number ringings reaches a number specified by
- the len parameter, ringing is also automatically terminated.
- Return value:
- Asynchronous mode:
- 0 success, -1 failure
- Synchronous mode:
- -1: Failure
- MSMM_RNGOFFHK: Ringing termination due to off-hook
- MSMM_RNGSTOP: Ringing termination due to the calling of the ISX_ags_stopfn() function
- MSMM_TERM: Termination because the number of ringings is fulfilled
- Parameter:
- -dev
- Analog line channel device handle returned by ISX_ag_open( )
- -len
- Specifies the number of ringings. If it is 0xFFFF, the number of ringings is not restricted until off-hook is performed or the ISX_ags_stopfn() function is called.
- -mode
- Synchronous/asynchronous mode:
- EV_SYNC: Synchronous
- EV_ASYNC: Asynchronous
- -ulOperIndex
- Operation number. In the asynchronous operation mode, the number can be obtained through
- the ISX_sr_getevtoperindex() function when MSEV_RING or MSEV_NORING is generated upon the
- completion of the operation.
- */
- /************************************************************************/
- #ifndef EHANG_ISXAPI_STD_C
- ISXAPI_FUNC_STDCL(INT) ISX_ags_genring(INT dev, USHORT len, USHORT mode=EV_ASYNC, UINT ulOperIndex=0);
- #else
- ISXAPI_FUNC_STDCL(INT) ISX_ags_genring(INT dev, USHORT len, USHORT mode, UINT ulOperIndex);
- #endif
- /************************************************************************/
- /* Function: ISXE_ags_SendCallerID()
- Description:
- The ISX_ags_SendCallerID( ) function sends calling number information to a specified analog line
- through FSK during ringing. This function shall be used together with ISX_ags_genring() only.
- This function is called to send a calling number only when the first MSEV_RINGS event is received.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -dev
- Analog line channel device handle returned by ISX_ag_open( )
- -OrigAddr
- Calling number that is an ASCII string. The maximum length is MAX_CALLID_DATA_LEN.
- -rfu
- Reserved. Currently, it is useless.
- */
- /************************************************************************/
- #ifndef EHANG_ISXAPI_STD_C
- ISXAPI_FUNC_STDCL(INT) ISX_ags_SendCallerID(INT dev, CHAR* OrigAddr, VOID* rfu=0);
- #else
- ISXAPI_FUNC_STDCL(INT) ISX_ags_SendCallerID(INT dev, CHAR* OrigAddr, VOID* rfu);
- #endif
- /************************************************************************/
- /* Function: ISX_ags_genringCallerID()
- Description:
- The function performs ringing on a specified analog line. This function only applies to an FXS
- port analog line. If off-hook is performed during ringing, ringing is terminated. When the number
- ringings reaches a number specified by the len parameter, ringing is also automatically terminated.
- The calling number information is sent through FSK during ringing.
- Return value:
- Asynchronous mode:
- 0 success,
- -1 failure
- Synchronous mode:
- -1: Failure
- MSMM_RNGOFFHK: Ringing termination due to off-hook
- MSMM_RNGSTOP: Ringing termination due to the calling of the ISX_ags_stopfn() function
- MSMM_TERM: Termination because the number of ringings is fulfilled
- Parameter:
- -dev
- Analog line channel device handle returned by ISX_ag_open( )
- -len
- Specifies the number of ringings. If it is 0xFFFF, the number of ringings is not restricted until
- off-hook is performed or the ISX_ags_stopfn() function is called.
- -mode
- Synchronous/asynchronous mode:
- EV_SYNC: Synchronous
- EV_ASYNC: Asynchronous
- -Cadid
- Ring rhythm. Reserved. Currently, it is useless.
- -OrigAddr
- Calling number that is an ASCII string. The maximum length is MAX_CALLID_DATA_LEN.
- -rfu
- Reserved. Currently, it is useless.
- -ulOperIndex
- Operation number. In the asynchronous operation mode, the number can be obtained through the
- ISX_sr_getevtoperindex() function when MSEV_RING or MSEV_NORING is generated upon the completion
- of the operation.
- */
- /************************************************************************/
- #ifndef EHANG_ISXAPI_STD_C
- ISXAPI_FUNC_STDCL(INT) ISX_ags_genringCallerID(INT dev, USHORT len, USHORT mode, USHORT Cadid, CHAR* OrigAddr, VOID* rfu=NULL, UINT ulOperIndex=0);
- #else
- ISXAPI_FUNC_STDCL(INT) ISX_ags_genringCallerID(INT dev, USHORT len, USHORT mode, USHORT Cadid, CHAR* OrigAddr, VOID* rfu, UINT ulOperIndex);
- #endif
- /************************************************************************/
- /* Function: ISX_ags_stopfn()
- Description:
- The ISX_ags_stopfn( ) function stops the asynchronous function operation.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -dev
- Analog line channel device handle returned by ISX_ag_open( )
- -funcid
- Function ID to be stopped. Currently, only the ringing stopping (i.e. MTF_RING) is supported.
- -mode
- Synchronous or asynchronous mode:
- EV_SYNC: Synchronous
- EV_ASYNC: Asynchronous
- */
- /************************************************************************/
- #ifndef EHANG_ISXAPI_STD_C
- ISXAPI_FUNC_STDCL(INT) ISX_ags_stopfn(INT dev, UINT funcid, USHORT mode=EV_ASYNC);
- #else
- ISXAPI_FUNC_STDCL(INT) ISX_ags_stopfn(INT dev, UINT funcid, USHORT mode);
- #endif
- /************************************************************************/
- /* Function: ISX_ag_SetEvtMsk()
- Description:
- The function sets a channel event mask. If the mask of an event is cleared, this event is
- not sent to the application. For the default masks, refer to Table 1.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -dev
- Analog line device handle
- -mask
- Event mask. Refer to Table 1.
- -action
- Flag for increase or clearing:
- AGACT_SETMSK: Enables receiving a specified event and disables an unspecified event.
- AGACT_ADDMSK: Enables receiving a specified event.
- AGACT_SUBMSK: Disables receiving a specified event.
- Table 1 Parameter masks
- --------------------------------------------------------------------------------------
- Type Description Default
- --------------------------------------------------------------------------------------
- MSMM_OFFHOOK Set whether to receive an MSEV_SIGEVT off-hook event Enabled
- MSMM_ONHOOK Set whether to receive an MSEV_SIGEVT on-hook event Enabled
- MSMM_HOOKFLASH Set whether to receive an MSEV_SIGEVT switchhook flash event Disabled
- AGMM_DIGITS Set whether to receive an AGEV_DIGITS event Disabled
- MOMM_RINGS Set whether to receive an MOEV_RINGS event Disabled
- MSMM_RINGS Set whether to receive an MSEV_RINGS event Disabled
- MOMM_CALLERID Set whether to receive an MOEV_CALLERID event Disabled
- --------------------------------------------------------------------------------------
- */
- /************************************************************************/
- ISXAPI_FUNC_STDCL(INT) ISX_ag_SetEvtMsk(INT dev, UINT mask, INT action);
- /************************************************************************/
- /* Function: ISX_ATAG_TERMMSK()
- Description:
- The ISX_ATAG_TERMMSK( ) function returns an integer containing the cause for
- the last I/O operation termination.
- Return value:
- The last termination cause (bitmask)
- AT_FAILURE error
- Parameter:
- -dev
- Analog line channel device handle
- -OperType
- Operation type. Refer to OPERATIONS.
- Termination causes are as follows:
- Potential termination causes for ISX_ags_genring():
- MSMM_RNGOFFHK: Ringing termination due to off-hook during the process of ringing of the FXS port.
- MSMM_RNGSTOP: Ringing termination due to the calling of ISX_ags_stopfn().
- MSMM_TERM: Normal ringing termination.
- Potential termination causes for ISX_ago_dial():
- CR_SS_TELNUM: Outgoing call termination due to successful sending of a telephone number.
- CR_SF_TELNUM: Outgoing call termination due to failure to send a telephone number.
- CR_BUSY: Busy line
- CR_NOANS: No answer
- CR_NORB: No ringback tone
- CR_CNCT: Answer
- CR_NODIALTONE: No dialing tone
- CR_FAXTONE: Fax
- Potential termination causes for ISX_ag_StartSendTone():
- TM_DIGIT: Specified digit is received
- TM_EOD: Data ends (For example, a file ends during play and voice data with a specified length is received during record)
- TM_ERROR: I/O device error
- TM_IDDTIME: Timeout between keys
- TM_MAXDTMF: A specified DTMF count is received
- TM_MAXTIME: The operation time specified by the function is exceeded
- TM_USRSTOP: The user stops the operation
- TM_BARGEIN: Playback is interrupted because a VAD is detected
- */
- /************************************************************************/
- #ifndef EHANG_ISXAPI_STD_C
- ISXAPI_FUNC_STDCL(INT) ISX_ATAG_TERMMSK(INT dev, INT OperType = OPER_UNKNOWN);
- #else
- ISXAPI_FUNC_STDCL(INT) ISX_ATAG_TERMMSK(INT dev, INT OperType);
- #endif
- /************************************************************************/
- /* Function: ISX_ag_StartSendTone()
- Description:
- The ISX_ag_StartSendTone( ) function sends a busy tone, ringback tone, howler tone, dialing tone,
- etc. An analog line channel must be bound to a DSP voice channel in order to call this function.
- For binding to a DSP voice channel, refer to the ISX_ag_open() function.
- Return value:
- 0 success
- -1 failure
- Parameter:
- -dev
- Specifies a valid voice channel device handle
- -iToneId
- TONE ID. It includes the following:
- TONEID_BUSY: Busy tone
- TONEID_DIAL: Dialing tone
- TONEID_RINGBACK: Ringback tone
- TONEID_HOWLER: Howler tone
- -tptp
- Pointer to the Termination Parameter Table (DV_TPT). The parameter specifies play termination conditions.
- For details, refer to the description of the DV_TPT structure. Note: In addition to DV_TPT termination
- conditions, the play operation may stop when play proceeds to the end of a file or the user calls the
- ISX_dx_stopch() function. For details, refer to the list of termination causes in the description of
- the ISX_ATDX_TERMMSK() and ISX_ATAG_TERMMSK() functions.
- -iPrdDev
- PRD device handle. Currently, TONE sending is achieved by playing files through a DSP voice channel.
- Therefore, this parameter specifies a PRD device handle where the TONE file is located.
- -Mode
- Specifies the synchronous/asynchronous mode:
- EV_ASYNC: Asynchronous mode
- EV_SYNC:Synchronous mode (default)
- -ulOperIndex
- Operation number. In the asynchronous operation mode, the number can be obtained through the
- ISX_sr_getevtoperindex() function when AGEV_SENDTONE or AGEV_ERROR is generated upon the completion
- of the operation.
- Note:
- 1.TPT conditions are subject to the historical keys and current key of the bound DSP voice channel.
- 2.Play can be stopped by calling the ISX_ag_StopSendTone(dev) function, but dev must be the analog line channel handle in the ISX_ag_StartSendTone(dev) function.
- 3.Play can be stopped by calling the ISX_dx_stopch(dev) function, but dev must be the bound DSP voice channel device handle.
- 4.If there is a key during play, key information can be obtained by calling the ISX_dx_getdig(dev) function, but dev must be the bound DSP voice channelk device handle.
- */
- /************************************************************************/
- #ifndef EHANG_ISXAPI_STD_C
- ISXAPI_FUNC_STDCL(INT) ISX_ag_StartSendTone(INT dev, const INT iToneId, const DV_TPT *tptp, INT iPrdDev=-1, USHORT mode=EV_ASYNC, UINT ulOperIndex=0);
- #else
- ISXAPI_FUNC_STDCL(INT) ISX_ag_StartSendTone(INT dev, const INT iToneId, const DV_TPT *tptp, INT iPrdDev, USHORT mode, UINT ulOperIndex);
- #endif
- /************************************************************************/
- /* Function:ISX_ag_StopSendTone()
- Description:
- The ISX_ag_StopSendTone( ) function stops the TONE sending operation activated by ISX_ag_StartSendTone().
- Return value:
- 0 success
- -1 failure
- Parameter:
- -dev
- Analog line channel device handle.
- -mode
- Synchronous/asynchronous mode:
- EV_SYNC: Synchronous
- EV_ASYNC: Asynchronous
- */
- /************************************************************************/
- #ifndef EHANG_ISXAPI_STD_C
- ISXAPI_FUNC_STDCL(INT) ISX_ag_StopSendTone(INT dev, USHORT mode=EV_ASYNC);
- #else
- ISXAPI_FUNC_STDCL(INT) ISX_ag_StopSendTone(INT dev, USHORT mode);
- #endif
- /*
- - Refer to ISX_dx_chgfreq()
- */
- ISXAPI_FUNC_STDCL(INT) ISX_ag_chgfreq( INT tonetype, INT fq1, INT dv1, INT fq2, INT dv2 );
- /*
- - Refer to ISX_dx_chgdur()
- */
- ISXAPI_FUNC_STDCL(INT) ISX_ag_chgdur( INT tonetype, INT on, INT ondv, INT off, INT offdv );
- #ifndef EHANG_ISXAPI_STD_C
- ISXAPI_FUNC_STDCL(INT) ISX_agh_startchk(INT dev, VOID* pRvr=0);
- #else
- ISXAPI_FUNC_STDCL(INT) ISX_agh_startchk(INT dev, VOID* pRvr);
- #endif
- #ifndef EHANG_ISXAPI_STD_C
- ISXAPI_FUNC_STDCL(INT) ISX_agh_stopchk(INT dev, VOID* pRvr=0);
- #else
- ISXAPI_FUNC_STDCL(INT) ISX_agh_stopchk(INT dev, VOID* pRvr);
- #endif
- #endif
- #ifdef __cplusplus
- } // C Plus Plus function bindings
- #undef extern
- #endif
- #endif
|