(Page 23 of 69 in this chapter) Version
/* events that transition to disconnected */
/* call progress analysis parameters */
|
Digit
|
U.S. MF Name
|
|---|---|
|
0 to 9
|
Specific digit address
|
|
B
|
MF ST3P
|
|
C
|
MF STP
|
|
D
|
MF KP
|
|
E
|
MF KP2, MF ST2P
|
|
F
|
MF ST
|
int myPlaceCall( CTAHD ctahd, char *digits, int accept_incoming )
{
CTA_EVENT event;
adiPlaceCall( ctahd, digits, NULL );
while( 1 )
{
myGetEvent( &event ); /* see ctaWaitEvent example */
switch( event.id )
{
case ADIEVN_INCOMING_CALL: /* Now in the 'incoming call' state. */
/*
* Glare: The protocol has detected an incoming call when we
* tried to place our call.
*/
if( accept_incoming )
adiAnswerCall( ctahd, 1 );
else
adiRejectCall( ctahd, ADI_REJ_PLAY_REORDER );
break;
case ADIEVN_CALL_CONNECTED: /* Now in the 'connected' state. */
/*
* After PLACING_CALL, this event indicates that a specific
* connection criteria was met. For an INCOMING_CALL, this is
* reached when the specified number of rings have been
* detected/generated and the protocol has answered the call.
* Application is now in the 'connected' (conversation)
* state, and may play, record, collect DTMFs, etc.
* May also release the call to hang up or in response to the
* remote party hanging up.
*/
return SUCCESS;
case ADIEVN_CALL_DISCONNECTED:/* Now in the 'disconnected' state. */
/*
* Before ANSWER_CALL or PLACING_CALL, indicates the network
* is not acknowledging outbound seizure. After PLACING_CALL,
* indicates that a specific disconnect criteria was met.
* After ANSWER_CALL, this is reached when the remote party
* hangs up during either the rejecting or answering states.
*/
return MYDISCONNECT;
case ADIEVN_ANSWERING_CALL: /* Now in the 'answering' state. */
case ADIEVN_REJECTING_CALL: /* Now in the 'rejecting' state. */
default:
break;
}
}
}
(Page 23 of 69 in this chapter) Version