Class: Omnicall Deprecated

Overview

Deprecated. Omnicall module has been deprecated and will be removed

Omnicall provides numbers that are valid phone numbers unique for every Visitor. Calling the number will automatically start an engagement for the Visitor granted there are any Operators available and they accept the engagement. When the engagement starts, audio from the Visitor's phone will be connected to the engagement and will be audible for the Operator.

Replacing more general phone numbers in the application with phone number received from a PHONE_NUMBER_AVAILABLE event will allow quickly identifying Visitors calling in for support.

Events:

PHONE_NUMBER_AVAILABLE

Triggered when Omnicall provides a phone number to show to the Visitor. The event listener will be called with an {OmnicallPhoneNumber} instance.

Examples:

Replace an Omnicall phone number on a page

function replacePhoneNumberOnPage(from, to) {
  // Your code
}

salemove.omnicall.addEventListener(
  salemove.omnicall.EVENTS.PHONE_NUMBER_AVAILABLE,
  function(number) {
    var replacementNumber = number.toString();
    var baseNumber = number.getBaseNumber();

    replacePhoneNumberOnPage(baseNumber, replacementNumber);
    number.addEventListener(number.EVENTS.PHONE_NUMBER_RELEASED, function() {
      replacePhoneNumberOnPage(replacementNumber, baseNumber);
    });
  }
);

ENGAGEMENT_REQUEST

Triggered when the Visitor calls a phone number provided by a PHONE_NUMBER_AVAILABLE event. Omnicall will automatically create an EngagementRequest on behalf of the Visitor. The event listener will be called with that EngagementRequest instance.

Examples:

Add an sm-engaged-operator widget onto the page after Omnicall initiated engagement request was accepted

salemove.omnicall.addEventListener(
  salemove.omnicall.EVENTS.ENGAGEMENT_REQUEST,
  function(engagementRequest) {
    engagementRequest.engagementPromise.then(function(engagement) {
      var operatorWidget = document.createElement('sm-engaged-operator');
      document.body.appendChild(operatorWidget);
    }).catch(function(error) {
      if (error.cause === salemove.ERRORS.OPERATOR_DECLINED) {
        // Your code
      } else {
        // Your code
      }
    });
  }
);

Variables Summary

EVENTS =
{
  ENGAGEMENT_REQUEST: 'omnicall:engagement_request',
  PHONE_NUMBER_AVAILABLE: 'omnicall:phone_number_available'
}

Instance Method Summary

Instance Method Details

# (void) addEventListener(type, listener)

Deprecated. Omnicall module has been deprecated and will be removed

This method allows registration of event listeners on Omnicall.

If a listener is added while Omnicall is processing an event, it will be not triggered with the current event.

If multiple identical listeners are registered on the same event type the duplicate instances are discarded. They do not cause the listener to be called twice and do not need to be removed with the removeEventListener method.

Parameters:

  • type ( string ) The event type for which the user is registering. Must be one of Omnicall.EVENTS.
  • listener ( function ) The listener function that will be called when the event occurs.

# (void) removeEventListener(type, listener)

Deprecated. Omnicall module has been deprecated and will be removed

This method allows the removal of event listeners from Omnicall.

If an event listener is removed while Omnicall is processing an event, it will not be triggered with the current event.

An event listener is never invoked after being removed.

Calling removeEventListener with arguments which do not identify any currently registered listener has no effect.

Parameters:

  • type ( string ) The event type for the listener being removed.
  • listener ( function ) The event listener to be removed.

    Quickly fuzzy find classes, mixins, methods, file:

    Control the navigation frame:

    You can focus and blur the search input: