BRI Service Developer's Reference Manual (6569-11): Alphabetical Function Reference
(Page 9 of 15 in this chapter) Version
briPlaceCall
Description
- Places an outbound call.
Prototype
- DWORD briPlaceCall ( CTAHD ctahd,
char *digitstr )
- ctahd CTA context handle returned by ctaCreateContext.
- digitstr Pointer to a NULL-terminated string containing the phone number to dial.
Return Values
Events
Details
- The BRI service expects the digit string to be formatted as follows:
#a1an*s1sn#d1dn*t1tn
- where:
- s1sn are the subaddress digits of the calling party, if used. If no
subaddress is used, omit the
* and s digits from the string.
#d1dn are the digits to dial.
- t1tn are the subaddress digits to dial, if needed. If no subaddress
is needed, omit the
* and t digits from the string.
- The second # is a separator character. If only a called number is
supplied to briPlaceCall, omit this character from the string.
Note: When you place a call, the first event you receive is usually BRIEVN_PLACING_CALL. If call placement fails, you receive a BRIEVN_CALL_DISCONNECTED event. Since the port is a
bi-directional trunk, BRIEVN_INCOMING_CALL may be received instead of BRIEVN_PLACING_CALL. If you receive a BRIEVN_INCOMING_CALL event, retry placing the outgoing call at a later time.
- If an incoming call is detected during call placement, the application should proceed to process it.
- The BRI service allows you to use briSetExtendedArgs to set additional arguments to briPlaceCall.
- Refer to Chapter 4 for a detailed explanation of call control.
See Also
- briReleaseCall, briSetExtendedArgs, briStartProtocol
Example
int myPlaceCall( CTAHD ctahd, char *digits, int answer_incoming )
{
CTA_EVENT event;
BRI_CALL_STATUS status ;
briPlaceCall( ctahd, digits );
while( 1 )
{
myGetEvent( &event ); /* see ctaWaitEvent example */
switch( event.id )
{
case BRIEVN_INCOMING_CALL: /* Now in the 'incoming call' state. */
/*
* Glare: The protocol has detected an incoming call when we
* tried to place our call.
*/
briGetCallStatus (ctahd,&status,sizeof status);
if( answer_incoming )
briAnswerCall( ctahd, 0 );
else
briRejectCall( ctahd, BRI_REJ_FORCE_IMMEDIATE );
break;
case BRIEVN_CALL_CONNECTED: /* Now in the 'connected' state. */
/*
* After PLACING_CALL, this event indicates that the connection
* has been established. For an INCOMING_CALL, this is reached
* when 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 BRIEVN_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 an error occurred.
* After ANSWER_CALL, this is reached when the remote party
* hangs up during either the rejecting or answering states.
*/
return MYDISCONNECT;
case BRIEVN_PLACING_CALL: /* Outgoing call has been placed */
briGetCallStatus (ctahd, &status, sizeof status);
break;
case BRIEVN_ANSWERING_CALL: /* Now in the 'answering' state. */
case BRIEVN_REJECTING_CALL: /* Now in the 'rejecting' state. */
default:
break;
}
}
}
(Page 9 of 15 in this chapter) Version
tech_support@nmss.com
Copyright © 1999, Natural MicroSystems, Inc. All rights
reserved.