Table of Contents Index NMS Glossary Previous Page Next Page (Page 23 of 69 in this chapter) Version


adiPlaceCall

Description

Places an outbound call.

Note: This function and all other ADI call control functions have been superseded by the NCC service. For more information, see the Natural Call Control Service Developer's Reference Manual.

Prototype

DWORD adiPlaceCall ( CTAHD ctahd,
char *digitstr,
ADI_PLACECALL_PARMS *parms )

ctahd CTA context handle returned by ctaCreateContext.

digitstr Pointer to a NULL-terminated string containing the phone number to dial.

parms Pointer to an ADI_PLACECALL_PARMS structure, shown below (NULL uses default parameter values):

typedef struct
{
DWORD size ; /* size of this structure */
DWORD connectmask; /* events that transition to connected */
DWORD disconnectmask;

/* events that transition to disconnected */
ADI_CALLPROG_PARMS callprog;

/* call progress analysis parameters */
} ADI_PLACECALL_PARMS;

For the ADI_CALLPROG_PARMS structure, refer to adiStartCallProgress. Refer to Appendix D for more details and default values.

Return Values

Events

Details

digitstr may contain the following embedded escape characters which control the dialing sequence, as listed below:
Character

Description

;

(semicolon) Wait for precise dial tone.

.

(period) Insert long pause in dialing.

,

(comma) Insert short pause in dialing.

!

Flash-hook.

P

Switch to pulse dialing.

T

Switch to DTMF dialing.

M

Switch to MF dialing.

For MF dialing, note the mapping to the U.S. MF digits:
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

Note: When you place a call, the first event you receive is usually ADIEVN_PLACING_CALL. If call placement fails, you receive an ADIEVN_CALL_DISCONNECTED event with a value field of ADI_DIS_NO_DIALTONE or ADI_DIS_NO_WINK. If the port is a bi-directional trunk, ADIEVN_INCOMING_CALL may be received instead of ADIEVN_PLACING_CALL. If you receive an ADIEVN_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.

Call placement and call control are discussed in detail in the ADI Service Developer's Manual.

Some protocols allow you to use adiSetExtendedArgs to set additional arguments to adiPlaceCall. For more information about controlling calls under specific TCPs, refer to the AG CAS for ADI Service Installation and Developer's Manual.

Note: This function is not available when using the NOCC protocol.

See Also

adiStartProtocol, adiReleaseCall, adiSetExtendedArgs, adiStartMFDetector (for MF table)

Example


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;
        }
    }
}



Table of Contents Index NMS Glossary Previous Page Next Page (Page 23 of 69 in this chapter) Version


Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2000, Natural MicroSystems, Inc. All rights reserved.