This project provides an easy-to-integrate SoftPhone SDK for web applications. The SDK allows developers to embed a fully functional softphone within their web projects which can be an inhouse webportal or a CRM Application, enabling seamless communication between agents and customers. The softphone supports both inbound and outbound calling, along with programmatically making calls . By following the simple integration steps provided, developers can quickly enhance their applications with powerful voice communication capabilities.
Using NPM
Refer to the project inside npm-sample-app directory. This project is created using the Create React App utility.
Refer to SDK documentation here
If you are not using a package manager like NPM, you can directly include the bundled JavaScript file provided in the target directory.
-
First you have to generate a 'target' folder. Refer this
-
You can now utilize the 'crmBundle.js' file from 'target folder by including it as a script in your project..
<script src="./target/crmBundle.js"></script>
- Configure the crmWebSDK object like this:
const crmWebSDK = new ExotelCRMWebSDK(accessToken, userId, true);
-
ExotelCRMWebSDK
contructor
accessToken : This can be generated using the Create Authentication Token API
userId : You can get the AppUserId using the Application user management APIs
autoConnectVOIP : If true, it will auto-connect device when the
ExotelWebPhoneSDK
is returned on initialization. (If you have passed false, then you must callDoRegister
onExotelWebPhoneSDK
)Initialize
Initializes the CRMWebSDK, sets up the phone object, and registers callbacks for various events.
Parameters:
sofPhoneListenerCallback
(function): Callback for incoming calls.softPhoneRegisterEventCallBack
(function, optional): Callback for soft phone register events. Default is null.softPhoneSessionCallback
(function, optional): Callback for soft phone session events. Default is null.Returns:
Promise<ExotelWebPhoneSDK | void>: A promise that resolves to an instance of ExotelWebPhoneSDK if successful, or void if unsuccessful.
-
Use the
Initialize
method on theExotelCRMWebSDK
object which returns Promise that resolves toExotelWebPhoneSDK
object.ExotelCRMWebSDK
does all the work to get necessary details required for theExotelWebPhoneSDK
const crmWebPhone = await crmWebSDK.Initialize(HandleCallEvents, RegisterationEvent);
You must pass call events handler, registeration event handler (optional) and session callback handler (optional) to the Initialize
method
-
ExotelWebPhoneSDK
-
RegisterDevice: Registers the device with the call server.
-
UnRegisterDevice: Un-registers the device from the call server.
-
AcceptCall: Accept call
-
HangupCall: Disconnect call
-
MakeCall: (async) Method that places a call
Number: A number to dial
dialCallback: It is called after the call request is made to the server (An actual call may start after this with a slight day).
CustomField: String; Any application-specific value like order id that will be passed back as a parameter in status callback.
-
ToggleHold: Toggle state hold/un-hold state of a call. This state needs to be maintained by the client
-
ToggleMute Toggle state mute/un-mute state of a call. This state needs to be maintained by the client
-
This project is licensed under the Apache-2.0 License. See the LICENSE file for details.