Click or drag to resize

ChannelResourceDisconnect Method (Int32)

This method forces the Channel Resource to disconnect any current connections or calls. You may also think of this as "hanging up." This overload of the method requires you to specify a numeric cause code to the carrier telling the reason for the disconnect.

Namespace:  VoiceElements.Client
Assembly:  VoiceElementsClient (in VoiceElementsClient.dll) Version: 8.6.1.1
Syntax
public void Disconnect(
	int causeCode
)

Parameters

causeCode
Type: SystemInt32
This is an optional integer of a cause you would like to pass when disconnecting. This may be passed to the carrier depending on the underlying protocol being used. For a list of these codes, see Q.931 Cause Codes on our support wiki.
Remarks
Disconnecting Without a Code

Optionally, you may specify a numeric cause for your disconnection to the carrier of the call. To do this, use the Disconnect without Cause Code.

Examples
The example below shows two simple one line samples to disconnect a call using different Q.931 Cause Codes.
public void HangupMyCall()
{
  string CallResult;
  int CauseCode = 0;

  switch (CallResult)
  {
    case "User Busy":
    CauseCode = 17; // Busy Code
    break;
    case "Out of Order":
    CauseCode = 33; // Circuit out of order code
    break;
    default:
    CauseCode = 31; // Normal call termination
    break;
  }

  // Hangup any connected call
  m_ChannelResource.Disconnect(CauseCode);
}
See Also