Click or drag to resize

ChannelResource Class

The base class from which all Telephony Channel Types inheirit. It provides the basis for almost all telephony function execution.
Inheritance Hierarchy

Namespace:  VoiceElements.Client
Assembly:  VoiceElementsClient (in VoiceElementsClient.dll) Version: 8.6.4.0
Syntax
public abstract class ChannelResource : RoutableResource

The ChannelResource type exposes the following members.

Properties
  NameDescription
Public propertyCode exampleAni
This is the originating number of the last inbound call (if available).
Public propertyCallConnected
The time the call connected
Public propertyCallEnd
The time the call was terminated.
Public propertyCode exampleCallerIdName
This is the originating name field of the last inbound call (if available).
Public propertyCallNumber
The call number on the server of the current or last call.
Public propertyCode exampleCallProgress
Gets or Sets the Call Progress Mode for this channel.
Public propertyCode exampleCallProgressOverrides
A serializable object that provides override information to the call progress template. This is used to override Dialogic call progress settings for the next call.
Public propertyCode exampleCallProgressTemplate
Gets or sets the call progress template to use as a basis for the next call. This is used to override Dialogic call progress settings.
Public propertyCallStart
The time the call was started.
Public propertyConference
Represents the Conference of which this resource is a member.
(Inherited from RoutableResource.)
Public propertyConferenceAttributes
Represents the Conference Attributes of a Conference to which this resource is a member.
(Inherited from RoutableResource.)
Public propertyDeviceName
The unique name of this resource / device on the server. This is useful for following, logging a call or thread.
(Inherited from RoutableResource.)
Public propertyCode exampleDialResult
Gets the Dial Result of the last call based on the Call Progress Mode setting.
Public propertyCode exampleDnis
This is the DNIS or the inbound number dialed of the last inbound call.
Public propertyDropError
The Drop Error Code of a disconnected call.
Public propertyCode exampleDropTime
A time at which the server should automatically drop the call whether it is disonnected or not. This value is Universal Time.
Public propertyCode exampleFaxResource
Gets the fax resource associated with this channel. To get a fax resource, call Get Fax Resource Method on this channel.
Public propertyCode exampleGcCause
GC Cause code for a disconnected call if available.
Public propertyCode exampleGcCauseMessage
GC Cause message for a disconnected call if available.
Public propertyCode exampleGeneralCause
General Cause code for a disconnected call if available.
Public propertyCode exampleGeneralCauseMessage
General Cause message for a disconnected call if available.
Public propertyListeners
A list of Routable Resources which are currently listening to this resource.
(Inherited from RoutableResource.)
Public propertyListentingTo
A Routable Resources to which this resource is currently listening.
(Inherited from RoutableResource.)
Public propertyCode exampleMaximumTime
Sets the maximum time in seconds to wait for a Dial to complete. Default is 30.
Public propertyCode exampleOriginatingPhoneNumber
This is the CallerID number sent with an oubound call when a Dial is executed.
Public propertyCode examplePortIndexer
The one based index of this channel on the server.
Public propertyTransferredCall
A flag to indicate that this call was transferred from another application. If true, TransferredData may contain data passed from the other application.
Public propertyCode exampleTransferredData
Gets the data sent from another application which has invoked the Transfer Application Method to this application.
Public propertyCode exampleVoiceResource
The Voice Resource associated with this channel. Use this for audio functions like play, record and getting digits.
Top
Methods
  NameDescription
Public methodCode exampleAnswer
This method is used to pickup an inbound call received on a Channel Resource.
Public methodCode exampleDial
Dials the phone number or destination specified in the phonenumber parameter.
Public methodCode exampleDisconnect
This method forces the Channel Resource to disconnect any current connections or calls. You may also think of this as "hanging up."
Public methodCode exampleDisconnect(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.
Protected methodCode exampleDispose
This method forces a dispose of the Channel Resource object. Always do this in hang up handling to ensure clean up.
(Overrides ClientObject.Dispose(Boolean).)
Public methodCode exampleGetFaxResource
Retreives a compatible Fax Resource for this Channel. It also sets the Fax Resource Property of the Channel.
Public methodCode exampleIsConnected
Returns the status of any current call. True if a call is connected, false if not connected.
Public methodRouteFull(TelephonyLinkInfo)
This overload is for Voice Elements Internal Use Only! To correctly route, use the Full Route Method.
(Inherited from RoutableResource.)
Public methodCode exampleRouteFull(RoutableResource)
Completes a full route between two Routable Resources. Both channels then listen to each other.
(Inherited from RoutableResource.)
Public methodRouteHalf(TelephonyLinkInfo)
This overload is for Voice Elements Internal Use Only! To correctly route, use the Half Route Method.
(Inherited from RoutableResource.)
Public methodCode exampleRouteHalf(RoutableResource)
Completes a half route between two Routable Resources. The channel calling this method listens to the one in the parameter, the second cannot hear.
(Inherited from RoutableResource.)
Public methodSetConferenceAGCLevels
Sets the levels for the AGC in conferencing. If all values are set to negatives, then the system wide AGC applies.
(Inherited from RoutableResource.)
Public methodSetConferenceECTailDelay
Sets the Echo Tail Delay in conferencing.
(Inherited from RoutableResource.)
Public methodSetConferenceFEGLevel
Sets the front end gain in conferencing. If set to 0, front end gain is turned off.
(Inherited from RoutableResource.)
Public methodCode exampleSetMonitorData
Sets the Monitor Data element for this channel when viewed through the Voice Elements Dashboard. This is a collection of data elements you define to communicate from your application through the VE Dashboard.
Public methodCode exampleSetMonitorStatus
Sets the Monitor Status element for this channel when viewed through the Voice Elements Dashboard.
Public methodStopAllListeners
Forces all Routable Resources currently listening to this resource to stop.
(Inherited from RoutableResource.)
Public methodCode exampleStopDial
Instructs the channel to stop a currently in progress dial.
Public methodStopListener
Forces a apecific Routable Resource currently listening to this resource to stop.
(Inherited from RoutableResource.)
Public methodStopListening
Forces this resource to stop listening to all Routable Resources.
(Inherited from RoutableResource.)
Public methodCode exampleTransferApplication
Transfers the Channel Resource to a different application on the same Telephony Server.
Top
Events
  NameDescription
Public eventDialComplete
Event Fired at the completion of a dial operation.
Public eventCode exampleDisconnected
Fires when a call disconnects or hangs up. Do your cleanup in this event code.
Public eventCode exampleNewCall
Fires when there is a new inbound call sent from the Voice Elements Server.
Top
Fields
  NameDescription
Protected fieldm_DialResult
Top
Remarks
A Channel Resource is a type of Routable Resource. Being inherited from there, it has all the attributes thereof. It also provides the base class for all voice channel interface types including: PRI/ISDN Lines, Analog/P.O.T.S. Lines, T1 Lines, SIP VoIP Trunks and Stations. The most common uses for a Channel Resource are:

Note that Channel Resources are accompanied by a Voice Resource through which the many of the most common voice functions are executed. By accessing this object, you can do the following and more:
Examples
The code snippets below illustrate basic and trimmed down executions of the common uses in the lists above.
public void ExecuteChannelMethods()
{
  // To get a channel, you must first get a link to a Telephony Server.  You may need to pass a username password here.
  TelephonyServer m_TelephonyServer = new TelephonyServer();

  // Get your channel resource from the server
  ChannelResource m_ChannelResource = m_TelephonyServer.GetChannel();

  // Example 1: Dial an oubound call
  string phoneNumber = "2135551212";
  m_ChannelResource.Dial(phoneNumber);

  // Next, use the voice resource of the channel to do some more things
  // First, play an audio file
  m_ChannelResource.VoiceResource.Play(@"C:\Audio\Sample.wav");

  // Get digits from the caller
  TerminationCode terminationCode = m_ChannelResource.VoiceResource.GetDigits();
  string m_Digits = m_ChannelResource.VoiceResource.DigitBuffer;

  // Play text to speech to the caller
  m_ChannelResource.VoiceResource.PlayTTS("Hello, this is your application speaking.  Please say whatever you like.");

  // Record the callers response to the file specified
  m_ChannelResource.VoiceResource.Record(@"C:\Audio\RecordedCall.wav");
}
See Also