Building with the Open ContactPad SDK

Place a call programmatically

<script type="text/javascript">
  VonageDialer.placeCall('+17328586962' /* optionally pass a preferred contact */
  // , { 
  //   provider: 'acme',
  //   id: '123',
  //   label: 'John Smith',
  //   type: 'contact'
  // }
  ); 
</script>

LIVE SAMPLE

Subscribing for interaction events

VonageDialer.init({ /* dialer config options */ }, (dialer) => {
  dialer.setOnDialerEvent((event) => {
    switch (event.type) {
      case 'CALL_START': {
        break;
      }
      case 'CALL_ANSWER': { // available only for UC
        break;
      }
      case 'CALL_END': {
        // do something based on event.data (screen pop, store interaction, etc.)
        break;
      }
      default: {
        console.log('Unhandled event', event);
      }
   }
  });
});

LIVE SAMPLE

Click To Dial

The SDK includes a built-in phone annotation library which can parse the current page HTML content for valid phone number strings and will place a phone icon near the discovered numbers for easy ClickToDial.

<script type="text/javascript">
  VonageDialer.enableClickToDial(true);
</script>

Set country code

By default the parser is annotating all international formatted numbers (having country code prefix) and all valid national format US numbers. In order to work with a different country's local phone numbers, change the dialer country code based on ISO 3166-1 alpha-2 standard.

<script type="text/javascript">
  VonageDialer.setCountryCode('GB'); // work with UK local numbers
  VonageDialer.enableClickToDial(true);
</script>

LIVE SAMPLE

Continue to Customizations.