(Page 7 of 15 in this chapter) Version


briGetCallStatus

Description

Retrieves a snapshot of the call control status and stores it in a BRI_CALL_STATUS structure.

Prototype

DWORD briGetCallStatus ( CTAHD ctahd,
BRI_CALL_STATUS *status,
unsigned size )

ctahd CTA context handle returned by ctaCreateContext.

status Pointer to the BRI_CALL_STATUS structure, as shown:

typedef struct
{ DWORD size; /* Size returned by briGetCallStatus */
DWORD state; /* Call states (BRI_CC_STATE_xxx) */
INT32 reason; /* Reason for going back to IDLE state */
char calledaddr [BRI_MAX_DIGITS+1];
/*DNIS info, called number */
/* (null-terminated string) */
char callingaddr[BRI_MAX_DIGITS+1];
/*ANI info, calling number */
/* (null-terminated string) */
DWORD pendingcommand; /* Current unacknowledged command */
char usercategory; /* User category of the calling party */
/* (for future use) */
char tollcategory; /* Toll category. Generally, same as */
/* usercategory (for future use) */
BYTE stream; /* MVIP address of B channel */
BYTE timeslot; /* MVIP address of B channel */
WORD billingrate; /* Billing rate of the call */
/* (for future use) */
char callednumplan; /* Q.931 numbering plan ID of */
/* called number */
char callednumtype; /* Q.931 number type of */
/* called number */
char callingnumplan; /* Q.931 numbering plan ID of */
/* calling number */
char callingnumtype; /* Q.931 number type of calling number */
char callingpres; /* Caller ID presentation indicator */
char callingscreen; /* Q.931 ANI screening indicator */
char progressdescr; /* Progress descriptor */
char releasecause; /* Cause for call release */
WORD service; /* Service for the current call */
char UUI[BRI_MAX_UUI];
/* UUI message received */
} BRI_CALL_STATUS;

size Size (in bytes) of the user-supplied status information space.

Return Values

Events

None.

Details

This function retrieves the call control status of the current or most recent call. Upon returning from the function, the BRI_CALL_STATUS size field contains the actual number of bytes written. For incoming calls, invoke briGetCallStatus after receiving the BRIEVN_INCOMING_CALL event. For outgoing calls, invoke briGetCallStatus after receiving BRIEVN_PLACING_CALL.

This function may also be invoked when a BRIEVN_STATUS_UPDATE arrives from the BRI service. It means that one or several fields have changed. There are three cases when this can occur:

The BRI_CALL_STATUS structure contains the following fields::
Field

Description

size

Number of bytes written at the address pointed to by the status argument in briGetCallStatus.

state

Current call control state. Values applicable to the BRI service are:

· BRI_CC_STATE_STOPPED

· BRI_CC_STATE_IDLE

· BRI_CC_STATE_INCOMING_CALL

· BRI_CC_STATE_ANSWERING_CALL

· BRI_CC_STATE_ACCEPTING_CALL

· BRI_CC_STATE_PLACING_CALL

· BRI_CC_STATE_DISCONNECTED

· BRI_CC_STATE_CONNECTED

· BRI_CC_STATE_REJECTING_CALL

· BRI_CC_STATE_BLOCKING

reason

Reason for the last disconnect (return to Idle state). reason is 0 if the application initiated the disconnect. Otherwise, reason is the value received in
BRIEVN_CALL_ DISCONNECTED.

calledaddr

For inbound calls, the called party address. The BRI service formats the digits as follows:

d1dn*s1sn

where:

· d1dn are the digits, and

· s1sn are the subaddress digits, if available. If no subaddress is available, the * and s digits do not appear in the string.

callingaddr

For inbound calls, the calling party address - the Automatic Number Identification (ANI) digits. The BRI service formats the digits as follows:

a1an*t1tn

where:

· a1an are the ANI digits, and

· t1tn are the subaddress digits, if available. If no subaddress is available, the * and s digits do not appear in the string.

pendingcommand

The last call control command issued that has not yet been acknowledged by the ISDN stack. This field is set when a call control command is sent to the BX 2000 board. The field is cleared on the next event that causes a transition to a new call state.

Values applicable to the BRI service are:

Value Description

0 BRI_PENDCMD_NONE

1 BRI_PENDCMD_PLACE_CALL

2 BRI_PENDCMD_ANSWER_CALL

3 BRI_PENDCMD_REJECT_CALL

4 BRI_PENDCMD_RELEASE_CALL

8 BRI_PENDCMD_ACCEPT_CALL

usercategory

For the BRI service, this field is always zero (0).

tollcategory

For the BRI service, this field is always zero (0).

stream

This field and timeslot together indicate the MVIP address of the B channel. For more information, refer to Section 3.3.1, Specifying B Channel CTA Contexts.

timeslot

This field and stream together indicate the MVIP address of the B channel. For more information, refer to Section 3.3.1, Specifying B Channel CTA Contexts.

billingrate

Billing rate of call (for future use).

callednumplan

Q.931 numbering plan ID of called address (if supported).

Default: 0 (unknown)

Values applicable to the BRI service are:

Value Description

0 BRI_N_PLAN_UNKNOWN

1 BRI_N_PLAN_ISDN

2 BRI_N_PLAN_TELEPHONE

3 BRI_N_PLAN_DATA

4 BRI_N_PLAN_TELEX

8 BRI_N_PLAN_NATIONAL

9 BRI_N_PLAN_PRIVATE

callednumtype

Q.931 type of called address (if supported).

Values applicable to the BRI service are:

Value Description

0 BRI_N_TYPE_UNKNOWN

1 BRI_N_TYPE_INTERNATIONAL

2 BRI_N_TYPE_NATIONAL

3 BRI_N_TYPE_NET_SPF

4 BRI_N_TYPE_SUBSCRIBER

6 BRI_N_TYPE_ABBREVIATED

callingnumplan

Q.931 numbering plan ID of calling address (if supported).

Default: 0 (unknown)

Values applicable to the BRI service are:

Value Description

0 BRI_N_PLAN_UNKNOWN

1 BRI_N_PLAN_ISDN

2 BRI_N_PLAN_TELEPHONE

3 BRI_N_PLAN_DATA

4 BRI_N_PLAN_TELEX

8 BRI_N_PLAN_NATIONAL

9 BRI_N_PLAN_PRIVATE

callingnumtype

Q.931 type of calling address (if supported).

state. Values applicable to the BRI service are:

Value Description

0 BRI_N_TYPE_UNKNOWN

1 BRI_N_TYPE_INTERNATIONAL

2 BRI_N_TYPE_NATIONAL

3 BRI_N_TYPE_NET_SPF

4 BRI_N_TYPE_SUBSCRIBER

6 BRI_N_TYPE_ABBREVIATED

callingpres

Presentation indicator for calling address. Values applicable to the BRI service are:

Value Description

0 BRI_N_PRES_ALLOWED

1 BRI_N_PRES_RESTRICTED

2 BRI_N_PRES_NOT_AVAILABLE

callingscreen

Q.931 screening indicator. Values applicable to the BRI service are:

Value Description

0 BRI_N_SCREEN_USER_PROVIDED

1 BRI_N_SCREEN_USER_PASSED

2 BRI_N_SCREEN_USER_FAILED

3 BRI_N_SCREEN_NETWORK_PROVIDED

progressdescr

Cause for progress message. Values applicable to the BRI service are:

Value Description

0 BRI_NO_PROGRESS_DESCR

1 BRI_PROGRESS_DESCR_NON_END_TO_
END_ISDN

4 BRI_PROGRESS_DESCR_CALL_
RETURNED_ISDN

8 BRI_PROGRESS_DESCR_IN_BAND_NOW

releasecause

Cause for call release.

service

Service for the current incoming call. All the incoming calls whose service is specified in the services_list field of the BRI_START_PARMS structure, are presented to the application with BRIEVN_INCOMING_CALL. All the others are automatically rejected by the ISDN stacks internally. For more information, refer to Appendix D.

UUI

User-to-user information (up to 128+1 characters). The first byte contains the protocol discriminator. The remaining characters contain the data. Values applicable for the protocol discriminator to the BRI service are:

Value Description

0 BRI_UUI_USER_SPF

1 BRI_UUI_OSI

2 BRI_UUI_X244

3 BRI_UUI_SYSTEM_MANAGEMENT

4 BRI_UUI_IA5

7 BRI_UUI_V120

8 BRI_UUI_Q931

Refer to Chapter 4 for a detailed explanation of call control.

See Also

briAcceptCall, briAnswerCall, briBlockCalls, briPlaceCall, briRejectCall, briReleaseCall, briUnBlockCalls

Example


void myShowCallState( CTAHD ctahd )
{
    BRI_CALL_STATUS call_status;

    briGetCallStatus( ctahd, &call_status, sizeof call_status );
    switch( call_status.state )
    {
        case BRI_CC_STATE_STOPPED:       puts("Stopped/not active");     break;
        case BRI_CC_STATE_IDLE:          puts("Idle/active/waiting");    break;
        case BRI_CC_STATE_INCOMING_CALL: puts("Incoming call avail");    break;
        case BRI_CC_STATE_ANSWERING_CALL:puts("Answering call");         break;
        case BRI_CC_STATE_ACCEPTING_CALL:puts("Accepting call");         break;
        case BRI_CC_STATE_PLACING_CALL:  puts("Placing call");           break;
        case BRI_CC_STATE_DISCONNECTED:  puts("Remote disconnected");    break;
        case BRI_CC_STATE_BLOCKING:      puts("App blocking calls");     break;
        case BRI_CC_STATE_CONNECTED:     puts("Connected/conversation"); break;
        case BRI_CC_STATE_REJECTING_CALL:puts("Rejecting incoming call");break;
    }
}


(Page 7 of 15 in this chapter) Version


tech_support@nmss.com
Copyright © 1999, Natural MicroSystems, Inc. All rights reserved.