Você está na página 1de 28

Dialer Client External Application

Integration Document

Cube Software Pvt Ltd.


B-8, Sector-60
Noida, UP-201301
+91-120-4057100

Dialer Client External Application Integration Document

Table of Contents

1. Introduction..................................................................................................................... 3
2. Dialer Client Messaging Structure................................................................................4
2.1 Login Message:........................................................................................................... 4
2.2 LogOut Message:........................................................................................................ 5
2.3 Break Start Message:.................................................................................................. 6
2.4 Break End Message:................................................................................................... 7
2.5 New Call Message...................................................................................................... 8
2.6 Close Call Message.....................................................................................................9
2.7 IVRSDATA.............................................................................................................. 10
2.8 Agent Popup Status...................................................................................................11
2.9 Server DateTime....................................................................................................... 12
2.10 Agent Soft Phone Commands................................................................................ 13
2.11 Extension Status......................................................................................................14
2.12 Manual pass............................................................................................................ 15
2.13 Agent Phone............................................................................................................16
2.14 VoiceFile Information............................................................................................ 17
3. Clink Overview.............................................................................................................. 18
3.1 Methods.....................................................................................................................18
3.1.1 Initialize Method............................................................................................... 18
3.1.2 Request Method.................................................................................................19
3.1.3 Send Method......................................................................................................20
3.2 Clink Property........................................................................................................... 22
3.2.1 ClearSendData Property.................................................................................... 22
3.2.2 NodeDescription................................................................................................22
3.2.3 NodeDescriptionList() Property........................................................................22
3.2.4 NodeName Property.......................................................................................... 23
3.2.5 NodeNameList() Property................................................................................. 23
3.2.6 NodeTotal Property........................................................................................... 23
3.2.7 ReceivedData() Property................................................................................... 24
3.2.8 ReceivedDataTotal Property............................................................................. 24
3.2.9 SendData() Property.......................................................................................... 24
3.2.10 SendDataTotal Property.................................................................................. 25
3.2.11 Timeout Property.............................................................................................25
3.3 CLink Events.............................................................................................................26
3.3.1 DataReceived.....................................................................................................26
3.3.2 RequestReceived Event.....................................................................................27

Cube Software Pvt Ltd

Page 2

Dialer Client External Application Integration Document

1. Introduction
This document defines the messaging structure used between dialer client application and
external third party application. The message structure can be transmitted via TCP socket
or text file or CubeLink.dll file. In all the cases the structure remains the same. The
format of the message as defined below.
<Message type>;<Parameter 1>;<Parameter 2>;<Parameter 3>;..;<Parameter n>;<03>

For TCP and Text File Integration


Each message is identified by Message type.
The number of parameter passed can vary depending on the message type and all are
compulsory fields.
Each parameter is separated by a semicolon ;
Each message is terminated by Hex value 03 to mark the end of message string.
For CubeLink integration
The message will always be send to specific node.
Each message is identified by Message type.
The number of parameter passed can vary depending on the message type and all are
compulsory fields.

Cube Software Pvt Ltd

Page 3

Dialer Client External Application Integration Document

2. Dialer Client Messaging Structure


2.1 Login Message:
Start Dialer Client Application. A login for will appear. On successful login in dialer
client, the dialer client application will launch the third party application and pass the
following message string. The third party application on receiving the message string will
get the agent login.
Dialer
Client

External
Third Party
Application
Login;[Agentid];[AgentName];[CampaignId];[LoggedinDateTime]

Sl
No
1
2

Message

Data Type

Possible Values

Description

Login
AgentID

String
String

Login
As defined in dialer database

AgentName

String

As defined in dialer database

CampaignID

String

As defined in dialer database

LoggedinDateTime

String

Date in DD MMM YYYY


HH:MM:SS format
e.g: if the current date is
26th Jun 2014 2:00 PM
then it is to be defined as
26 Jun 2014 14:00:00

Message Identifier
Agent ID of the agent who is
logged in as defined in PDManager
Name of the agent as defined in
PDManager
Campaign ID in which the agent
logs in
Server Login Date and Time

Cube Software Pvt Ltd

Page 4

Dialer Client External Application Integration Document

2.2 LogOut Message:


Logout can be done on both the interface (dialer client as well as external third party
interface). On logout the messaging will be as follows

Logoff

LogOff;Loggedoff
LogOff;Error: .......

Sl No
1

Message
Logoff

Data Type
String

Possible Values
Logoff

Description
Message Identifier

Sl No
1
2
3

Message
LogOff
LoggedOff
Error:

Data Type
String
String
String

Possible Values
LogOff
LoggedOff
Error:<Err description>

Description
Message Identifier
Logoff successful
Logoff failure followed by
reason

Cube Software Pvt Ltd

Page 5

Dialer Client External Application Integration Document

2.3 Break Start Message:


On Break start the message will be as follows

Break

Break;OK
Break;Error: .....

Sl No
1

Message
Break

Data Type
String

Possible Values
Break

Description
.Message Identifier. Request
for Break from External
Application

Sl No
1

Message
Break

Data Type
String

Possible Values
Break

2
3

OK
Error:

String
String

OK
Error:<Err Description>

Description
Message Identifier. Response
to Break Request
Request successful
Request failure followed by
reason

Cube Software Pvt Ltd

Page 6

Dialer Client External Application Integration Document

2.4 Break End Message:


On Break End the message will be as follows

BreakEnd;OK

BreakEnd;OK
BreakEnd;Error ..

Sl No
1

Message
BreakEnd

Data Type
String

Possible Values

Description
.Message Identifier. Request to
End Break from External
Application

Sl No
1

Message
BreakEnd

Data Type
String

Possible Values

2
3

OK
Error:

String
String

Description
Message Identifier. Response
to BreakEnd Request
Request successful
Request failure followed by
reason

Cube Software Pvt Ltd

Page 7

Dialer Client External Application Integration Document

2.5 New Call Message


When a new call will be pushed to agent from dialer then the following message will be
sent to the external third party application
NewCall;[PhoneId];[PhoneNo];[DateTime];[Identifier];[Attempt];[ForCampaig
nId];[StatusId];[AreaTimeGap];[SmdrRunning];[Priority]

Sl
No
1
2

Message

Data Type

NewCall
PhoneID

String
String

PhoneNo

String

4
5

DateTime
Identifier

String
String

Attempt

String

ForCampaignID

String

StatusID

String

AreaTimeGap

String

10

SmdrRunning

String

11

Priority

String

Cube Software Pvt Ltd

Possible Values

string (length=12) as
defined in dialer
database
Phone number of the
caller / called party

Unique number to
phoneid
for
a
campaign
Current
attempt
count
Call
for
which
campaignid. In case
of
overflow
campaign
the
campaigned
will
change

True / False. No
action to be done on
this value
0 / 1 / 2.
Priority for normal /
urgent and call backs
call

Description
Message Identifier.
PhoneID as in the database.
It is always unique to this
number.
Phone Number of the caller
on which the call is
connected.
Date Time of Call

Current Attempt count for


this number
For which campaign id the
call was dialed. In case of
overflow campaign it will be
over flow campaign id

Call Statuis ID by default


connected.
Time Zone difference as
defined in PDManager
Whether SMDR is running or
not.
Priority of the call.

Page 8

Dialer Client External Application Integration Document

2.6 Close Call Message


When ever a call is disposed via the third party application the following message has to
be passed to the dialer client. While closing the call there are 4 options available to
external interface.

FreeMe;[Empty|Break|Logout|Manual];[DispositionCode];[CallBackDateT
ime];[MustbeTransferedToMe];[Remarks];[Follow up Number]

FreeMe;OK
FreeMe;Error: ....

Sl
No
1

Message
FreeMe

Data
Type
String

Possible Values

Empty
FreeMe
Break
Logout
Manual

Empty|Break|Logout|Freeme|
Manual

String

DispositionCode

String

CallBackDateTime

String

MustbeTransferedToMe

String

Remarks

String

Follow up Number

String

Description
Message Identifier.

Call back date and time in


DD
MMM
YYYY
HH:MM:SS format
1/0

Empty or Freeme to
close the call and wait
for next call
Break close the
current call and go on
break
Logout Close the call
and Logout
Manual only sets the
value. Does not free the
agent for next call.
Call Disposition code
as
defined
in
PDManager
Call back preference
time for current number
1 if call is to be
transferred to same
agent else 0
Any remakes entered
by agent.
Follow up Number if
any. This feature is
used
only
when
CallBackDateTime (# 4)

had been provided.

Cube Software Pvt Ltd

Page 9

Dialer Client External Application Integration Document

2.7 IVRSDATA
The message will be sent from dialer client to external interface just after the new call
message. This packet will inform the third party application if any ivrs input had been
received including the CLIP and DNIS.

IVRSDATA;param1;param2;param3,..

Sl
No
1
2

Message

Data Type

IVRSDATA
Param1,Param2,P
aram3,..Param
N

String
String

Possible Values

CLI=<CLIP Obtained>
DNI=<DNIS Obtained>
INOUT=<INBOUND or
OUTBOUND CALL>
ClientID=<Client ID value in
Phonemst table in CubeDialer
Database>

Description
Message Identifier.
Param1, Param2 etc.
can be any variable
that
had
been
initialized in the IVR
Flow for a campaign.
This packet will also
include CLIP and
DNIS information.
Example:
IVRSDATA;CLI=991
0062020;DNI=120405
7100;INOUT=OUTBO
UND;Clientid=<String
Value>

Cube Software Pvt Ltd

Page 10

Dialer Client External Application Integration Document

2.8 Agent Popup Status


The message will be sent from dialer client to external interface when ever there is
change in agent extension status.

BusyCallState;[Duration];[DIAL|TALK|HOLD|WRAP]

Sl
No
1
2
3

Message

Data Type

BusyCallState
Duration
DIAL|TALK|HOLD|WRAP

String
String
String

Cube Software Pvt Ltd

Possible Values

Description
Message Identifier.
Duration since last state
TALK when the agent is
connected
HOLD- when the agent
had put the called number
on HOLD.
WRAP- when is in wrap
up state and is about to
close the call.

Page 11

Dialer Client External Application Integration Document

2.9 Server DateTime


To request server date time the external application will have to pass follwong message to
dialer client application.

SerVerDateTime

SerVerDateTime;[DateTime]

Sl
No
1

Message

Data Type

SerVerDateTime

String

Sl
No
1

Message

Data Type

SerVerDateTime

String

DateTime

String

Cube Software Pvt Ltd

Possible Values

Description
.Message Identifier. Request for
ServerDateTime from External
Application

Possible Values

DD MMM YYYY
HH:MM:SS

Description
Message Identifier. Response to
ServerDateTime Request
Date Time in DD MMM YYYY
HH:MM:SS (24 hours) Format.
Example 26 JUN 2014 14:00:00

Page 12

Dialer Client External Application Integration Document

2.10 Agent Soft Phone Commands


External application can have soft phone commands as well as we have in our dialer
client application. To control the features of soft phone flowing commands needs to be
passed to dialer client application.
AnswerCall;
BlindTransfer;[DialString]
CompleteTransfer;Conference
CompleteTransfer;Transfer
DialCall;[DialString]
MakeCall;[DialString]
DropCall;
HoldCall;
Redirect;[DialString]
SetupTransfer;[DialString]
UnHoldCall;

Sl
No
1

Message

Data Type

AnswerCall

String

BlindTransfer;[DialString]

String

CompleteTransfer;Conference

String

CompleteTransfer;Transfer

String

MakeCall;[DialString]

String

DropCall;

String

1
1

HoldCall;
Redirect;[DialString]

String
String

SetupTransfer;[DialString]

String

UnHoldCall;

String

Cube Software Pvt Ltd

Possible Values

Description
To answer a call from soft
phone
To transfer call call blindly
to some number or
campaign
or
agent.
Destination is defined by
DialString
To conference a call from
soft phone
To
have
supervised
transfer in a call
To request a number to be
dialed out. Destination is
defined in DialString
To drop or disconnect the
current call
To put the caller on Hold.
To transfer the call along
with popup information to
a agent or campaign.
Destination is defined by
DialString
Initiate supervised transfer
of a call. Destination is
defined by DialString
Unhold the call if the call
is put on Hold.

Page 13

Dialer Client External Application Integration Document

2.11 Extension Status


The message will be sent from dialer client to external interface. This will display the
actual status of the phone (example: IDLE, Offering, Talk, Disconnected, OnHold,
etc.)

PortStatus;[AgentExtnState]

Sl
No
1
2

Message

Data Type

PortStatus
AgentExtnState

String
String

Cube Software Pvt Ltd

Possible Values

Description
Message Identifier.

Page 14

Dialer Client External Application Integration Document

2.12 Manual pass


The message will be sent from external interface to dialer client. This will open up the
manual pass form and provide the agent to request phone number for calling on urgent
basis. All calls made via manual pass will be recorded.

ManualPass

Sl
No
1

Message

Data Type

ManualPass

String

Cube Software Pvt Ltd

Possible Values

Description
Message Identifier.

Page 15

Dialer Client External Application Integration Document

2.13 Agent Phone


The message will be sent from external interface to dialer client. This will open up the
soft agent phone pop on the screen and the agent will be able to handle the calls via this
phone as well. After CTI integration this soft phone will be able to control your physical
phone. All calls made via agent phone is equivalent that the calls are being phone through
physical phone and no records are being maintained for this.

AgentPhone

Sl
No
1

Message

Data Type

AgentPhone

String

Cube Software Pvt Ltd

Possible Values

Description
Message Identifier.

Page 16

Dialer Client External Application Integration Document

2.14 VoiceFile Information


The message will be sent from Dialer Client to External interface. This will Notify the
external application the name of the voice file that is created with this call. The packet
shall be received when the call is connected and generally after PortStatus=Connected
packet is received.

VoiceFile;[FileName]

Sl
No
1

Message

Data Type

VoiceFile

String

Cube Software Pvt Ltd

Possible Values

Description
Name of Voice File without
Format. External Application
needs to suffix .mp3 with the
name of file received so that
it can be accessed over
predefined HTTP path.

Page 17

Dialer Client External Application Integration Document

3. Clink Overview
The CLink control provides a powerful and easy-to-use communications link between
Windows applications. Using the CLink control, you can send and receive data between
different applications running on the same machine or between threads within a single
application. The CLink control also allows you to process all data requests through one
central location to minimize database or other data connections.
Note that the CManager control should be used to monitor the status of Visual Voice
activity on one or more phone lines. The CManager control replaces the need to use the
CLink control for monitoring and controlling CubeGlobalCall applications (that is,
applications that contain the Voice control). You should use the CLink control to send
data or requests between applications, or to monitor and control applications that do not
contain a Voice control, such as the Order Status Server sample application.
3.1

Methods

3.1.1 Initialize Method


Description
Initializes the CLink control.
Syntax
object.Initialize(Key as string)
Inputs
Argument
Default Property
Key
String

Description
Required. String
value to initialize the
application.

Returns
Remarks

None
If you created the Clink control in code (i.e., Dim CLink1 as New
CLink), use the Initialize method to bring the Link control to a runtime
state. If you created the CLink control by dropping it on a form, the
control is automatically initialized when the form is loaded, unless the
AutoInitialize property is set to FALSE.

Example

Dim CLink1 as New Clink


CLink1.Initialize(key)

Cube Software Pvt Ltd

Page 18

Dialer Client External Application Integration Document

3.1.2 Request Method


Description
Sends data to another node, and waits for the target node to complete
processing before returning with data from the target node.
Syntax
object.Request ToNode, Subject, Data1, ... , DataN
Inputs
Argument
Default Property
Description
ToNode
Required. String value indicating
the node to which the request will
be sent.
Subject
SendSubject
Optional. String value indicating
the subject of the request.
Data1,
SendData()
Optional. String value(s)
Data2, ... ,
indicating data to send along with
DataN.
the request. You can either place
data in the SendData() property
array or specify up to ten elements
as arguments. The advantage of
the property array is it can contain
up to 255 elements.
-SendDataTotal
If you are sending data in the
SendData() property array, you
must use SendDataTotal to specify
the number of elements in the
array. You don't need to set it if
you use the method arguments
(Data1, ..., Data10) or if you aren't
sending any data.
Retruns
Property
Description
ReceivedData()
An array containing data populated by the target
node.
ReceivedDataTotal The total number of elements in the
ReceivedData() property array.
Remarks
This method makes a synchronous request to another node, either in the
same application or in a different application. The method sends the
data and returns only after the target node has processed the request.
The target node receives a RequestReceived event when the data is
sent. When the target node finishes processing, it can return data via its
own array specified by the SendData property. See the
RequestReceived event for more information. If it refers to a node on
the local machine, only the node name is used (e.g. SERVER1). After
this method returns, the ReceivedDataTotal property will contain the
number of items returned by the target node. If the ClearSendData
property is True, the SendData property array elements are
automatically set to null. A Timeout error is returned if the request is
not processed before the period specified in the Timeout property. An
error is generated if the target node sets the RequestReceived event's
Cube Software Pvt Ltd

Page 19

Dialer Client External Application Integration Document

ReturnCode Parameter to a non-zero value. The error value, returned


by Visual Basic's Err Function, will be the value specified in the
ReturnCode parameter.
Example

Send a customer ID of 12345 to the node called SERVER1


and wait for return data
On Error Resume Next
handle errors below
Link1.Request "SERVER1", "Customer", 12345
If Err = 0 Then
no error occurred
All was received OK by server1
For I = 0 to Link1.ReceivedDataTotal - 1
# of items returned
List1.AddItem Link1.ReceivedData(I)
display each item
Next I
Else
an error occurred
List1.AddItem "Error receiving data"
display error message
End If

3.1.3 Send Method


Description
Sends data to another node and returns immediately.
Syntax
object.Send ToNode, Subject, Data1, ... , DataN
Inputs
Argument
Default Property
Description
ToNode
Required. A case-sensitive string
value indicating the node to which
the data will be sent.
Subject
SendSubject
Optional. String value indicating
the subject of the data.
Data1,
SendData()
Optional. String value(s)
Data2, ... ,
indicating data to send along with
DataN.
the request. You can either place
data in the SendData() property
array or specify up to ten elements
as arguments. The advantage of
the property array is it can contain
up to 255 elements.
-SendDataTotal
If you are sending data in the
SendData() property array, you
must use SendDataTotal to
specify the number of elements in
the array. You don't need to set it
if you use the method arguments
(Data1, ..., Data10) or if you aren't
sending any data.
Returns
Nothing
Remarks

Cube Software Pvt Ltd

This method can be used to send data to another node, either in the
same application or in a different application. The method sends the
data and returns immediately. The target node receives a DataReceived
event when the transfer of data is complete. If it refers to a node on the
local machine, only the node name is used (e.g. SERVER1). If the
Page 20

Dialer Client External Application Integration Document

ClearSendData property is True, the SendData property array elements


are automatically set to null.
Example

Cube Software Pvt Ltd

'use the DataN arguments to send data to target node CLIENT1


'with subject of Customer
Link1.Send "CLIENT1", "Customer", "Joe Jones",_
"1000 Main St.", "Cambridge"

Page 21

Dialer Client External Application Integration Document

3.2

Clink Property

3.2.1 ClearSendData Property


Description
Specifies whether the SendData() property array and the
SendDataTotal property will be cleared after a Send or Request method
is complete. The default is True.
Syntax
object.ClearSendData[= Boolean]
Data Type
Boolean
Setting
Description
True
The default. The SendData() property array will
automatically be cleared after each Send or
Request method.
False
The SendData() property array will not be
cleared automatically.
Remarks
Set this property to False if you plan to send the same data to multiple
nodes. This way you do not have to repopulate the SendData() property
array after each method.The following table is a listing of valid
ClearSendData property settings:
Link1.SendData(0) = "12345"
Example
Link1.SendDataTotal = 1
Link1.ClearSendData = False
For I = 0 To Link1.NodeTotal 1
Link1.SendToNode = NodeNameList(I)
Link1.Send
Next

3.2.2 NodeDescription
Description
A string that describes the node. The default is null.
Syntax
object.NodeDescription[ = string$]
Data Type
String
Remarks
Use the NodeDescription property to describe the node for
informational purposes. The NodeName property contains the name of
the node. The NodeDescription property string is limited to 129
characters, and will be truncated at that length if you attempt to set it to
a longer value.
Link1.NodeDescription = "Server node to process database requests"
Example
3.2.3 NodeDescriptionList() Property
Description
Returns the descriptions of all active nodes.
Syntax
object.NodeDescriptionList(index%)
Data Type
String
Remarks
Use this property to retrieve a description of other active nodes. The
starting index is 0, and the number of entries is equal to the NodeTotal
property.The name of each node described in the NodeDescription()
Cube Software Pvt Ltd

Page 22

Dialer Client External Application Integration Document

property array is returned via the NodeNameList() property array.


Example

For I = 0 To Link1.NodeTotal 1
List1.AddItem Link1.NodeNameList(I) & " " & Link1.NodeDescriptionList(I)
Next I

3.2.4 NodeName Property


Description
Specifies the name of the node.
Syntax
object.NodeName[ = string$]
Data Type
String
Remarks
Use this property to specify a node name. This name must be unique
among all occurrences of the VLink control on the same machine. A
list of all currently active node names is returned via the
NodeNameList() property array. If the NodeName is "" at design time,
a unique node name will be generated and returned via the NodeName
property at run time. The format is VlinkN, where N is a unique node
identification number. The NodeName property string is limited to 32
characters. If you attempt to set it to a longer value, it will be truncated
at 32 characters and a runtime error will be returned. If you specify a
node name already used by another VLink control, a runtime error will
be generated.
Link1.NodeName = "SERVER1"
Example
3.2.5 NodeNameList() Property
Description
Returns a list of node names for all active nodes.
Syntax
object.NodeNameList(index%)
Data Type
String
Remarks
Use this property to retrieve the node name of another active node. The
starting index is 0, and the number of entries is equal to the NodeTotal
property.
For I = 0 To Link1.NodeTotal 1
Example
List1.AddItem Link1.NodeNameList(I) & " " & Link1.NodeDescriptionList(I)

Next I

3.2.6 NodeTotal Property


Description
Returns the total number of active nodes in the system.
Syntax
object.NodeTotal
Data Type
Integer
Remarks
Use this property to retrieve the total number of nodes. As nodes are
created and deleted, this number will change appropriately. The
maximum number of nodes is 255.
For I = 0 To Link1.NodeTotal 1
Example
List1.AddItem Link1.NodeNameList(I) & " " & Link1.NodeDescriptionList(I)

Next I

Cube Software Pvt Ltd

Page 23

Dialer Client External Application Integration Document

3.2.7 ReceivedData() Property


Description
Returns an array of strings sent from another node.
Syntax
object.ReceivedData(index%)
Data Type
Variant
Remarks
Use this property to retrieve the data sent from another active node.
When another node sends data (via a Request or Send method), its
SendData() property array is copied to the target node's ReceivedData()
property array. The starting index is 0 and the number of items received
is returned in the ReceivedDataTotal property.When data is sent from
another control, via a Send or Request method, a DataReceived event
or a RequestReceived event is triggered in the receiving node,
respectively. Note, however, that data returned in response to another
node's request will not trigger an event in the requesting node.
Sub Link1_DataReceived (FromNode As String, Subject As String)
Example
Text1.Text = FromNode
'display where the data came from
Select Case Subject
Case "Customer"
'display data
For I = 0 to Link1.ReceivedDataTotal 1
'number of items
List1.AddItem Link1.ReceivedData(I)
'display each item
Next I
Case "Update"
'update data
Customers.Edit
Customer("Name") = Link1.ReceivedData(0)
Customers.Update
End Select
End Sub

3.2.8 ReceivedDataTotal Property


Description
Returns the number of items in the ReceivedData() property array
when another node sends or returns data. This property is read-only.
Syntax
object.ReceivedDataTotal
Data Type
Integer
Remarks
This property is copied from the requesting or sending node's
SendDataTotal property.
For I = 0 to Link1.ReceivedDataTotal - 1
'number of items
Example
List1.AddItem Link1.ReceivedData(I)

'display each item

Next I

3.2.9 SendData() Property


Description
Specifies an array of strings to send to another node.
Syntax
object.SendData(index%)
Data Type
Variant
Remarks
Use this property to send data to another active node. The starting
index is 0, and this array can contain up to 255 elements.Before
sending data, you must set the SendDataTotal property to the number
of elements you want to send.Any subsequent Send or Request method
will send the data in the SendData() property to the node specified in
Cube Software Pvt Ltd

Page 24

Dialer Client External Application Integration Document

the ToNode argument. The data will appear in the target node's
ReceivedData() property array. In a RequestReceived event, if the
ReturnData Parameter is set to True, the SendData() property array will
also be sent to the requesting node.If the ClearSendData property is set
to True, this array is automatically cleared after every Send or Request
method..
Example

Link1.SendData(0) = "John Smith"


arrayLink1.SendData(1) = "1000 Main St."
Link1.SendData(2) = "Cambridge"
Link1.SendDataTotal = 3
Link1.Send "CLIENT1", "Customer"

'fill SendData() property

'send 3 items
'send data with subject Customer to target
'node CLIENT1

3.2.10 SendDataTotal Property


Description
Specifies the number of elements in the SendData() property array to
send during a Send or Request method or when returning data in a
RequestReceived event.
Syntax
object.SendDataTotal[ = items%]
Data Type
Integer
Remarks
When data is sent via a Send or Request method or returned via a
RequestReceived event, the SendDataTotal property will be copied to
the target node's ReceivedDataTotal property.
Link1.SendData(0) = "123"
'fill SendData() property array
Example
Link1.SendData(1) = "100"
Link1.SendDataTotal = 2
Link1.Send "CLIENT1"

'send 2 items
'send data to CLIENT1 target node

3.2.11 Timeout Property


Description
Specifies the maximum number of seconds the a VLink Request
method will wait for the request to be processed.
Syntax
object.Timeout[ = setting%]
Data Type
Integer
Remarks
The default Timeout value is 0, no timeout, which means the Request
method will wait until its request is processed. Valid range is 0 32767.
If the timeout expires before the request is processed, a vlTimeout error
is returned.
Link1.Timeout = 30
Wait 30 seconds for data
Example
Link1.Request "SERVER1", "Customer", 12345

Cube Software Pvt Ltd

Page 25

Dialer Client External Application Integration Document

3.3

CLink Events

3.3.1 DataReceived
Description
This event is triggered when another node has sent data via the Send
method and the data is now available at this node.
Syntax
Sub object_DataReceived(FromNode As String, Subject As String)
Data Type
Integer
Remarks
The data is returned via the ReceivedData() property array. The
ReceivedDataTotal property returns the numbers of elements in the
ReceivedData() property array.If multiple nodes send data to the same
server node (or one node sends multiple consecutive data items), this
event will trigger once for the first request, and the second request will
be queued behind the first request. However, if the code you place in
this event yields control to another process (e.g., when you execute a
Visual Basic DoEvents statement or a Visual Voice PlayFile method),
then the events are not queued behind each other. As a result, the first
lines of code in the DataReceived event should copy the contents of the
ReceivedData() property array to a locally declared variable array,
because the ReceivedData() property will be overwritten when the
second DataReceived event is triggered. In this event, you should not
execute any code that would result in Visual Basic yielding control of
the processor. For example, you should not execute any functions such
as Visual Basic's DoEvents()or any Visual Voice methods, unless you
first save any information (e.g., FromNode, Subject, ReceivedData,
ReceivedDataTotal) you might need after the function completes.
The following table is a listing of the DataReceived event parameters:
Parameter
Description
FromNode
The name of the node that sent the data
Subject
The subject of the received data. The source node
specified this via its SendSubject property.
Sub Link1_DataReceived (FromNode As String, Subject As String)
Example
Text1.Text = FromNode
'display where the
Select Case Subject
'data came from
Case "Customer"
'display data
For I = 0 to Link1.ReceivedDataTotal - 1
'number of items
List1.AddItem Link1.ReceivedData(I)
'display each item
Next I
Case "Update"
'update data
Customers.Edit
Customer("Name") = Link1.ReceivedData(0)
Customers.Update
End Select
End Sub

Cube Software Pvt Ltd

Page 26

Dialer Client External Application Integration Document

3.3.2 RequestReceived Event


Description
This event is triggered when another node has sent a request via the
Request method.
Syntax
Sub object_RequestReceived(FromNode As String, Subject As String,
ReturnData As Integer, ReturnCode As Integer)
Data Type
Integer
Remarks
Any data accompanying a request can be read from the ReceivedData()
property array.To return data to the requesting node, populate the
SendData() property array, set the SendDataTotal property to the
number of elements in the SendData() property array, and set the
ReturnData Parameter to True.In this event, you should not execute any
code that would result in Visual Basic yielding control of the processor.
For example, you should not execute any functions such as Visual
Basic's DoEvents()or any Visual Voice methods, unless you first save
any information (e.g., FromNode, Subject, ReceivedData,
ReceivedDataTotal) you might need after the function completes.The
following table is a listing of the RequestReceived event parameters:
Parameter
Description
FromNode
The name of the node that made the request. If the
name includes a computer name (e.g.,
\\MYCOMPUTER\MYNODE), then the node is on
another computer on the network.
Subject
The subject of the received data. The source node
specified this via its SendSubject property.
ReturnData
A flag indicating that the data in the SendData()
property array will be returned to the source node in its
ReceivedData property array. If you want to return
data, you must set this parameter to True. You must
also set the SendDataTotal property to the number of
elements to return. Set this parameter to False to not
copy the data. The default is False.
ReturnCode
Specifies whether or not the request was processed
successfully. If processing was successful, leave this
parameter alone and the default of 0 will be used,
indicating success. If processing was unsuccessful, set
this parameter to a value greater than zero and a
runtime error will be generated in the source node
when its Request method completes. The error
generated in the source node will have a value equal to
the ReturnCode parameter.
Data is returned if the ReturnData parameter is set,
regardless of whether or not the ReturnCode parameter
is zero.
Codes greater than 26000 are recommended to avoid
conflict with Visual Basic errors. The default is 0,
Cube Software Pvt Ltd

Page 27

Dialer Client External Application Integration Document

indicating success.
Example

Cube Software Pvt Ltd

Sub Link1_RequestReceived (FromNode As String, Subject As String, ReturnData As Integer,


ReturnCode As Integer)
Select Case
Subject Case "Customer"
'Run BASIC code to get customer record based on ID
'sent. ReceivedData(0) contains the customer ID
Customer.Seek "=", Link1.ReceivedData(0)
If Customer.NoMatch Then 'Send back an error
Link1.SendData(0) = "Record Not Found"
ReturnData = False
ReturnCode = SOME_ERROR_CODE
Link1.SendDataTotal = 1
Else
'Send back the customer's record
Link1.SendData(0) = Customer("LastName")
Link1.SendData(1) = Customer("FirstName")
Link1.SendData(2) = Customer("Address")
Link1.SendData(3) = Customer("City")
Link1.SendData(4) = Customer("State")
Link1.SendData(5) = Customer("Zip")
Link1.SendDataTotal = 6
ReturnData = True
End If
Case Else
'Insert code here to process other requests
End Select
End Sub

Page 28

Você também pode gostar