(Page 33 of 69 in this chapter) Version
|
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
|
|
TCP
|
Values
|
|---|---|
|
mfc0
|
· 0 - free call · ADI_BILLINGRATE_DEFAULT
|
|
eam0
|
· 0 - free call · ADI_BILLINGRATE_DEFAULT
|
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;
(Page 33 of 69 in this chapter) Version