api documentation - voicenter · performance booster, fully personalize to any duration). •...

64
API Documentation Revision 19116

Upload: others

Post on 15-Sep-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

1 © All rights reserved to Voicenter Revision 3.2 972-73-279-1800 | www.voicenter.co.il | [email protected]

API Documentation

Revision 19116

Page 2: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

About Voicenter APIs for Developers

Voicenter is a cloud-based VoIP telephony solution that

offers APIs to integrate your telephony system with your

organization’s other information systems.

With Voicenter’s APIs you can use data and advanced

tools to improve your ROI, increase your representatives’

efficiency, and provide better service to your clients.

We are certain that our APIs will provide clear advantages

for your call center.

Page 3: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

3 © All rights reserved to Voicenter Revision 3.2 972-73-279-1800 | www.voicenter.co.il | [email protected]

1. Click 2 call ……… . ………………………………………………………………… 4-9

2. Pop-up screen …………………………………………………………………. . 01 - 21

3. Call log ………………………………………………………………………………… .13-18

4. CDR notification system…. ………………………………………………… 19-28

5. External IVR …………………………………………………………………….. .29- 73

6. Dialer API………………………………………………………………………….. 83 -44

7. Active calls ……………………………………………………………………. 45-47

8. Organization extension list ……………………………………………….. 48-49

9. Realtime ……………………………………………………………………………. 50-59

10. Login\ Logout ……………………………………………………………….. 60-61

Page 4: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

1 © All rights reserved to Voicenter Revision 3.2 972-73-279-1800 | www.voicenter.co.il | [email protected]

Page 5: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 5

1. Click 2 Call Click 2 Call enables executing direct phone calls, with just the click of a button. It’s super easy to implement and integrate, using our ready-to-use code. This great and versatile API integration can really make a difference, wherever you assimilate it:

• Initiating phone-calls from any available representative or salesperson - automatically! (Great

performance booster, fully personalize to any duration).

• Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer, the moment

they click the ‘Apply/Send’ button. Imagine their WOW, and your conversion rates.

• Integrate click 2 call to your CRM, will improve your performance and make sure you fully-

deliver your SLA (http://en.wikipedia.org/wiki/Service-level_agreement) as endorsed.

1.1. General Click to Call API description:

API URL:

https://api.voicenter.co.il/forwardDialer/click2call.aspx

Example:

https://api.voicenter.co.il/ForwardDialer/click2call.

aspx?phone=057XXXXXXX&target=03XXXXXXX&code=XXXXXXXXXXX&action=call

This API allows you to initiate any of the following 3 types of calls:

1. Simple call

2. Dial & play record

3. Conference call

Acceptable request types:

1. POST

2. GET

Possible Response formats:

To control the format of the response please provide your desired format in the request:

1. XML (default)

2. JSON

Page 6: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 6

1.2. Call parameters

Parameter Description Appearance

Phone First destination to dial. Phone number or Starkey/ Voicenter extension.

Phone should be in E164 format, but without the leading plus (+) sign. If the phone is

Israeli, format can be 0********* too. In case of dialing to an extension behind a SIP Trunk, please set Phone=SIPTRUNK. In case of extension dependency on user login please et phone=logincode phonelogincode=[login code]

Mandatory

target Second destination to dial. Phone number or Starkey/ Voicenter extension.

Phone should be in E164 format, but without the leading plus (+) sign. If the Target is Israeli, format can be 0********* too.

Mandatory

code Caller identity Mandatory

action Call (action=call) Mandatory

record Record the call

Acceptable values: true / false If not provided set to false.

Optional

phonecallerid Caller id of the phone Not supported by all providers

Optional

phonecallername Caller name of the phone Not supported by all providers

Optional

targetcallerid Caller id of the target

Not supported by all providers Optional

targetcallername Caller name of the target

Not supported by all providers Optional

phonemaxdialtime phone maximum dial time, in seconds.

If not provided set to 60 seconds. Optional

targetmaxdialtime target maximum dial time, in seconds. If not provided set to 60 seconds.

Optional

maxduration Maximum call duration in seconds.

If not provided set to 7200 seconds. Optional

phoneautoanswer Only for Starkey / Voicenter extensions Expecting for true or 1 for phone automatic

answer If not specified set to false

Optional

targetautoanswer Only for Starkey / Voicenter extensions Expecting for true or 1 for target automatic

answer If not specified set to false

Optional

checkphonedevices- tate

Block call if extension offline Optional

checktargetdevicestate Block call if extension offline Optional

language Specify language for system recordings/prompts/etc..

Acceptable format is [he/en/ru/ etc…] Optional

vm_id Voicemail code. Only n case phone is Starkey /Voicenter extension

Optional

format Control the format of the response

Possible formats : • XML • JSON The default is XML

Optional

var_* Any custom parameter with “var_” prefix.

For example: var_customer=2342 This parameter used in: • Voicenter chrome notification extension • Voicenter desktop notification program • CDR to CRM API The limit is 10 parameters.

Optional

Page 7: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 7

1.3. Message (Dial & Play voice message)

Parameter Description Appearance

Phone First destination to dial

Phone number or Starkey / Voicenter extension

Phone format can be 0****** as well as 972*****

Mandatory

code Caller identity Mandatory

action Message (action=message) Mandatory

pre_rec Name of the record without extension First record to play Optional

Dtmf Numeric sequence Will be played number by number Optional

loop_rec After –number record ( without extension ) Optional

post_rec Last record to be played (without extension) Optional

Record Record the call. Acceptable variables true / false Optional

targetcallerid Caller id of the target

Not supported by all providers Optional

targetcallername Caller name of the target Not supported by all providers

Optional

phonemaxdialtime In seconds

Phone maximum dial time If not provided set to 30

Optional

maxduration In seconds, Maximum call duration If not provided set to 30. Optional

phoneautoanswer Only for Starkey / Voicenter extensions

Expecting for true or 1 for phone automatic answer If not specified set to false

Optional

1.4. Callference call

Parameter Description Appearance

Phone First destination to dial

Phone number or Starkey / Voicenter extension

Phone format can be 0****** as well as 972*****

Mandatory

code Caller identity Mandatory

action Callference (action=callference) Mandatory

bbbcode Callference entry code Optional

targetcallerid Caller id of the target

Not supported by all providers Optional

targetcallername Caller name of the target Not supported by all providers

Optional

phonemaxdialtime In seconds

Phone maximum dial time If not provided set to 30.

Optional

maxduration In seconds

Maximum call duration If not provided set to 30.

Optional

phoneautoanswer Only for Starkey / Voicenter extensions.

Expecting for true or 1 for phone automatic answer

If not specified set to false

Optional

Page 8: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 8

1.5. Terminate

Parameter Description Appearance

Phone Voicenter extension

To hangup Mandatory

code Caller identity Mandatory

action terminate (action=terminate) Mandatory

1.6. Response

Response is XML (XML-RPC structure) or JSON

Fields: 1. ERRORCODE (Integer) List

Code Description

0 OK

1 Invalid request parameters

2 Application error

3 Extension representative offline

4 Extension blocked for Click2Call calls

2. ERRORMESSAGE (String)

A short sentence describing the

3. CALLID

String (32 chars)

Unique code of the call In case of failure is empty

XML response Example:

1 <methodResponse> 2 <params> 3 <param> 4 <value> 5 <struct> 6 <member> 7 <name>ERRORCODE</name> 8 <value><string>1</string></value> 9 </member>

10 <member> 11 <name>ERRORMESSAGE</name> 12 <value><string>Phone is missing</string></value> 13 </member> 14 <member> 15 <name>CALLID</name> 16 <value><string></string></value> 17 </member> 18 </struct> 19 </value> 20 </param> 21 </params> 22 </methodResponse>

Page 9: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 9

JSON response Example:

1 {

2 "ERRORCODE":0, 3 "ERRORMESSAGE":"OK", 4 "CALLID":"sdfsdfsdfsdfdsfsdfdsfsdfsdf0brp" 5 }

1.7. PHP Sample ( with XML response )

1 $params="code=$code&phone=$voicenter_code_phone&phonecallerid=0500000000&target=$target 2 &targetcallerid=$target&record=true"; 3 $ch = curl_init("https://api.voicenter.co.il/ForwardDialer/click2call.aspx"); 4 curl_setopt($ch, CURLOPT_POST,1); 5 curl_setopt($ch, CURLOPT_POSTFIELDS ,$params); 6 curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1); 7 $response = curl_exec($ch); 8 $callid = return_callid_from_string($response ); 9 function return_callid_from_string($str) {

10 $xml_str = simplexml_load_string($str); 11 foreach($xml_str->params->param->value->struct->member as $a){ 12 if($a->name == "CALLID") { return $a->value->string; } 13 } 14 }

Page 10: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,
Page 11: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 11

2. POP UP Screen Voicenter Business cloud communication services proud to present its extension for Chrome give you a simple and powerfull Click to call tool that works immidiatly with your voicenter account allowing you to Right-click any number in the browser and select “Click2Call to #phone number#” in the dropdown menu.

The Click to call feature can be configured to call any of your Voicenter extensions, your Mobile,

Home number – or any other destination you like – connection it to the selected number you wish

to dial. Your system will send our Cloud the 2 “Legs” you want it to connect – and the cloud will

call them both and connect them together.

In Addition, the extension lets you Pop up a screen with the caller’s contact details right out of your business information software (CRM) – with a simple integration tools for the developers.

Warning explained: When installing the extension it says “This extension will have access to all browsing history and private data on all websites”. This is the default warning for any extension that needs content script access to all websites. This access is needed for detecting phone numbers to call using a click and not typing it yourself. We are obligated to your privacy and are

not collecting any personal data or browsing history from your browser.

Page 12: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 12

• Step 1: A caller is calling your phone number. Caller ID is gathered by Voicenter Cloud.

• Step 2: Voicenter Cloud sends the caller ID to your Server, which checks if the phone number belongs to

one of your clients. For example: Http://www.yourdomain.com/phoneSearchUrl.asp?phone=0722776772

• Step 3: If a contact is found, a JSON is sent back to Voicenter Cloud with the following parameters:

Field name Description Type Remarks

STATUS String

URL String

CLIENTNAME String

TOTAL String

COMPANY String

1 {

2 “STATUS”:”OK”, 3 “URL”:”http://www.yourdomain.com/contact_search.asp?user_phone=0722776772”, 4 “CLIENTNAME”:”John Doe”, 5 “TOTAL”: “1”, 6 “COMPANY”:”Voicenter” 7 }

• Step 4: Voicenter sends to the user’s Chrome browser all the details of the call. A bubble with a

notification on the call should pop. Pressing the bubble will load a new web browser page with the provided link from Step 3.

• Step 5: Voicenter cloud rings voicenter destination extension immediately.

Page 13: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

\\

10 © All rights reserved to Voicenter Revision 3.2 972-73-279-1800 | www.voicenter.co.il | [email protected]

+

Page 14: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

\\

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 14

3. Call log (Version 0.1)

CDR API allows you to get call record details by simple WEB request. This API allows you to run a specific query for call record details made by a specific user.

In order to recieve call record details automatically on an ongoing basis, please use the CDR

notification API.

URI: https://api1.voicenter.co.il/hub/cdr/

Request:

accepts JSON and GET

:

Parameter Description

code String

Personal identifier, provided by Voicenter

format String

Format of the response

Current possible options:

• JSON

• HTML

search Array of search criteria

* Search parameters described in following table

fields Array of strings

Describes which fields will be returned in response. Current possible options:

• date

• fromdate (e.g. 2014-11-18T16:31)

• todate

• phones

• Type

• DID

• CallerNumber

• CallerExtension

• TargetNumber

• TargetExtension

• TargetPrefixName

• Duration

• Price

• RecordURL

• RecordExpect

• RepresentativeName

• RepresentativeCode

• DTMFData

• CallID

• QueueName

• DialStatus

• DialStatus2

• RingTime

• CustomData

• DepartmentName

• DepartmentId

Page 15: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

\\

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 15

Search criteria options are

Parameter Description

fromdate Date time in ISO 8601 format

todate Date time in ISO 8601 format

phones Array of strings. Each string is phone number to search include country code

extensions Array of strings. Each string is Voicenter SIP trunk

IdentityCriteria One of the following: Account, Hierarchical, Department, User

Request example in JSON format:

Request example in GET format:

https://api1.voicenter.co.il/hub/cdr/?code=xxxxxxxxxxxxxxxxxxxx&version=2&format=JSON&fromdate=2015-

05-14T08:00&todate=2015-05-

14T16:30&phones=97272276772&extensions=SipSip&fields=Date&fields=Type&Fields=DID&Fields=CallerNumber

Response:

JSON:

HTML: In case of HTMP the response is table-based HTML page

Errors:

Parameter Description

ERROR_NUMBER Integer

Represents error number

ERROR_DESCRIPTI

ON

String

Represents error description

CDR_LIST Array of objects

Each object is call detailed record, as

requested

"code": "xxxxxxxxxxxxxxx", "version": "2", "format": "JSON",

"fields": [ "Date", "Type", "DID", "CallerNumber", "CallerExtension", "TargetNumber", "Duration", "RecordURL", "RepresentativeName" ],

"search": { "fromdate": "2015-05-14T08:00", "todate": "2015-05-14T16:30", "phones": "972722776772" }

}

{ 1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21

ERROR_NUMBER ERROR_DESCRIPTION

0 OK

1 Request limit exceeded. Please try again later.

2 Authorization failed.

3 CDR limit exceeded.

4 IP address xx.xx.xx.xx is not trusted.

Page 16: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

CDR request parameters:

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 16

# Field Description Example

1 caller Displays the caller’s phone number. The number that will appear at the

destination.

"caller":"0722776772"

2 target Displays the destination of the call. Can be a phone number or the exten-

sion SIP code. The phone number value will be sent with the international

country prefix.

"target":"AAPINFzL" / "target":"

972722776772"

3 time Displays the time that that the call was made in Epoch time. "time":1536855354

4 duration Displays the duration of the call(seconds). This duration does not include the

ringing duration only the actual time of the conversation that was made.

"duration":33

5 ivruniqueid Displays the ID code of the specific call. "ivrunique-

id":"201809131615530APIAPI-

APIAac40c3d53"

6 type Displays the type of Call. For example: if it is an incoming/outgoing call?

There are several call types.

"type":"Incoming Call" /

"type":"Extension Outgoing" /

"type":" Click2Callleg1"

7 status Displays what happened with the specific call? There are several call

statuses.

"status":"ANSWER" / "sta-

tus":"ABANDONE / "sta-

tus":"TE"

8 targetextension Displays the extension SIP code that answered to the incoming call. Some-

times this value will be identical to the "target" field. There are cases that

the incoming call is received not directly to the extension, so the "target"

can display different value.

"targetextension":"AAPINFzL"

9 callerextension Displays the extension SIP code that the call was dialed from. This value

is different from the "caller" field. In the "caller" field we display the actual

number that will appear at the destination.

"callerextension":" AAPINFzL"

10 did Displays the origin phone number that the caller called to. "did":"0722776772"

11 queueid If the call was directed to a queue service, it displays the queue code ID. In

case there is no queue, the value will be 0(and not null).

"queueid":12345

12 queuename If the call was directed to a queue service, it displays the queue name. "queuename":"Service Queue"

13 record Displays a URL link to the call recording. "record":"http://starkey-cen-

trex-recordings. s3. amazonaws”

14 price Displays the total price of the call in ILS cents (Agorot). "price":7

15 dialtime Displays the ringing duration of the call(seconds). Not include the actual

conversation duration.

"dialtime":23

16 representative_

name

Displays the Voicenter user name that the specific call was associated with. "representative_name":"Walter

Melon"

17 representa-

tive_code

Displays the Voicenter user ID code that the specific call was associated

with.

"representative_code":" 9996 "

18 targetexten-

sion_name

Displays the Voicenter extension name that answered to the specific call. "targetextension_name":"Walter

Melon"

19 callerexten-

sion_name

Displays the Voicenter extension name that this specific call was made from. "callerextension_name":" Walter

Melon"

20 target_country Displays the country name that this outgoing call was made to. "target_country":"Israel"

21 caller_country Displays the country name that this incoming call was made from. "caller_country":"Israel"

22 seconds_wait-

ing_in_queue

This field will only be sent in the json CDR, if the specific called was directed

to a queue. It displays the duration(seconds) that the caller waited in the

queue.

"seconds_waiting_in_queue":5

23 Origi-

nalIvrUniqueID

This field will only be sent in the json CDR, if the specific called was related

to another call. It displays the origin call code ID. Sometimes calls are trans-

ferred in the organization.

"OriginalIvrUniqueID":"

201809131730110122APIAPIAPI-

API "

Page 17: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

Call types:

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 17

# CDR type name Description

1 Incoming Call A regular incoming call that was dialed to a phone number and ended up in the IVR or an extension (did not

end in a queue, which will make it type 4).

2 CC A call that was made through a calling card (Access number) service.

3 Extension Out-

going

A regular outgoing call (manually dialed from the phone).

4 Queue An incoming call that was received by a queue.

5 Click2Call leg1 A call that was made by click2call (Not by Dialer). Leg 1 of the call. Leg 1 - the initial connection of the call

to the extension. This is the “Phone” parameter in the Click2call API.

6 Click2Call leg2 A call that was made by click2call (Not by Dialer). Leg 2 of the call. Leg 2 - the actual call that is being

made to the destination. This is the “Target” parameter in the Click2call API.

7 VoiceMail A call that was answered by Voicenter voicemail.

8 Callference A call that was made through Voicenter callference service.

9 XferCDR A call that manually transferred from an extension to a DID/another extension.

10 ProductiveCall

Leg1

A "leg 1" Agents Auto Dialer calls. Leg1 - the initial connection of the call to the extension.

11 ProductiveCall

Leg2

A "leg 2" Agents Auto Dialer calls. Leg 2 -the actual call that is being made to the destination.

12 Scrubber A call that was made through Voicenter's Scrubber service.

13 Click 2 IVR "Leg1" Predictive Dialer calls. Leg1 - the initial connection of the call to the destination.

14 Click 2 IVR In-

coming

This is the "Leg 2" Predictive Dialer call. After the initial Leg1(Click 2 IVR) call was answered, this new

leg is dialing the IVR (a layer in Voicenter telephony menu) and Leg 1 is connected to the

representatives. This call type is for all Click 2 IVR that did not enter a queue. If the call enters a

queue service the type will be type 15. 15 Click 2 Queue

Incoming

This is the "Leg 2" Predictive Dialer call. After the initial Leg1(Click 2 IVR) call was answered, this new

leg is dialing the IVR (a layer in Voicenter telephony menu) and Leg 1 is connected to the

representatives. If the call enters a queue, then the call status will be - Click 2 Queue. Else, the call

type will be type 14.

16 FaxCdr A call that was made through Voicenter's internal outgoing fax service. *Not released yet.

17 Attended CDR

leg1

A call that was transferred with consultation.

18 Attended CDR

leg2

A call that was transferred with consultation. This type will only be made in a case of an incoming call that

was answered by representative "A", "A" will then put the call on hold and make another call(consult) to

another person - "B". Afterward, "A" will transfer the initial call to "B". The "Leg 2" is the part of the call

between "B" and the initial caller.

19 Auto forward A call that was automatically transferred from an extension to a DID (usually representatives configure

their phones manually to transfer calls when they are not available).

Page 18: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 18

# CDR Status

Name

Description

1 NOTDIALED Hang-up occurred before the call was made.

2 ANSWER A call is answered. A successful dial. The caller reached the callee. Whenever we receive an answer re-

sponse signal, also when the call reached local voicemail service and etc.

3 BUSY Busy signal. The dial command reached its number but the number is busy.

4 NOANSWER No answer. The dial command reached its number, the number rang for too long, then the dial timed out

5 CANCEL A call is canceled. The dial command reached its number but the caller hung up before the callee picked

up.

6 ABANDONE When using Voicenter's queue service, this status will appear in several cases. A caller hung up before the

callee picked up. A caller while waiting in the queue, chose to exit from the queue. A call timeout in the

queue.

7 VOEND Hang-up during IVR without actual dialing. In this case, the caller waited in the IVR but hung up before the

call rang in any extension.

8 TE When an incoming call is directed to an IVR recording and afterward it configured to hung up the call.

9 NOTCALLED A Leg2 Click2Call was not called. When using a click2call service and the Leg1 initial stage was not

successful.

10 NOTDIALED A direct incoming call to an extension that did not reach and dialed at the extension.

11 VOICEMAIL Call entered to Voicenter voicemail service.

Error types This error responses displays cases when there was a problem connecting to the target destinations. It

mainly used for Voicenter internal Tracking.

12 CONGESTION Congestion. This status is usually a sign that the dialed number is not recognized

13 CHANUNAVAIL Channel unavailable. On SIP, peer may not be registered

14 INVALIDARGS Error parsing dial command arguments

15 SSWPREAUTH Extension outgoing call was canceled before the actual dial

Page 19: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

16 © All rights reserved to Voicenter Revision 3.2 972-73-279-1800 | www.voicenter.co.il | [email protected]

Page 20: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 20

4. CDR Notification System The CDR Notification System is a unique tool from Voicenter that lets you store

all of your business telephony information, such as call detail records (CDR), and

use/ access it at any time directly from your databases. Our Cloud will send you

an HTTP XML-RPC requests that contain detailed information about every call.

CDR XML RPC specification

This methodology is per the XML-RPC standard, as appearing in the XML-RPC website at http://www.xml-

rpc.org. Following are some examples representing an XML-RPC post and an XML-RPC response.

CDR request parameters:

# Field Description Example

1 caller Displays the caller’s phone number. The number that will appear at the

destination.

"caller":"0722776772"

2 target Displays the destination of the call. Can be a phone number or the

exten- sion SIP code. The phone number value will be sent with the

international

country prefix.

"target":"AAPINFzL" / "target":"

972722776772"

3 time Displays the time that that the call was made in Epoch time. "time":1536855354

4 duration Displays the duration of the call(seconds). This duration does not

include the

ringing duration only the actual time of the conversation that was

made.

"duration":33

5 ivruniqueid Displays the ID code of the specific call. "ivrunique-

id":"201809131615530APIAPI-

APIAac40c3d53"

6 type Displays the type of Call. For example: if it is an incoming/outgoing

call? There are several call types.

"type":"Incoming Call" /

"type":"Extension Outgoing" /

"type":" Click2Callleg1"

7 status Displays what happened with the specific call? There are several call

statuses.

"status":"ANSWER" / "sta-

tus":"ABANDONE / "sta-

tus":"TE"

8 targetextension Displays the extension SIP code that answered to the incoming call.

Some- times this value will be identical to the "target" field. There are

cases that the incoming call is received not directly to the extension, so

the "target"

can display different value.

"targetextension":"AAPINFzL"

9 callerextension Displays the extension SIP code that the call was dialed from. This value

is different from the "caller" field. In the "caller" field we display the

actual

number that will appear at the destination.

"callerextension":" AAPINFzL"

10 did Displays the origin phone number that the caller called to. "did":"0722776772"

11 queueid If the call was directed to a queue service, it displays the queue code

ID. In

case there is no queue, the value will be 0(and not null).

"queueid":12345

12 queuename If the call was directed to a queue service, it displays the queue name. "queuename":"Service Queue"

13 record Displays a URL link to the call recording. "record":"http://starkey-cen-trex-

recordings.s3.amazonaws"

14 price Displays the total price of the call in ILS cents (Agorot). "price":7

15 dialtime Displays the ringing duration of the call(seconds). Not include the

actual

conversation duration.

"dialtime":23

16 representative_

name

Displays the Voicenter user name that the specific call was associated

with.

"representative_name":"Walter

Melon"

17 representa-

tive_code

Displays the Voicenter user ID code that the specific call was

associated

with.

"representative_code":" 9996 "

Page 21: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 21

18 targetexten-

sion_name

Displays the Voicenter extension name that answered to the specific

call.

"targetextension_name":"Walter

Melon"

19 callerexten-

sion_name

Displays the Voicenter extension name that this specific call was made

from.

"callerextension_name":" Walter

Melon"

20 target_country Displays the country name that this outgoing call was made to. "target_country":"Israel"

21 caller_country Displays the country name that this incoming call was made from. "caller_country":"Israel"

22 seconds_wait-

ing_in_queue

This field will only be sent in the json CDR, if the specific called was

directed to a queue. It displays the duration(seconds) that the caller

waited in the

queue.

"seconds_waiting_in_queue":5

23 Origi-

nalIvrUniqueID

This field will only be sent in the json CDR, if the specific called was

related to another call. It displays the origin call code ID. Sometimes

calls are trans-

ferred in the organization.

"OriginalIvrUniqueID":"

201809131730110122APIAPIAPI-

API "

# CDR type name Description

1 Incoming Call A regular incoming call that was dialed to a phone number and ended up in the IVR or an extension (did not

end in a queue, which will make it type 4).

2 CC A call that was made through a calling card (Access number) service.

3 Extension Out-

going

A regular outgoing call (manually dialed from the phone).

4 Queue An incoming call that was received by a queue.

5 Click2Call leg1 A call that was made by click2call (Not by Dialer). Leg 1 of the call. Leg 1 - the initial connection of the call

to the extension. This is the “Phone” parameter in the Click2call API.

6 Click2Call leg2 A call that was made by click2call (Not by Dialer). Leg 2 of the call. Leg 2 - the actual call that is being

made to the destination. This is the “Target” parameter in the Click2call API.

7 VoiceMail A call that was answered by Voicenter voicemail.

8 Callference A call that was made through Voicenter callference service.

9 XferCDR A call that manually transferred from an extension to a DID/another extension.

10 ProductiveCall

Leg1

A "leg 1" Agents Auto Dialer calls. Leg1 - the initial connection of the call to the extension.

11 ProductiveCall

Leg2

A "leg 2" Agents Auto Dialer calls. Leg 2 -the actual call that is being made to the destination.

12 Scrubber A call that was made through Voicenter's Scrubber service.

13 Click 2 IVR "Leg1" Predictive Dialer calls. Leg1 - the initial connection of the call to the destination.

14 Click 2 IVR In-

coming

This is the "Leg 2" Predictive Dialer call. After the initial Leg1(Click 2 IVR) call was answered, this new

leg is dialing the IVR (a layer in Voicenter telephony menu) and Leg 1 is connected to the

representatives. This call type is for all Click 2 IVR that did not enter a queue. If the call enters a queue

service the type will be type 15. 15 Click 2 Queue

Incoming

This is the "Leg 2" Predictive Dialer call. After the initial Leg1(Click 2 IVR) call was answered, this new

leg is dialing the IVR (a layer in Voicenter telephony menu) and Leg 1 is connected to the

representatives. If the call enters a queue, then the call status will be - Click 2 Queue. Else, the call

type will be type 14.

16 FaxCdr A call that was made through Voicenter's internal outgoing fax service. *Not released yet.

17 Attended CDR

leg1

A call that was transferred with consultation.

18 Attended CDR

leg2

A call that was transferred with consultation. This type will only be made in a case of an incoming call that

was answered by representative "A", "A" will then put the call on hold and make another call(consult) to

another person - "B". Afterward, "A" will transfer the initial call to "B". The "Leg 2" is the part of the call

between "B" and the initial caller.

19 Auto forward A call that was automatically transferred from an extension to a DID (usually representatives configure

their phones manually to transfer calls when they are not available).

Page 22: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 22

# CDR Status

Name

Description

1 NOTDIALED Hang-up occurred before the call was made.

2 ANSWER A call is answered. A successful dial. The caller reached the callee. Whenever we receive an answer re-

sponse signal, also when the call reached local voicemail service and etc.

3 BUSY Busy signal. The dial command reached its number but the number is busy.

4 NOANSWER No answer. The dial command reached its number, the number rang for too long, then the dial timed out

5 CANCEL A call is canceled. The dial command reached its number but the caller hung up before the callee picked

up.

6 ABANDONE When using Voicenter's queue service, this status will appear in several cases. A caller hung up before the

callee picked up. A caller while waiting in the queue, chose to exit from the queue. A call timeout in the

queue.

7 VOEND Hang-up during IVR without actual dialing. In this case, the caller waited in the IVR but hung up before the

call rang in any extension.

8 TE When an incoming call is directed to an IVR recording and afterward it configured to hung up the call.

9 NOTCALLED A Leg2 Click2Call was not called. When using a click2call service and the Leg1 initial stage was not

successful.

10 NOTDIALED A direct incoming call to an extension that did not reach and dialed at the extension.

11 VOICEMAIL Call entered to Voicenter voicemail service.

Error types This error responses displays cases when there was a problem connecting to the target destinations. It

mainly used for Voicenter internal Tracking.

12 CONGESTION Congestion. This status is usually a sign that the dialed number is not recognized

13 CHANUNAVAIL Channel unavailable. On SIP, peer may not be registered

14 INVALIDARGS Error parsing dial command arguments

15 SSWPREAUTH SSW outgoing call cancel before actual dial

Page 23: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 23

# Name Type Example Description

1 err int 0 Error code.

0 – OK

1 – Parse error

2 – Application error

2 errdesc string OK Error description

EXAMPLES Xml-rpc:

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34

<?xml version="1.0"?> <methodCall>

<methodName>CDR</methodName> <params>

<param> <value>

<struct> <member>

<name>caller</name> <value>

</value>

</member> <member>

<name>target</name> <value>

</value>

</member> <member>

<name>time</name> <value>

<i8>1345373417</i8> </value>

</member> <member>

<name>duration</name> <value>

<i4>12</i4> </value>

</member>

Page 24: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 24

35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78

79 string>

80 81 82 83 84 85 86 87 88 89 90 91 92

<member> <name>ivruniqueid</name> <value>

<string>sdfsdfsdfsfsf</string> </value>

</member> <member>

<name>targetextension</name> <value>

<string /> </value>

</member> <member>

<name>callerextension</name> <value>

<string>IuYtReWq</string> </value>

</member> <member>

<name>did</name> <value>

<string /> </value>

</member> <member>

<name>queueid</name> <value>

<i4>0</i4> </value>

</member> <member>

<name>queuename</name> <value>

<string /> </value>

</member> <member>

<name>type</name> <value>

<string>Extension Outgoing</

</value> </member> <member>

<name>status</name> <value>

<string>ANSWER</string> </value>

</member> </struct>

</value> </param>

</params>

93 </methodCall> 94

Page 25: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 25

Valid response:

Error example:

<?xml version="1.0"?> <methodResponse>

<params> <param>

<value> <struct>

<member> <name>err</name> <value>

<int>0</int> </value>

</member> <member>

<name>errdesc</name> <value>

</value>

</member> </struct>

</value> </param>

</params> </methodResponse>

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

<?xml version="1.0" ?> <methodresponse>

<params> <param>

<value> <struct>

<member> <name>err</name> <value>

<int>2</int> </value>

</member> <member>

<name>errdesc</name> <value>

<string>Some error description</

</value> </member>

</struct> </value>

</param> </params>

</methodresponse>

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

Page 26: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 26

JSON example:

Expected response:

1 { 2 "err": "0", 3 "errdesc": "OK" 4 }

C# web service code sample

CDR Listener implementation in C# asp.net.

We even made an example of a Simple ashx handler attached below

Simple ashx handler

Dependencies:

• CookComputing.XmlRpcV2.dll (How-to ...) (c#) (vb.net) )

• Microsoft.NET Framework 4.0

Code:

1 <%@ WebHandler Language="C#" Class="CDR_Listener" %> 2

3 using System; 4 using System.Web; 5 using CookComputing.XmlRpc; 6

7 //[XmlRpcService(AutoDocumentation=false)] 8 public class CDR_Listener : XmlRpcService 9 {

10 // Change it to true to get more data in output XML. 11 // Change it to false in productive system.

12 private bool isDebug = true;

13

14 private void HandleRequest(CdrData cdr)

15 {

16 /* ADD YOUR CODE HERE */

17

18 }

"caller": "0544444444", "target": "0722776772", "time": 1414320455,

"duration": 12, "ivruniqueid": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",

"type": "Extension Outgoing",

"status": "ANSWER",

"targetextension": "",

"callerextension": "SIPSIPSI",

"did": "",

"queueid": 0,

"queuename": "",

aws-0544444444-0722776772.mp3",

"dialtime": 31 }

{ 1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19

Page 27: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 27

19

20 [XmlRpcMethod()] 21 public XmlRpcStruct CDR(XmlRpcStruct data) 22 { 23 XmlRpcStruct ret = new XmlRpcStruct(); 24 if(this.isDebug) 25 ret.Add("origrequest", data); 26 try 27 { 28 CdrData cdr = new CdrData() 29 { 30 Callerid = GetValue<string>("caller", string.Empty, data), 31 Target = GetValue<string>("target", string.Empty, data), 32 Duration = GetValue<int>("duration", 0, data), 33 IvrUniqueID = GetValue<string>("ivruniqueid", string.Empty, 34 data),

35 Epoch = GetValue<long>("time", 0, data), 36 extensionCaller = GetValue<string>("callerextension", string. 37 Empty, data), 38 extensionTarget = GetValue<string>("targetextension", string. 39 Empty, data), 40 status = GetValue<string>("status", string.Empty, data), 41 did = GetValue<string>("did", string.Empty, data), 42 type = GetValue<string>("type", string.Empty, data), 43 queueID = GetValue<int>("queueid", 0, data), 44 queueName = GetValue<string>("queuename", string.Empty, data) 45 }; 46 if (this.isDebug) 47 ret.Add("got", cdr); 48

49 try 50 { 51 HandleRequest(cdr); 52 } 53 catch (Exception ex) 54 { 55 if (this.isDebug) 56 57 58 59 60

throw new CustomerException(ex, "Customer code exception");

else throw new CustomerException(new Exception("Oops...

something wrong"), "Customer code exception"); 61 } 62 }

63 catch (CustomerException ex) 64 {

65 ret.Add("err", "2"); 66 ret.Add("errdesc", ex.OriginalException.ToString() + " >>> " + 67 ex.Description);

68 return ret; 69 }

70 catch (Exception ex) 71 {

72 ret.Add("err", "1"); 73 ret.Add("errdesc", ex.ToString()); 74 return ret; 75 }

76

77 78 79 80

ret.Add("err", "0"); ret.Add("errdesc", "OK");

return ret;

Page 28: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 28

81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99

100 } 101 102 103 104 105

}

private T GetValue<T>(string key, T defaultValue, XmlRpcStruct data) {

key = key.Trim(); if (!data.ContainsKey(key))

return defaultValue; T value; try {

value = (T)Convert.ChangeType(data[key], typeof(T)); } catch {

value = defaultValue; } return value;

}

106 public class CdrData 107 { 108 public string Target = string.Empty; 109 public string Callerid = string.Empty; 110 public string IvrUniqueID = string.Empty; 111 public long Epoch = 0; 112 public int Duration = 0; 113 public DateTime Time { get { return new DateTime(1970, 1, 1, 0, 0, 0, 114 DateTimeKind.Unspecified).AddSeconds(this.Epoch); } } 115 public string extensionTarget; 116 public string extensionCaller; 117 public string did; 118 public string callType; 119 public string callStatus; 120 public int queueID; 121 public string queueName; 122 123 } 124 125 126 public class CustomerException : Exception 127 { 128 public Exception OriginalException { get; private set; } 129 public string Description { get; private set; } 130 131 public CustomerException(Exception OriginalException, string Description) 132 { 133 this.OriginalException = OriginalException; 134 this.Description = Description.Trim(); 135 } 136 }

To receive additional value: (REQUIRES IMPLEMENTATION!!!)

1. Add field to CdrData class.

2. "CdrData cdr = new CdrData() { … // Add parsing row HERE }".

3. Check that the XML includes the new value to be able to get it.

Page 29: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 29

26 © All rights reserved to Voicenter Revision 3.2 972-73-279-1800 | www.voicenter.co.il | [email protected]

26 © All rights reserved to Voicenter Revision 3.2 972-73-279-1800 | www.voicenter.co.il | [email protected]

Page 30: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 30

5. External IVR With External IVR API, you can extend functionality of Voicenter IVR and connect it to your

organizational database or CRM systems in order to perform advanced routing of incoming calls,

based on information sting in the external information system.

For example, you can identify incoming call by phone number and determine if this is an existing

client or a new potential client, and perform different routing scenarios accordingly, such as:

1.) Caller number is registered as an existing lead: Your CRM can check if one of your sales

representatives already spoke to this client and reply back with the layer of this representative in

order to redirect the call directly to him, and not to the general sales queue – in order to finalize

sales process in a smoother more customer experience oriented IVR.

2.) Caller number is registered as an existing account: Your CRM can check if there is an ongoing

open ticket/case and transfer the call to the right customer services representative/desk - in order

to resolve the issue and provide personal service faster.

3.) Caller number does not exist in your CRM: Your CRM can transfer these calls to sales

representatives or as an alternative you can ask from the client to provide some identification

information in order to transfer the call to the right desk.

In addition, callers can be asked to dial their personal ID, account number or anything else, and

this data can be process by your organizational database or CRM systems in order to perform

varied actions. These digits pressed during the navigation in the IVR are called DTMFs.

Page 31: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 31

External IVR API utilizes existing layers of Voicenter IVR in order to route calls.

Further explanation about creating and managing IVR layer can be found at the end of this

chapter. In order to utilize advanced features of the External Layer IVR, the system needs an end

point URL to address when calling the Layer. This URL can be managed in the Layer settings tab.

Once the call is received, Voicenter IVR will initiate a POST request to this endpoint. This request

will contain the following information:

VOICENTER IVR REQUEST:

Field name Description Type

METHOD Will always be "IVR_LAYER_INPUT". String

DATA Data object of an IVR request. String

DID DID number that the call was received on(Incoming number). String

CALLER_ID Called ID of the current caller. String

IVR_UNIQUE_ID Voicenter unique ID of a call. Can be used for state purposes. String

DTMF

If the caller was requested to enter identification information, this input will be passed in this parameter. *In case the caller did not enter any value(did not make any dial action), the default value will always be “0”.

String

LAYER_ID The current layer ID in the IVR that the request is sent from. Integer

PREVIOUS_LAYER_ID If the call was passed to the layer from another layer, the previous layer will be shown here. Integer

JSON Request:

Caller ID in this request can be used in order to check if there is an existing record in the CRM.

Also, the caller dial input(DTMF) can be used as well.

}

"METHOD": "IVR_LAYER_INPUT", "DATA": { "DID": "0722776772", "CALLER_ID": "0501234567", "IVR_UNIQUE_ID": "1bcd7954224861f85a2d70612f2", "DTMF": "1234", "LAYER_ID": "5", "PREVIOUS_LAYER_ID": "5" }

{ 1 2 3 4 5 6 7 8 9

10 11 12

Page 32: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 32

CLIENT RESPONSE:

Once it has been determined, response needs to be formulated and sent back as part of the

HTTP protocol process.

Response must contain the following parameters:

Field name Description Remarks

STATUS 0 – OK. 1 - Error has occurred on client's side.

Mandatory

ACTION DIAL - Will dial an external number or a Voicenter extension. GO_TO_LAYER - Will pass the call to a layer within a Voicenter IVR and continue as set in layer.

Mandatory

LAYER Layer number that the call will be redirected to. Mandatory

CALLER_NAME Caller name that will be shown on the destination phone. (Supported only for Voicenter extensions).

Optional

CUSTOM_DATA Internal CRM information about the client that can be passed via External CDR notification API. If custom data is not present, please respond with an empty array(null).

Mandatory

JSON Response (Without custom data):

JSON Response (With custom data):

}

"STATUS": 0, "ACTION": "GO_TO_LAYER", "LAYER": 22, "CALLER_NAME": "Shlomi", "CUSTOM_DATA": {

"CRM_cleit_ID": "12345", "Last_ticket_ID ": "222", "Last_represetative": "Moshe " }

{ 1 2 3 4 5 6 7 8 9

10 11

}

"STATUS": 0, "ACTION": "GO_TO_LAYER", "LAYER": 12, "CALLER_NAME": null, "CUSTOM_DATA": null

{ 1 2 3 4 5 6 7

Page 33: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 33

Case example: Identify a caller by dialing their personal ID in a given Layer in the IVR (in this request example its "5"), Play the Layer recording (configured in the cpanel incoming interface), asking the caller to dial his ID (in the following request example “12345678). After the caller has finished dialing, we will send a JSON request as followed:

JSON Request:

The data on the "DTMF" field is the data that the caller dialed. Next, we should get a Response indicating how the caller should be routed on the IVR. JSON Response

In this response, the caller was transferred to layer "12" in the IVR. When we build the integration we create in advance, all the IVR scenarios(layers) according to the account preferences and business needs. For example, layer "12" can be a layer indicating a successful caller identification and the caller will be directed to your representatives. If the identification of the caller was not successful, the caller can be redirected to layer "13" where we can ask to dial the ID again, or any other option desired.

}

"METHOD": "IVR_LAYER_INPUT", "DATA": { "DID": "0722776772", "CALLER_ID": "0501234567", "IVR_UNIQUE_ID": "1bcd7954224861f85a2d70612f2", "DTMF": "12345678", "LAYER_ID": "5", "PREVIOUS_LAYER_ID": "5" }

{ 1 2 3 4 5 6 7 8 9

10 11 12

}

"STATUS": 0, "ACTION": "GO_TO_LAYER", "LAYER": 12, "CALLER_NAME": null, "CUSTOM_DATA": null

{ 1 2 3 4 5 6 7

Page 34: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 34

SAY The SAY functionality of Voicenter external IVR service can be used to announce callers with dynamic data from your external system. For example, you can inform your clients regarding the status of their order or let them know the amount of credits that currently left in their account, automatically through the IVR. The initial request that is sent from Voicenter to your system is the same of course, as described. In order to use the "Say" functionality we need to receive a response in the following format:

CLIENT RESPONSE:

Field name Description Remarks

STATUS 0 – OK. 1 - Error has occurred on client's side.

Mandatory

ACTION “SAY_DIGITS”. The method name is “SAY_DIGITS” but you can also send us: Number, Digits and Recording.

Mandatory

NEXT_LAYER Layer number that the call will be redirected to after completing the announcement. Mandatory

LANGUAGE

The language in which the client should hear the response: HE – Hebrew, EN – English, RU – Russian. More languages can be supported upon request.

Mandatory

DATA

What is the data that needs to be played to the caller. Types of data: Digits(integer) – The IVR will play the data digit by digit. For example: a phone number. Number(integer) – The IVR will play a number. For example: amount of credits left in the caller account. Recording – The IVR will play an existing recording by name of the recording. For example: “Record1.wav”.

Mandatory

Page 35: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 35

JSON Response (Say):

The IVR will play the caller the data content in the order it was sent: 1. The caller will hear a recording name "yournumberis.wav". 2. Then the IVR will play the digits 0,5,0,1,2,3,4,5,6,7. 3. After that the number "112". 4. The caller will hear a recording name "Thank you.wav". The digits and number content will play in the language that was requested in the "LANGUAGE" field. After playing the data that was sent, the caller will be directed to the layer that was specified in NEXT_LAYER. In this case, the call will be directed to layer 2.

Each layer in Voicenter IVR can direct the call to one of the following methods:

Call – dial 1 or more extensions or external destinations. Once the first destination answers

– it stops ringing the other destinations.

Layer – transfer the caller to another IVR Layer.

Queue – Transfer the caller to a Queue in the system.

IVR structure and Layers settings are configurable from Voicenter Cpanel, in the “Incoming

interface”.

}

"STATUS": 0, "ACTION": "SAY_DIGITS", "NEXT_LAYER": 2, "NEXT_LAYER_IF_FAILED": 1, "LANGUAGE": "EN", "DATA": [ { "RecordType": "Recording", "Content": "yournumberis.wav" }, { "RecordType": "Digits", "Content": "0501234567" }, { "RecordType": "Number", "Content": "112" }, { "RecordType": "Recording", "Content": "Thank you.wav" } ]

{ 1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Page 36: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 36

External IVR – setting up layers Creating Layers to be used in the External IVR API is done in Voicenter Cpanel. Once the IVR flow was determined and you finished creating the endpoint, please log in to Voicenter Cpanel, Go the Settings -> DIDs -> click the IVR column of the desired DID to open the Incoming interface. In this page – press the Layers menu (the puzzle icon), and click the layer to configure: Under the "Layer settings" tab check "Allow mini external IVR" checkbox and configure the following options: MiniExternalUrl - Your system endpoint URL for this layer. This is where we are sending you the request:

MiniExternalDTMFLen - If your IVR requires an input from the caller (DTMF), determine what’s the maximum digits allowed. Once this limit has been reached the Request will be sent. Delay When requesting a caller to dial digits – it usually takes a few seconds. Use this field to determine how many seconds after the announcement the system will wait before timing out (valid delay values are 1-9).

The IVR will finish waiting for one of the following: 1. the caller response until it reaches the max digits input ("MiniExternalDTMFLen" field). 2. The delay timeout (seconds configured in "Delay" field) has passed.

Page 37: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 37

MiniExternalDefaultMethodData Select a failover layer in case the endpoint configured in MiniExternalUrl fails or times out. If there is a problem to reach your endpoint, in order to prevent calls to simply hung-up because of malfunction, we usually configure a default layer so calls will be directed to it.

Page 38: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 38

Page 39: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 39

6. Dialer API

Accepts GET, POST and JSON

URI: https://api.voicenter.co.il/ForwardDialer/Dialer/AddCall

Parameter list:

Name Type Appear-

ance

Description

Campaign string mandatory Campaign unique code.

Target phone mandatory Campaign target, usually phone number of the customer / client / etc.

Callerid phone optional Caller identification for the target (phone number that customer will see on his phone

display).

If not appears or comes empty, the dialer system will try to apply caller id in below

priority:

1. Try to find dynamic caller id for target country.

2. Get caller id from worker’s extension.

3. Get caller id from campaign settings.

In case you want to hide caller id use "Anonymous"

OriginateTime epoch optional Time to originate the call in Unix time epoch. Not available on all campaign types.

CustomerName string optional Name of the customer

Priority inte-

ger

optional Priority of the call in current campaign. Calls with highter priority will be originated

before others.

var_CustomData string optional Any custom data.

Will be used in popup notification or CDR to CRM systems. When using GET/POST, send

all custom variables with "var_" prefix. In case of JSON usage send all custom variables

with "var_" prefix as part of "CustomData" object.

REQUEST EXAMPLES JSON

GET

RESPONSE

1 {

2 "ErrorCode": 0, 3 "Description": "OK" 4 }

1 https://api.voicenter.co.il/ForwardDialer/Dialer/AddCall?Campaign=xxxx&Target=yyyyy&- 2 var_test1=1&var_test2=somevalue

}

"Campaign": "xxxxxxxxx", "Target": "0502454545", "CustomerName" : "John Doe" "Priority" : 42, "CustomData": {

"var_test1": 1, "var_test2": "some value"

}

{ 1 2 3 4 5 6 7 8 9

10

ErrorCode Description

0 OK

1 Invalid campaign code

2 The target is invalid

3 Unexpected internal error

4 Invalid caller id

Page 40: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

6.2. Remove Call from campaign

Accepts GET, POST and JSON

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 40

URI: https://api.voicenter.co.il/ForwardDialer/Dialer/RemoveCall

EXAMPLES Request

1 {

2 "Campaign": "xxxxxxxxx", 3 "Target": "0502454545", 4 }

Response

1 {

2 "ErrorCode": 0, 3 "Description": "OK" 4 }

Accepts GET, POST and JSON

URI: https://api.voicenter.co.il/ForwardDialer/Dialer/GetCampaignList

EXAMPLES Request

Response

1 {

2 "Data": [ 3 {

4 "Name": "Campaign 1", 5 "StatusName": "Enabled", 6 "Code": "skdfvnjsivbniviv" 7 },

8 {

9 "Name": "Campaign leads", 10 "StatusName": "Disabled", 11 "Code": "afmksvosnvo" 12 }

13 ], 14 "ErrorCode": 0, 15 "Description": "OK" 16 }

Possible campaign statuses:

1. Enabled

2. Disabled

3. Deleted

} "Code": "adsdasdasd"

{ 1 2 3

Page 41: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

6.4. Get Members list

Accepts GET, POST and JSON

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 41

URI: https://api.voicenter.co.il/ForwardDialer/Dialer/GetMembersList

EXAMPLES Request

{

"Campaign": "adsdasdasd" }

Response

1 {

2 "Data": [

3 {

4 "Member": "syhrhrhr",

5 "DisplayName": "Support 1", 6 },

7 {

8 "Member": "sssssssss",

9 "DisplayName": "Support 8", 10 }

11 ],

12 "ErrorCode": 0,

13 "Description": "OK"

14 }

Accepts GET, POST and JSON

URI: https://api.voicenter.co.il/ForwardDialer/Dialer/RemoveMember

EXAMPLES Request

1 {

2 "Campaign": "adsdasdasd" 3 "Member": "adsdasdasd" 4

5 }

Response

1 {

2 "Data": { 3 "TotalRemoved": 1, 4 }, 5 "ErrorCode": 0, 6 "Description": "OK" 7 }

Page 42: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

6.6. Add member

Accepts GET, POST and JSON

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 42

URL: https://api.voicenter.co.il/ForwardDialer/Dialer/AddMember

EXAMPLES Request

1 {

2 "Campaign": "adsdasdasd" 3 "Member": "adsdasdasd" 4 }

Response

1 {

2 "Data": { 3 " TotalAdded": 1, 4 }, 5 "ErrorCode": 0, 6 "Description": "OK" 7 }

Accepts GET, POST and JSON

URI: https://api.voicenter.co.il/ForwardDialer/Dialer/StopCampaign

EXAMPLES Request

Response

1 {

2 "ErrorCode": 0, 3 "Description": "OK" 4 }

} "Campaign": "xxxxxxxxx"

{ 1 2 3

Page 43: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

6.8. Start Campaign

Accepts GET, POST and JSON

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 43

URI: https://api.voicenter.co.il/ForwardDialer/Dialer/StartCampaign

EXAMPLES Request

Response

1 {

2 "ErrorCode": 0, 3 "Description": "OK" 4 }

Accepts GET, POST and JSON

URI: https://api.voicenter.co.il/ForwardDialer/Dialer/UpdateCampaignStrategy

EXAMPLES Request

1 {

2 "Campaign" : "xxxxxxxxxxxxxxxxxxxx", 3 "setQueueForMonitoring" : 10000, 4 "setQueueMaximumCallers" : 0, 5 "setCoefficient" : 1 6 }

Response

1 {

2 "ErrorCode": 0, 3 "Description": "OK" 4 }

} "Campaign": "xxxxxxxxx"

{ 1 2 3

Page 44: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 44

Accepts GET, POST and JSON

URI: https://api.voicenter.co.il/ForwardDialer/Dialer/ClearCampaignCalls

EXAMPLES Request

Response

1 {

2 ErrorCode: 0, 3 Description: "OK" 4 }

Accepts JSON only !!!

URI: https://api.voicenter.co.il/ForwardDialer/Dialer/AddCallsBulk

EXAMPLES Request

1 ] 2 { 3 "Campaign": "xxxxxxxxxxxxxxxxxxxx", 4 "Target": "0502454545", 5 "CallerID": "072776772", 6 "CallerName": "Dialer", 7 "CustomerName": "Customer 1", 8 "Priority": 1, 9 "CustomData": {

10 "var_test1": 1, 11 "var_tesy2": "some value" 12 } 13 },

14 {

15 "Campaign": "xxxxxxxxxxxxxxxxxxxx", 16 "Target": "0502454545", 17 "CallerID": "072776772", 18 "CallerName": "Dialer", 19 "CustomerName": "Customer 2", 20 "Priority": 2, 21 "CustomData": { 22 "var_test1": 1, 23 "var_tesy2": "some value" 24 } 25 }

26 ]

Response

1 {

2 "ErrorCode": 0, 3 "Description": "OK" 4 }

} "Campaign" : "xxxxxxxxxxxxxxxxxxxx"

{ 1 2 3

Page 45: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 42

Accepts JSON only !!!

URI: https://api.voicenter.co.il/ForwardDialer/Dialer/GetCampaignPendingCalls

EXAMPLES Request

Response

1 {

2 "Data": { 3 "Calls": [ 4 { 5 "Phone": "972544444444", 6 "CallerID": "", 7 "CallerName": "", 8 "OriginateTime": 0, 9 "Priority": 0,

10 "CustomerName": "Customer", 11 "CallStatus": { 12 "Status": 1, 13 "Description": "Pending" 14 }, 15 "CustomData": { 16 "var_test1": 1, 17 "var_tesy2": "some value" 18 } 19 }, 20 { 21 "Phone": "972544444444", 22 "CallerID": "", 23 "CallerName": "", 24 "OriginateTime": 0, 25 "Priority": 0, 26 "CustomerName": "Customer 1", 27 "CallStatus": { 28 "Status": 1, 29 "Description": "Pending" 30 }, 31 "CustomData": { 32 "var_test1": 2, 33 "var_tesy2": "some value 2" 34 } 35 } 36 ], 37 "Campaign": { 38 "Name": "Test campaign", 39 "StatusName": "Enabled", 40 "TotalPendingCalls": 2, 41 "MaxPriority": 0, 42 "MinPriority": 0, 43 "Code": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 44 } 45 }, 46 "ErrorCode": 0, 47 "Description": "OK" 48 }

} "Campaign" : "xxxxxxxxxxxxxxxxxxxx"

{ 1 2 3

Page 46: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 43

Parameter list: see AddCall

URI: https://api.voicenter.co.il/ForwardDialer/Dialer/UpdateCall

EXAMPLES Request

1 {

2 "Campaign": "xxxxxxxxx", 3 "Target": "0502454545", 4 "CustomerName" : "John Doe", 5 "Priority" : 42, 6 "CustomData": { 7 "var_test1": 1, 8 "var_tesy2": "some value" 9 }

10 }

GET Request

Response

1 {

2 "ErrorCode": 0, 3 "Description": "OK" 4 }

1 https://api.voicenter.co.il/ForwardDialer/Dialer/UpdateCall?Campaign=xxxx&Tar- 2 get=yyyyy&var_test1=1&var_tesy2=somevalue

Page 47: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 44

Accepts GET, POST and JSON

URI: https://api.voicenter.co.il/ForwardDialer/Dialer/GetCampaignDetails

EXAMPLES JSON Request

JSON Response example

1 {

2 "Data": { 3 "Name": "Morning messages", 4 "StatusName": "Enabled", 5 "TotalPendingCalls": 1, 6 "MaxPriority": 7, 7 "MinPriority": 7, 8 "Code": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 9 },

10 "ErrorCode": 0, 11 "Description": "OK" 12 }

Accepts JSON

URI: https://api.voicenter.co.il/ForwardDialer/Dialer/ConfigureIvrCampaign

EXAMPLES Request

Response

1 { 2 "ErrorCode": 0, 3 "Description": "OK" 4 }

}

"Campaign" : " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "

{ 1 2 3 4 5

1 { 2 "Campaign": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 3 "ConcurrentStrategy": { 4 "setMaxCalls" : 5 5 }, 6 "RepresentativeList": [ 7 "SIP1", 8 "SIP2", 9 "SIP3" 10 ] 11 }

Page 48: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

52 © All rights reserved to Voicenter Revision 3.2 972-73-279-1800 | www.voicenter.co.il | [email protected]

Page 49: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 46

7. Active calls 7.1. Extensions active calls

URL: https://monitor.voicenter.co.il/comet/API/GetExtensionsCalls?code=xxxxxxxxxx

EXAMPLES

BAD ANSWERS:

1 {

2 "ERR": 1, 3 "DESC": "Authorization failed." 4 }

1 {

2 "ERR": 2, 3 "DESC": "Internal error." 4 }

1 { 2 ERR: 0, 3 DESC: "OK", 4 EXTENSIONS: 5 [ 6 { 7 name: "Desk 1", 8 representative: "Dodod", 9 peerstatus: "Reachable",

10 username: "aaaaaaaa", 11 calls: 12 [ 13 { 14 callername: "0547777777", 15 callerphone: "0547777777", 16 callstarted: 1402233117, 17 callanswered: 1402233123, 18 answered: 1, 19 callstatus: "Talking", 20 ivrid: "xxxxXxxxXxxxXxxxXxxxXxxxXxxxXxxx", 21 direction: "Outgoing 22 } 23 ] 24 }, 25 { 26 name: "Desk 2", 27 representative: "", 28 29 username: "tttttttt", 30 calls: [ ] 31 } 32 ] 33 }

Page 50: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 47

7.2. Queue active callers

URL: https://monitor.voicenter.co.il/comet/API/GetQueuesCallers?code=xxxxxxxxxx

EXAMPLES

1 {

2 ERR: 0, 3 DESC: "OK", 4 QUEUES: 5 [ 6 { 7 Name: "Sales", 8 ID: 10035, 9 Callers:

10 [ 11 { 12 Phone: "0570000000", 13 CallID: "xxxxXxxxXxxxXxxxXxxxXxxxXxxxXxxx", 14 JoinTime: 1402235247 15 } 16 ] 17 }

18 ]

19 }

BAD ANSWERS:

1 {

2 "ERR": 1, 3 "DESC": "Authorization failed." 4 }

1 {

2 "ERR": 2, 3 "DESC": "Internal error." 4 }

Page 51: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

55 © All rights reserved to Voicenter Revision 3.2 972-73-279-1800 | www.voicenter.co.il | [email protected]

Page 52: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 49

8. Get Organizational Extension List Accepts GET, POST and JSON

URL: https://monitor.voicenter.co.il/Comet/api/GetExtensions?code=XXXXXXXXXXX&showAll=0

code -> user code

showAll -> true for receive complete organization list

false for current account only

EXAMPLE

} ] }

SIP: "yyyyyyyy", Name: "Account name 2", SpeedDial: "302", AccountID: 2, AccountName: "Acc 2"

{

{ ERR: 0, DESC: "OK", EXTENSIONS: [ {

SIP: "xxxxxxxx", Name: "Account name", SpeedDial: "301", AccountID: 1, AccountName: "Acc 1"

},

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21

Page 53: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

[Type here] [Type here] [Type here]

Page 54: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 51

9. RealTime RealTime API provides real time events of calls and call status changes as well as user

status changes in your organization.

To use the Realtime API you need to connect to the service in one of two ways:

1) If you wish to receive events on per user level, you can use credentials of each

users that can be obtained via Voicenter CPanel interface(recommended).

2) If you wish to receive events of your entire account, you can use token(provided

by Voicenter support).

Voicenter supports WebSocket and SocketIO technologies in order to provide you with

flexibility in Implementation of the solution in your working environment.

HTML (WebSocket) connection:

1) User connection:

To receive only events that are related to a specific user, please use user’s credentials in

order to pass an authentication process with the API.

Please locate the following line in the code sample,

voicenterListener.loginUser("UserNameHere", "UserPasswordHere")

Type credentials that you have obtained from the Voicenter Cpanel.

2) Account Token connection.

If you wish to receive events of all users calls, users status changes and queue events

simultaneously, you should use Voicenter Token authentication. Please contact Voicenter

support to receive your token.

Please locate the following line in the code sample,

voicenterListener.loginToken("YourTokenHere")

Type the token that was provided to you by Voicenter technical support team.

Page 55: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 52

Code example:

{

{ <html> <head></head> <body> Status: <span id="status-txt">Disconnected</span> <br /> <br /> <div id="response-body"></div> </body> </html> <script src="https://voicenter-voicenterltd.netdna-ssl.com/voicenterMonitorListener.js"></script> <script> window.voicenterAsyncLoad = function(){ voicenterListener = new voicenterMonitor(); voicenterListener.connect(); // Connect to server voicenterListener.onConnect = function(errorCode){ // Success if(errorCode == 0){ document.getElementById("status-txt").innerHTML = "Connecting..."; //1)Connection by user(recommended): voicenterListener.loginUser("UserNameHere", "UserPasswordHere"); //OR //2)Account Token connection: //voicenterListener.loginToken("YourTokenHere"); } // Failed else { document.getElementById("status-txt").innerHTML = "Failed to connect"; } }; voicenterListener.onLoginResponse = function(errorCode, errorDesc){ // Success if(errorCode == 0){ document.getElementById("status-txt").innerHTML = "Connected"; console.log(errorDesc); } // Failed else{ document.getElementById("status-txt").innerHTML = errorDesc; console.log(errorDesc); } }; // Extension event voicenterListener.onExtensionEvent = function(res){ console.log(res); var cur = document.getElementById("response-body"); cur.innerHTML = cur.innerHTML + res.reason + "---" + res.data.extenUser + "<br />"; }; // After logging in, receive all extension info voicenterListener.onAllExtensionsEvent = function(data){ console.log(data); }; }; </script>

Page 56: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 53

HTML sample project output example. First glance of the initial page will reveal connection

status and ongoing events of the user/account. In order to view details of events, please go

to your browser’s diagnostic tools. (Normally done by pressing the F12 key)

Page 57: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 54

C# (SocketIO) connection: In order to connect to the SocketIO, please open project attached to each example, expand

the project in solution explorer and open the Program.cs object.

1. User connection:

To receive only events that are related to a specific user, please use user’s credentials in

order to pass an authentication process with the API.

Please locate the following line in the code of the sample project,

MyListener listen = new

MyListener("UserNameHere","PasswordHere",VoicenterRealtimeAPI.Identity.User)

Type credentials that you have obtained from Voicenter Cpanel.

Full code sample can be downloaded here.

2. Account Token connection.

Account(Entire organization or sub-account) Token connection. If you wish to receive events

of all users calls, users status changes and queue events simultaneously, you should use

Voicenter Token authentication.

Please contact Voicenter support to receive your token.

Please locate the following line in the code of the demo project,

MyListener listen = new MyListener("TokenHere","",VoicenterRealtimeAPI.Identity.Token)

Type the token that was provided to you by Voicenter technical support team.

Full code sample can be downloaded here.

C# sample project output example. Once you have opened one of the C# sample projects, please type in your authentication

information and run the project.

You will be able to see events in the console as shown below.

Page 58: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 55

Real time API events. There are four event types:

1) All Extensions – This event is received on an initial connection to the API and will contain

information of all extensions of the user/account.

2) All Queues – This event is received on an initial connection to the API and will contain

information of all queues of the user/account.

3) Extension – with every change or update this event will return a “status update” of the

relevant Extension.

For example: if there was a change in the class status – Dial -> Answer, you will see an

Extension call with the New Status for that extension.

4) Queue – with every change to a specific Queue this event will be called, for example, if a

representative leaves the queue.

How the Event are shown:

This example shows the functionality of “All Extensions", there are 5 extensions here but, the

number of extensions that will be shown in “All Extensions” Depends on your Account and

the current Connected Extensions.

(All Queues)

ALL_QUEUES { "servertime": 1495626533, "queues": [{ "QueueID": 10055, "Calls": [], "QueueName": "Q1" }, { "QueueID": 10057, "Calls": [], "QueueName": "Q2" }, { "QueueID": 10059, "Calls": [], "QueueName": "Q3" }, { "QueueID": 11556, "Calls": [], "QueueName": "Q4" } ], "errorCode": 0 }

(All Extensions)

ALL_EXTENSIONS { "servertime": 1495626533, "extensions": [{ "calls": [], "userID": 55665, "userName": "First Name Last Name", "number": 25853, "extenUser": "Sw3TG6nm", "summery": { "isOpenser": false, "representative": "First Name Last Name", "shiftentertime": null, "ttlabnormal": "N/A", "ttlbreaks": "N/A", "ttlcalls": 0, "ttlincoming": 0, "ttloutgoing": 0, "ttltimeofbreaks": "N/A"

Page 59: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 56

}, "representative": 55665, "representativeStatus": 12, "lastCallEventEpoch": 1495626518, "lastAnsweredCallEventEpoch": 1495626473, "representativeUpdated": 1495626463000, "peerStatus": "OK" }, { "calls": [{ "c2cdirection": 1, "bottomicon": 1, "callIndex": 2, "calldurationinterval": 1495625694, "callStarted": 1495625694, "callername": "0528900231", "callerphone": "0528900231", "callstatus": "Talking", "customdata": {}, "direction": "Outgoing", "ivrid": "201705241134530040cab39e602f3rf5", "recording": { "Filename": "201705241134530040cab39e602f3rf5-aws-Sw3TG6nm-972528900231.wav", "Options": "", "ApproximateURL": "" }, "topicon": 4, "did": "", "channel": "SIP/Sw3TG6nm-00003d63" }], "userID": 56287, "userName": "First Name Last Name 28", "number": 22533, "extenUser": "AuqZu25d", "summery": { "isOpenser": false, "representative": "First Name Last Name 28", "shiftentertime": null, "ttlabnormal": "N/A", "ttlbreaks": "N/A", "ttlcalls": 0, "ttlincoming": 0, "ttloutgoing": 0, "ttltimeofbreaks": "N/A" }, "representative": 56287, "representativeStatus": 1, "lastCallEventEpoch": 1495625700, "lastAnsweredCallEventEpoch": 1495625700, "representativeUpdated": 1495626191000, "peerStatus": "OK" } ]

Extension:

EXTENSION { "data": { "calls": [{ "c2cdirection": 2, "bottomicon": 1, "callIndex": 2, "calldurationinterval": 1495626290, "callStarted": 1495626290, "callername": "0545588999", "callerphone": "0545588999", "callstatus": "Talking", "customdata": {}, "direction": "Click2Call", "ivrid": "201705241144450040hp4svvqbf23frf", "recording": { "Filename": "201705241144450040hp4svvqbf23frf-aws-NGvKyu5f-972545588999.wav", "Options": "", "ApproximateURL": "" }, "topicon": 4, "did": "", "channel": "SIP/NGvKyu5f-000041de" }], "userID": 66670, "userName": "First Name 1", "number": 36506, "extenUser": "NGvKyu5f", "summery": { "isOpenser": false,

Page 60: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 57

"representative": "First Name 1", "shiftentertime": null, "ttlabnormal": "N/A", "ttlbreaks": "N/A", "ttlcalls": 0, "ttlincoming": 0, "ttloutgoing": 0, "ttltimeofbreaks": "N/A" }, "representative": 66670, "representativeStatus": 1, "lastCallEventEpoch": 1495626298, "lastAnsweredCallEventEpoch": 1495626298, "representativeUpdated": 1495626559000, "peerStatus": "OK" }, "eventName": "extension", "reason": "userStatusUpdate", "servertime": 1495626559 }

Queue:

As can be seen on this example, caller just exited a queue and longer waiting on the line.

QUEUE { "data": { "QueueID": 10031, "Calls": [], "QueueName": "VC Support" }, "servertime": 1495626685, "reason": "EXIT" }

As can be seen on this example, caller 0587129000 has joined the queue and is waiting on a line for

representative. QUEUE { "data": { "QueueID": 10031, "Calls": [{ "CallerID": "0587129000", "CallerName": "VC Customer Service", "IvrUniqueID": "2017052411503700404c909dfecg12345",

"JoinTimeStamp": 1495626722, "calldurationinterval": 1495626722,

"ivrid": "2017052411503700404c909dfecg12345"

}],

"QueueName": "VC Support"

},

"servertime": 1495626722,

"reason": "JOIN"}

Page 61: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 58

Field name Description Type Example / Values

c2cdirection The direction of the Click2Call –

The parameter is set with Leg1

Logic, more information can be

found in the Click2CallAPI

String 1 / 2

callStarted The time in which the call has

Started in Epoch Time

Epoch Time 1497776352

calldurationinterval Same as callStarted Epoch Time 1497776352

Callername The caller name (if valid) String

Callerphone Caller phone number String 0500000000

Callstatus Status of the call in the specific

extension

Dialing / Hold /Ringing / Talking

Customdata This field is a Dynamic field that

can hold Specific Information

(If you chose to enter that info)

This field has no values if you

don’t enter new values

Type of Dialer, Information about the

User, information about the costumer

direction The direction of the call ,

click2call has different logic as

written Above.

Incoming / Outgoing / Click2Call

Ivrid The ivrid hold a unique value

that Represtent the specific call

as one-to-one value , two calls

Cannot hold the same IVRID

String 201706130935220102or3wn55f0egd0k

Did The Specific Did Currently

Associated with the Extension

String 0722776772

userID The Id of the Specific Extension

(not representative id)

Number Number of 4 digits or more

userName The Name of the User using the

“Extension”

String “Jon Due”

Number The Id of the specific Extension in

Voicenter

Number 0000 – Number of 4 digits or more

extenUser The user SIP ID that is connected

with this extension

String NGvKnjh1

representative The Id of the Representative that

Logged into The Specific

Extension

Number “Jon Due”

representativeStatus The status of the representative

that is logged to the specific

extension

Value from 1 to 13

lastCallEventEpoch The last call even that

happened time (Answered /

Hold etc.).

Epoch Time 1497776352

lastAnsweredCallEventEpoch The last Time this extension had

an “Answer” call Event.

Epoch Time

1497776352

representativeUpdated The last time the representative

had his status updated.

Epoch Time 1497776352

peerStatus Indicate that the extension is

registered – The softphone /

ipPhone is registered with

Voicenter servers

String “OK”

Reason The reason of the Extension

event

NewCall – New call initiated

Answer - Call was answered

Hold - The call was put on hold

UnHold - Call is no longer on hold

userStatusUpdate – the user status was

updated

Hangup - the call was Hang-up

Servertime Current time on the relevant

server.

Epoch Time 1497776352

Page 62: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 59

The fields that can be Relevant for users are:

EXTENTION FIELDS:

Queue Fields:

Field name Description Type Example / Values

QueueID The ID of the Queue Number

CallerID ID of the caller String

CallerName Name of the Caller String

IvrUniqueID Unique ID that represents the

current call.

String 201706130935220102or3wn55f0egd0k

JoinTimeStamp The time in which the call has

joined the Queue

Epoch

Time

1497776352

calldurationinterval ***NEED TO CHECK *** Epoch

Time

1497776352

ivrid Same as IvrUniqueID String 201706130935220102or3wn55f0egd0k

QueueName The name of the Queue String “Queue 1”

servertime The time in the server when

the event occurred

Epoc Time 1497776352

reason Reason for the Queue event JOIN – When a user Joins the queue

EXIT – When a user Leaves the queue

Page 63: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-6772 | www.voicenter.co.il | [email protected] 60

59 © All rights reserved to Voicenter Revision 3.2 972-73-279-1800 | www.voicenter.co.il | [email protected]

Page 64: API Documentation - Voicenter · performance booster, fully personalize to any duration). • Trigger and initiate an automatic call-back to any ‘Contact us’ lead or customer,

© All rights reserved to Voicenter Revision 19116 972-72-277-1800 | www.voicenter.co.il | [email protected] 61

10. Login/Logout Accepts GET, POST and JSON

URL: http://betaapi.voicenter.co.il/UserLogin/SetStatusFromAPI

Request parameters:

# Name Type Example Description

1 UserID string First 5 digits of User Code in the CPanel. Also shown

when hovering a user's name in the CPanel.

2 Status int 1 - login The user's status in the system. 2 - logout

3

4

5

7

9

11

12

13

The names of these

statuses can be

changed in the CPanel.

3 Code int User code, for authorization only, can be any code of

any user in the organization

4 ExtensionUser string The relevant extension sip name to make the action with

Response parameters:

# Name Type Example Description

1 Status int 1 = ok

2 = Authorization failed

3 = Missing parameters

4 = Login error

5 = Initiation Error

2 StatusError string 0 - No status error

Status 4 errors:

1. Status Changed

2. Failed - Hour Log Error

3. Failed - Queue registration error

4. Extension is already in use

5. You're already logged in with a different extension

Status 5 errors:

1. Please choose extension

2. Successfully Logged In

3. Not logged in

4. Wrong Username or Password

5. There was a problem with the user, please contact support

6. An unexpected error occurred

7. Failed - Extension Monitor doesn’t exist

8. Failed - User has no organizational PIN Code

In case of Status 4, this is

internal error code

3 StatusErrorMes-

sage

string Description of errors