(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:

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.