Fork me on GitHub

We can do something else except muting calls on Verto. We can put them on hold. It means the user won't hear us. A music on hold will be played instead.

Preparing interface

Adding buttons...

<div class="container">
  <h1>Verto - Demo Application</h1>
  <!-- ... -->
  <button id="hold-call">Hold call</button>
  <button id="unhold-call">Unhold call</button>
</div> <!-- /container -->

Binding click

Inside our bootstrap function add event bindings with a function callback so that we know when user clicked our Hold buttons:

function bootstrap(status) {
  // ...
  document.getElementById("hold-call").addEventListener("click", holdCall);
  document.getElementById("unhold-call").addEventListener("click", unholdCall);

Holding a call

We have to create the callbacks we've specified to the event bindings inside our main function.

function holdCall() {

function unholdCall() {

Try it and see what each button can do to the active call.