Fork me on GitHub

One of the most important telephony feature is the Transfer. As everything we have done with Verto until now, transferring a call will be easy.

Preparing interface

Adding button...

<div class="container">
  <h1>Verto - Demo Application</h1>
  <!-- ... -->
  <button id="transfer-call">Transfer call</button>
</div> <!-- /container -->

Binding click

Inside our bootstrap function add event binding with a function callback so that we know when user clicked our Transfer button:

function bootstrap(status) {
  // ...
  document.getElementById("transfer-call").addEventListener("click", transferCall);
};

Transferring a call

We have to create the callback we've specified to the event binding inside our main function.

function transferCall() {
  var destinationNumber = prompt("Insert transfer destination number");
  if(destinationNumber) {
    currentCall.transfer(destinationNumber);
  }
};

Try it and see by yourself how easy is to transfer a call with Verto library.