Overview
The TForge OmniSense Webphone is an example implementation of a web-based SIP phone designed for seamless integration into CRMs and other systems by developers.
Change Log
2024-05-27 - 1.0.0.0 - Vishane Naicker - First version.
...
Warning |
---|
DO NOT DEPLOY THE EXAMPLE INTO PRODUCTION |
Note |
---|
This is an example. Maintenance and actual implementation is up to the Integrator |
Installation
The Webphone uses sip.js 0.15.11 version. Newer versions of sip.js are not supported as yetup to the integrator.
Download the
file.View file name TForge-OmniSense-Webphone.zip Unzip the file in the respective folder.
URL Parameters
The following parameters will be provided by the Service Delivery Department will provide the following parameter information.
auth_key
server
turn_port
customer_id
password
The following URL parameters must be included with TForge- OmniSense-Webphone.html
Parameter | Datatype | Description |
---|---|---|
|
| Required parameter. Specify the provided authorization key. |
|
| Required parameter. Specify the provided server address. |
|
| Required parameter. Specify the provided TURN port address for connecting the user to the webRTC server. |
|
| Required parameter. Specify the provided customer ID. |
|
| Required parameter. Specify the agent profile ID. |
|
| Required parameter. Specify the agent profile username. |
|
| Required parameter. Specify the provided password for connecting the user to the webRTC server. |
|
| Required parameter. Specify the expiry datetime expiration date for how long the agent webRTC webphone session should last. |
| true | false | Optional parameter. This parameter will enable debug information to be displayed on the console logs. |
| true | false | Optional parameter. This parameter will enable debug information to be displayed on the HTML page. |
...
Usage
The below instructions simulate launching the Webphone in a browser window.
Note |
---|
If the browser page is refreshed after establishing a session, the Webphone will disconnect. |
...
You will need to log the user out and repeat the steps below. |
Register Webphone
Open the browser window with the TForge- OmniSense-Webphone.html file and the required necessary URL parameters. If successfully launchedsuccessful, the below following information will display be displayed in the browser window. If the phone Webphone is not registered, no information will be displayedshown. Use Check the console log to identify troubleshoot any issues.
...
Use the user login API to user log the agent in
Endpoint
Note |
---|
The API will operate outside of office hours only. |
The endpoint server address will be provided by Service Delivery.
Use the following endpoint to initiate your request:
...
Method
...
Endpoint
...
Description
...
POST
...
/vicidial/leads/archive
...
Lead archive endpoint
Authentication
API key will be provided by Service Delivery.
To access the Lead Archive API, you must authenticate using an API key.
Include the following headers in your request:
Code Block |
---|
Authorization: Key=YOUR_API_KEY
Content-Type: application/json |
Request
Info |
---|
The API consistently executes operations in the following sequential order:
|
When making a request, you must post the following JSON object.
Code Block | ||
---|---|---|
| ||
{
"insert_leads": true,
"update_leads": true,
"delete_leads": true,
"lead_ids": [
0,
1
]
} |
...
Field
...
Datatype
...
Description
...
insert_leads
...
true | false
...
This feature enables the insertion of specified lead IDs into the vicidial_list_archive table. Lead IDs that are already present in the vicidial_list_archive table will not be inserted again.
Use update_leads to ensure the specified lead IDs data is synchronized for lead IDs that were not inserted into vicidial_list_archive table.
It is recommended to always set this feature to true.
...
update_leads
...
true | false
...
This feature enables the updation of specified lead IDs. If a lead ID is already present in the vicidial_list_archive table, the API will update the lead ID data with the most recent matching lead ID information retrieved from the vicidial_list table.
It is recommended to always set this feature to true for lead ID data synchronization.
...
delete_leads
...
true | false
...
This feature enables the deletion of specified lead IDs from the vicidial_list table in a safe manner. Before deleting, the API checks if the specified lead IDs exists in the vicidial_list_archive table and the column data matches the vicidial_list table lead ID data.
Setting this feature to false will result in lead IDs remaining in the vicidial_list table.
...
lead_ids
...
Integer
...
Specify the lead IDs that you wish to archive. Limited to 500 leads per request.
CURL request example:
For testing, create a dummy list and load 500 leads. Use created lead IDs.
Insert lead IDs into the vicidial_list_archive table. Ignore lead IDs that exist in the vicidial_list_archive table.
Update lead ID in the vicidial_list_archive table with lead ID data from the vicidial_list table.
Delete lead IDs from the vicidial_list table. Performs safe delete by checking if the lead IDs exist in the vicidial_list_archive table and if the column data matches the vicidial_list table lead ID.
Code Block | ||
---|---|---|
| ||
curl -k -X POST https://<server>/vicidial/leads/archive \
-H "Authorization: Key=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"insert_leads": true,
"update_leads": true,
"delete_leads": true,
"lead_ids": [
0,
1
]
}' |
Response
Info |
---|
The API follows general HTTP response status codes. In addition to the HTTP code included in the JSON response, you can also rely on the HTTP status code returned by the response. |
Tip |
---|
HTTP status code - 200 |
Returns the following successful response If there are no errors with the request or the specified lead IDs. The data will be processed based on the option values specified in the request JSON object.
Code Block | ||
---|---|---|
| ||
{
"message": "lead_ids batch was successfully processed",
"select_count": 1,
"insert_count": 1,
"update_count": 0,
"delete_count": 1
} |
Warning |
---|
HTTP status code - 401 |
Returns the following error response if the API cannot validate the API user.
Code Block | ||
---|---|---|
| ||
{
"message": "unable to validate api user"
} |
Warning |
---|
HTTP status code - 403 |
Returns the following error response if the API was executed during office hours.
Code Block | ||
---|---|---|
| ||
{
"message": "api cannot be executed during office hours time condition"
} |
Warning |
---|
HTTP status code - 400 |
Returns the following error response if the value passed for insert_leads is not a bool value or no value was provided.
Code Block | ||
---|---|---|
| ||
{
"message": "insert_leads must be a boolean value"
"lead_errors": 0,
"lead_ids": []
} |
Returns the following error response if the value passed for update_leads is not a bool value or no value was provided.
Code Block | ||
---|---|---|
| ||
{
"message": "update_leads must be a boolean value"
"lead_errors": 0,
"lead_ids": []
} |
Returns the following error response if the value passed for delete_leads is not a bool value or no value was provided.
Code Block | ||
---|---|---|
| ||
{
"message": "delete_leads must be a boolean value"
"lead_errors": 0,
"lead_ids": []
} |
Returns the following error response if the value passed for lead_ids is not an integer value or was passed with double quotes.
Code Block | ||
---|---|---|
| ||
{
"message": "lead_ids must only contain integer values",
"lead_errors": 1,
"lead_ids": [
"0"
]
} |
Returns the following error response if no value was passed for lead_ids.
Code Block | ||
---|---|---|
| ||
{
"message": "lead_ids must contain atleast 1 value"
"lead_errors": 0,
"lead_ids": []
} |
Returns the following error response if the values passed for lead_ids exceed 500 values.
Code Block | ||
---|---|---|
| ||
{
"message": "lead_ids cannot exceed 500 values",
"lead_errors": 0,
"lead_ids": []
} |
Returns the following error response if the values passed for lead_ids contain duplicate values.
Code Block | ||
---|---|---|
| ||
{
"message": "lead_ids cannot contain duplicate values",
"lead_errors": 1,
"lead_ids": [
0
]
} |
Returns the following error response if the values passed for lead_ids do not exist in the vicidial_list table.
Code Block | ||
---|---|---|
| ||
{
"message": "lead_ids does not exist",
"lead_errors": 1,
"lead_ids": [
0
]
} |
Warning |
---|
HTTP status code - 500 |
Returns the following error response for any other errors not mentioned above.
...
language | json |
---|
...
Retrieve the value of the WebRTC Phone Extension from the browser page or console log and temporarily store it for the corresponding agent profile.
...
User Login
When using the Login API, log in the respective user with the previously stored phone extension.
...
If the Login API request is successful, the browser page will prompt for microphone access. Grant the access, and the Webphone will establish a connection to the agent profile.
...
At this point, you will now be able to use the Telephony APIs to conduct voice operations.
User Logout
Use the Logout API to log out the agent and end the Webphone session.
...