|
ChannelResourceTransferApplication Method |
Namespace:
VoiceElements.Client
Assembly:
VoiceElementsClient (in VoiceElementsClient.dll) Version: 8.6.1.1
Syntax public void TransferApplication(
string dnis,
string transferData
)
Public Sub TransferApplication (
dnis As String,
transferData As String
)
public:
void TransferApplication(
String^ dnis,
String^ transferData
)
member TransferApplication :
dnis : string *
transferData : string -> unit
Parameters
- dnis
- Type: SystemString
The DNIS of the application that you would like to transfer to. Each client application logs into a Telephony Server
and registers one or more DNIS's. You specify a DNIS registered to the application to which you would like to transfer the call here.
- transferData
- Type: SystemString
An arbitrary string value that you would like to send to the receiving application. This may be parsed in any way on the other end of the transfer and used to setup the call within the target
applications logic accordingly.
Remarks
The application tarnsfer feature is extremely powerful when used correctly. You may have separate code bases running on separate systems and move calls between them at any time using this method.
Tip: Use the Transfer Data parameter to its fullest
Being an arbitrary string, you can use delimiters to pass many data fields like phone number, caller id, data already received from the caller, or anything to help the target application process the call.
How to get the Transfer Data in the target application
The target application code will receive a
New Call event for the DNIS you have specified and for which it is registered. Along with that, comes the data
stored in the
Transfer Data Property for the call in the target application. Simply get the property, parse and handle it as you would like.
Warning: You Must Dispose the Original Channel Once Transferred
You must call
Dispose on the originating channel, preferreably in the finally block to ensure it is processed.
If you do not do so, you could end up playing or receiving inputs from both channels at once. See the example below.
Examples
The example below shows a some code that dials, then if the
Dial Result is connected it transfers to another application with
DNIS
of 4155551212 and sends a comma delimted list of data.
public void DialAndTransferCall()
{
TelephonyServer m_TelephonyServer = new TelephonyServer();
ChannelResource m_ChannelResource = m_TelephonyServer.GetChannel();
string m_PhoneNumber = "2135551212";
DialResult dialResult = m_ChannelResource.Dial(m_PhoneNumber);
switch (dialResult)
{
case DialResult.Connected:
try
{
m_ChannelResource.TransferApplication("4155551212", "2135551212, Outbound, Connected");
}
finally
{
m_ChannelResource.Dispose(true);
}
break;
case DialResult.NoAnswer:
break;
case DialResult.Busy:
break;
default:
break;
}
}
Public Sub DialAndTransferCall()
Dim m_TelephonyServer As New TelephonyServer()
Dim m_ChannelResource As ChannelResource = m_TelephonyServer.GetChannel()
Dim m_PhoneNumber As String = "2135551212"
Dim dialResult__1 As DialResult = m_ChannelResource.Dial(m_PhoneNumber)
Select Case dialResult
Case DialResult.Connected
Try
m_ChannelResource.TransferApplication("4155551212", "2135551212, Outbound, Connected")
Finally
m_ChannelResource.Dispose(True)
End Try
Exit Select
Case DialResult.NoAnswer
Exit Select
Case DialResult.Busy
Exit Select
Case Else
Exit Select
End Select
End Sub
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also Reference
Transfer Data Property