next_inactive up previous contents
Up: Voice Response Virtualization Layer Previous: PP Implementation using D4x   Contents

Subsections

Internals

Dialogic d4x interface

TBD.

Internal functions

Following are the PP Layer internal functions.

void genEvent( ppEvtId, portDesc, csb, evtInfo ) /* Translate Dialogic Events */
PP_EventId      ppEvtId;           /* into PP_Events - Expected Event Id */
PP_PortDesc                     portDesc;
DL_CSB          *csb;
char            *evtInfo;          /* this is a pointer CAR */

typedef enum PP_EventId {
    PP_EvtDisConInd,    /* No Data */
    PP_EvtErrorInd,
    PP_EvtOnHookCnf,    /* No Data */
    PP_EvtOffHookCnf,   /* No Data */
    PP_EvtRingInd,      /* No Data */
    PP_EvtPlayCnf,
    PP_EvtGetDtmfCnf,
    PP_EvtRecordCnf,
    PP_EvtDialCnf,
    PP_EvtGenDtmfCnf,    /* No Data */
    /* -- Triggering Events -- */
    PP_EvtTrigRingInd,
    PP_EvtTrigSilenceInd,
    PP_EvtTrigNoSilenceInd,
    PP_EvtTrigLoopCurrentInd,
    PP_EvtTrigNoLoopCurrentInd
} PP_EventId;

typedef struct PP_PortInfo {
   struct PP_PortInfo *next;
   struct PP_PortInfo *prev;
   PP_PortId portId;
   Int dev;
   struct PP_SapInfo *sapInfo;
   Char dtmfBuf[PP_K_DtmfNuMax];
} PP_PortInfo;
typedef PP_PortInfo *PP_PortDesc;

typedef struct dl_csb {    /* Channel Status block */
unsigned char cs_lstat;    /* Current raw line status */
unsigned char cs_state;    /* Current state */
unsigned char cs_dtmfcnt;  /* Size of DTMF queue */
unsigned char cs_evntcnt;  /* Size of event queue */
unsigned char cs_hookstate;/* Hook state */
unsigned char cs_callstate;/* Last dial state */
unsigned char cs_rfu[2];   /* RFU for packing-independence */
unsigned long cs_termtype; /* Last command termination reas on */
unsigned long cs_trcount;  /* Bytecount play or recorded */
} DL_CSB;

typedef struct dl_car {              /* Call Analysis Results structure */
        unsigned char cr_termtype;   /* Termination reason */
        unsigned char cr_frqout;     /* % of freq. out of bounds */
        unsigned short cr_frqhz;     /* Freq. detect in Hz.  */
        unsigned short cr_sizehi;    /* Duration of non-silence (10mS units) */
        unsigned short cr_shortlow;  /* Duration of shorter silence */
        unsigned short cr_longlow;   /* Duration of longer silence */
        unsigned short cr_ansrsize;  /* Duration of answer (10mS units) */
} DL_CAR;

SuccFail genInd( portDesc, csb, evtInfo )
PP_PortDesc                     portDesc;
DL_CSB          *csb;
char            *evtInfo;

typedef struct PP_PortInfo {
   struct PP_PortInfo *next;
   struct PP_PortInfo *prev;
   PP_PortId portId;
   Int dev;
   struct PP_SapInfo *sapInfo;
   Char dtmfBuf[PP_K_DtmfNuMax];
} PP_PortInfo;
typedef PP_PortInfo *PP_PortDesc;


SuccFail genCnf( ppEvtId, portDesc, csb, evtInfo )
PP_EventId      ppEvtId;        /* Expected Event Id */
PP_PortDesc                     portDesc;
DL_CSB          *csb;
char            *evtInfo;


typedef struct PP_PortInfo {
   struct PP_PortInfo *next;
   struct PP_PortInfo *prev;
   PP_PortId portId;
   Int dev;
   struct PP_SapInfo *sapInfo;
   Char dtmfBuf[PP_K_DtmfNuMax];
} PP_PortInfo;

typedef struct dl_csb {
unsigned char cs_lstat;    /* Current raw line status */
unsigned char cs_state;    /* Current state */
unsigned char cs_dtmfcnt;  /* Size of DTMF queue */
unsigned char cs_evntcnt;  /* Size of event queue */
unsigned char cs_hookstate;/* Hook state */
unsigned char cs_callstate;/* Last dial state */
unsigned char cs_rfu[2];   /* RFU for packing-independence */
unsigned long cs_termtype; /* Last command termination reas on */
unsigned long cs_trcount;  /* Bytecount play or recorded */
} DL_CSB;

/* PP_DialEnd */
carTermToDialEnd( car )
DL_CAR  *car;           /* Call Analysis Result */

typedef struct dl_car {
unsigned char cr_termtype;      /* Termination reason */
unsigned char cr_frqout;        /* % of freq. out of bounds */
unsigned short cr_frqhz;        /* Freq. detect in Hz. */
unsigned short cr_sizehi;       /* Duration of non-silence (10mS units) */
unsigned short cr_shortlow;     /* Duration of shorter silence */
unsigned short cr_longlow;      /* Duration of longer silence */
unsigned short cr_ansrsize;     /* Duration of answer (10mS units) */
} DL_CAR;


void showCap( myCap )
DL_CAP  *myCap;

typedef struct dl_cap {
unsigned short ca_nbrdna; /* # of rings before no answer. */
unsigned short ca_stdely; /* Delay after dialing before analysis. */
unsigned short ca_cnosig; /* Duration of no signal time out delay. */
unsigned short ca_lcdly; /* Delay after dial before lc drop connect */
unsigned short ca_lcdly1; /* Delay after lc drop con. before msg. */
unsigned short ca_hedge; /* Edge of answer to send connect message. */
unsigned short ca_cnosil; /* Initial continuous noise timeout delay. */
unsigned short ca_lo1tola; /* % acceptable pos. dev of short low sig. */
unsigned short ca_lo1tolb; /* % acceptable neg. dev of short low sig. */
unsigned short ca_lo2tola; /* % acceptable pos. dev of long low sig. */
unsigned short ca_lo2tolb; /* % acceptable neg. dev of long low sig. */
unsigned short ca_hi1tola; /* % acceptable pos. dev of high signal. */
unsigned short ca_hi1tolb; /* % acceptable neg. dev of high signal. */
unsigned short ca_lo1bmax; /* Maximum interval for shrt low for busy. */
unsigned short ca_lo2bmax; /* Maximum interval for long low for busy. */
unsigned short ca_hi1bmax; /* Maximum interval for 1st high for busy */
unsigned short ca_nsbusy; /* Num. of highs after nbrdna busy check. */
unsigned short ca_logltch; /* Silence deglitch duration. */
unsigned short ca_higltch; /* Non-silence deglitch duration. */
unsigned short ca_lo1rmax; /* Max. short low  dur. of double ring. */
unsigned short ca_lo2rmin; /* Min. long low  dur. of double ring. */
unsigned short ca_intflg; /* Operator intercept mode. */
unsigned short ca_intfltr; /* Minimum signal to qualify freq. detect. */
unsigned short ca_frqmin; /* Lower freq. detect limit */
unsigned short ca_frqmax; /* Upper freq. detect limit */
unsigned short ca_devmax; /* Upper freq. limit deviation */
unsigned short ca_smpsize; /* No.of samples used in freq. detection */
unsigned short ca_hisiz; /* Used to determine which lowmax to use. */
unsigned short ca_alowmax; /* Max. low before con. if high >hisize. */
unsigned short ca_blowmax; /* Max. low before con. if high <hisize. */
unsigned short ca_nbrbeg; /* Number of rings before analysis begins. */
unsigned short ca_hi1ceil; /* Maximum 2nd high dur. for a retrain. */
unsigned short ca_lo1ceil; /* Maximum 1st low dur. for a retrain. */
unsigned short ca_lowerfrq; /* Lower allowable frequency in hz. */
unsigned short ca_upperfrq; /* Upper allowable frequency in hz. */
unsigned short ca_timefrq; /* Total duration of good signal required. */
unsigned short ca_rejctfrq; /* Allowable % of bad signal. */
unsigned short ca_maxansr; /* Maximum duration of answer. */
unsigned short ca_ansrdgl; /* Silence deglitching value for answer. */
} 


char * /* A pointer to a device name.  NULL pointer if range error. */
getBoardDevName( portId, channelNum )   /* Figure device name for a board   */
PP_PortId       portId;                                 /* given a port ID.                 */
int             *channelNum;

typedef Int PP_PortId;                          /* Name By which the Phone Port is identified */

char    *     /*  A pointer to a device name.  NULL pointer if range error. */
getDevName( portId )                            /* Figure device name given a port ID. */
PP_PortId       portId;                         /* portId - a number from 1 - 32. */


BOOLEAN isGoodDtmf(c)
char    c;

SuccFail dtmfFlush( portInfo )
PP_PortInfo *portInfo;