(Page 1 of 1 in this chapter)

Figure 2. Inbound Call Sequence Diagram

Figure 3. Inbound Call State Machine
Retrieving All Digits at Once
#define ADI_MAX_DIGITS 31 #define ADI_MAX_CNAME 31typedef struct{ /* Used by adiGetCallStatus */DWORD size ; /* Size returned by adiGetCallStatus */DWORD state; /* Call states(ADI_CC_STATE_xxx below) */INT32 reason; /* Reason of going back to IDLE state */char calledaddr [ADI_MAX_DIGITS+1]; /* DNIS info(null term string) */char callingaddr[ADI_MAX_DIGITS+1]; /* ANI info (null term string) */char callingname[ADI_MAX_CNAME+1]; /* Calling party name */DWORD pendingcommand; /* Current unack'ed command (see above) */char usercategory; /* The type of the calling party */char tollcategory; /* (generally the same as usercategory) */BYTE stream; /* MVIP address of B channel */BYTE timeslot; /* MVIP address of B channel */WORD billingrate; /* billing rate of call */char callednumplan; /* Q.931 numbering plan ID if supported */char callednumtype; /* Q.931 number type if supported */char callingnumplan; /* Q.931 numbering plan ID if supported */char callingnumtype; /* Q.931 number type if supported */char callingpres; /* Caller ID presentation indicator */char callingscreen; /* Q.931 ANI screening indicator */char progressdescr; /* progress descriptor */char releasecause; /* Cause for call release */char redirectingaddr[ADI_MAX_DIGITS+1]; /* redirecting number info */char redirectingplan; /* Q.931 numbering plan ID if supported */char redirectingtype; /* Q.931 number type if supported */char redirectingpres; /* redirecting number pres. indicator */char redirectingscreen; /* Q.931 redirecting number screen ind. */char redirectingreason; /* Q.931 reason for redirection */char originalcalledaddr [ADI_MAX_DIGITS+1]; /* *for future use* */char UUI[132]; /* user to user information */} ADI_CALL_STATUS;

Figure 4. Outbound Call State Machine

Figure 5. Placing Outbound Calls
Note: Different TCPs expect the digit string to be formatted in different ways. If the PSTN requires ANI digits, the application must insert separators symbols (#) to signify ANI digits from DID digits. Refer to Appendix C for more information about digit string formatting according to protocol.
#define ADI_MAX_DIGITS 31
#define ADI_MAX_CNAME 31
typedef struct
{ /* Used by adiGetCallStatus */
DWORD size ; /* Size returned by adiGetCallStatus */
DWORD state; /* Call states(ADI_CC_STATE_xxx below) */
INT32 reason; /* Reason for returning to IDLE state */
char calledaddr [ADI_MAX_DIGITS+1];
/* DNIS info (null term string */
char callingaddr[ADI_MAX_DIGITS+1];
/* ANI info (null term string) */
char callingname[ADI_MAX_CNAME+1];
/* Calling party name */
DWORD pendingcommand ; /* Current unack'ed command(see above)*/
char usercategory; /* The type of the calling party */
char tollcategory; /* (generally the same as usercategory*/
BYTE stream; /* MVIP address of B channel */
BYTE timeslot; /* MVIP address of B channel */
WORD billingrate; /* billing rate of call */
char callednumplan; /* Numbering plan ID if supported */
char callednumtype; /* Number type if supported */
char callingnumplan; /* Numbering plan ID if supported */
char callingnumtype; /* Number type if supported */
char callingpres; /* Caller ID presentation indicator */
char callingscreen; /* ANI screening indicator */
char progressdescr; /* Progress descriptor */
char releasecause; /* Cause for call release */
char redirectingaddr[ADI_MAX_DIGITS+1];
/* Redirecting number info */
char redirectingplan; /* Numbering plan ID if supported */
char redirectingtype; /* Number type if supported */
char redirectingpres; /* Redirecting number pres. indicator */
char redirectingscreen; /* Redirecting number screen ind. */
char redirectingreason; /* Reason for redirection */
char originalcalledaddr [ADI_MAX_DIGITS+1];
/* Original called number */
char origcalledplan; /* Numbering plan ID if supported */
char origcalledtype; /* Number type if supported */
char origcalledpres; /* Orig. called number pres. indicator*/
char origcalledscreen; /* Redirecting number screen ind. */
char origcalledreason; /* Reason for redirection */ char UUI[132]; /* User to user information */
} ADI_CALL_STATUS;

Figure 6. Accepting Inbound Calls with Gateway Applications

Figure 7. Rejecting Calls with Gateway Applications
(Page 1 of 1 in this chapter)