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


adiSetBilling

Description

Sets billing information relative to an incoming call.

Prototype

DWORD adiSetBilling ( CTAHD ctahd,
unsigned billingrate)

ctahd CTA context handle returned by ctaCreateContext.

billingrate Billing rate (a country-dependent unit of cost).

Return Values

Events

ADIEVN_BILLING_SET
The billing information was sent to the network. The value field contains the actual call rate. Note that this rate could be different from the requested rate.

ADIEVN_PROTOCOL_ERROR
The current TCP does not support billing rate setting operations. The event value field contains ADI_CC_ERR_NOT_SUPPORTED.

ADIEVN_SEQUENCE_ERROR
The TCP was not in an appropriate state. The event value field contains ADI_SEQ_ERR_WRONG_STATE.

ADIEVN_CALL_DISCONNECTED
The remote party has hung up.

Details

adiSetBilling sets billing information relative to an incoming call. Setting the billing rate is supported only with mfc0 and eam0 TCPs. The billing rate can be set only when the TCP is in certain states. For more information about setting billing under specific TCPs, refer to the AG CAS for ADI Service Installation and Developer's Manual.

This function is not supported by AG ISDN.

The following table shows the states in which adiSetBilling can be called for each supported TCP:
State

mfc0

eam0

Idle

Y

Y

Incoming Call

Y

Y

Accepting Call

N

N

Answering Call

N

N

Blocking

N

N

Connected

N

N

Rejecting

N

N

Out of Service

N

N

Disconnected

N

N

Valid values for billingrate also differ from protocol to protocol. The following table shows valid values for each supported protocol:
TCP

Values

mfc0

· 0 - free call

· ADI_BILLINGRATE_DEFAULT

eam0

· 0 - free call

· ADI_BILLINGRATE_DEFAULT

Example

DWORD MySetBilling (CTAHD ctahd, unsigned billingrate)
{
CTA_EVENT event;
CTAQUEUEHD ctaqueuehd;
DWORD ret;

adiSetBilling (ctahd, billingrate);

ctaGetQueueHandle(ctahd, &ctaqueuehd);

ctaWaitEvent( ctaqueuehd, &event, CTA_WAIT_FOREVER);

switch (event.id)
{
case ADIEVN_BILLING_SET:
if (event.value == ADI_BILLINGRATE_DEFAULT)
/*
* note: although we never requested the billing rate to be
* equal to the network default, the billing set operation
* can be rejected by the network, and this is what we have...
*/
printf ("\tMySetBilling: billing rate set to network default\n");
else
printf ("\tMySetBilling: billing rate set to %d cents/minute\n",
event.value);
ret = SUCCESS;
break;

case ADIEVN_PROTOCOL_ERROR:
printf ("\tMySetBilling: set billing not supported by protocol\n");
ret = MYFAILURE;
break;

case ADIEVN_SEQUENCE_ERROR:
printf ("\tMySetBilling, bad state for adiSetBilling\n");
ret = MYFAILURE;
break;

case ADIEVN_CALL_DISCONNECTED:
ret = MYDISCONNECT;

default:
printf ("\tMySetBilling, unexpected event during adiSetBilling, 0x%x\n",
event.id);
ret = MYFAILURE;
break;
}

return ret;


Table of Contents Index NMS Glossary Previous Page Next Page (Page 33 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.