Provides a Ziwo Client to perform call
Online documentation: http://doc-core-front.ziwo.tech/
Take time to read the following links:
Usage section of this fileEvents section of this fileYou can easily instanciate a Ziwo Client:
ziwoClient = new ziwoCoreFront.ZiwoClient({
autoConnect: true, // Automatically connect agent to contact center. Default is true
contactCenterName: 'your-contact-center-name', // Contact center you are trying to connect to
credentials: { // User's credentials. You can either send an authentication token or directly the user's credentials
authenticationToken: 'token_returned_on_login_action',
//// If you don't have an authentication token, simply provide user's credentials
// email: 'toto@hello.org',
// password: 'verysecretpassword',
},
tags: { // HTML tags of <video> elements available in your DOM
selfTag: document.getElementById('self-video'), // `selfTag` is not required if you don't use video
peerTag: document.getElementById('peer-video'), // `peerTag` is mandatory. It is used to bind the incoming stream (audio or video)
},
debug: true, // Will provide additional logs as well as displaying incoming/outgoing Verto messages
});
If you disabled the auto connect in the option, make sure to call connect() before anything else.
Now, you can use the only function available in the Ziwo Client : startCall
ziwoClient.startCall('+3364208xxxx');
Everything else is managed through the events.
The events emitted by Ziwo will allow you to perform many actions. Each event holds a Call instance that you can use to change the status of the call.
See below the list of events:
| Events | Description |
|---|---|
| error | Something wrong happened. See details for further information |
| connected | User has been successfully authenticated |
| disconnected | User has been disconnected |
| requesting | Requesting operator to make the call |
| trying | Operator trying to make the call |
| early | Call is waiting for customer to pick up |
| ringing | Call is ringing agent phone |
| answering | Agent is answering call |
| active | Agent and customer can talk to each other |
| held | Customer has been put on hold by the Agent |
| hangup | Call is being hanged up |
| mute | Call has been muted by the agent |
| unmute | Call has been unmuted by the agent |
| destroy | Call is destroying |
| recovering | When reconnecting to virtual phone and a call wasn't over, it automatically recovers it |
For retro-compability reason, events are emitted with 2 formats:
jorel-dialog-state-{EVENT_NAME} (ex: jorel-dialog-state-held)ziwo-{EVENT_NAME} (ex: ziwo-held)You can use addEventListener to listen for ziwo event. Here is how you could simply answer an incoming call.
// Automatically answer incoming call
window.addEventListener('ziwo-ringing', (ev) => {
// ev holds an instance of the Call in its details
ev.details.call.answer();
});
Read http://doc-core-front.ziwo.tech/classes/ziwoevent.html) for more details
| Command | Description |
|---|---|
| build | Build the library into /dist |
| start | Start the library in watch mode |
| start:app | Start the demo application |
| start:app:port | Start the demo application on a specific port. Usage: $ PORT=1818 npm run start:app:port |
| lint | Run tslint |
| test | Run the unit tests |
| test:coverage | Display a test coverage report |
| doc | Build the documentation |
| open:doc | Open the documentation |
git checkout -b my-new-feature)git commit -am 'Add some feature')git push origin my-new-feature)DO:
',, colons : and semi-colons ; are followed by a single space;DO NOT:
var to declare variable. Instead use const or let<type>myVar for casting. Instead use as keywordlet x = 1, y = 2 is forbidden)DO:
DO NOT: 2. Do not export type/functions/interface/class unless you need to share it across multiple components
DO:
DO NOT:
_ for private propertiesI as a prefix for interface namesDO:
void)DO NOT:
Interface'x'|'y' as type. Instead use EnumanyDO:
public/private/protected)public/private/protected)Generated using TypeDoc