View Only
Discussion Thread View

dialer subscribe To Custom Handler Notification Method

  • 1.  dialer subscribe To Custom Handler Notification Method

    Posted 12-02-2021 10:02
    Hi There

    Has anyone ever used the Dialer.subscribeToCustomHandlerNotification Method for Custom Scripting.
    I am able to trigger a Handler from a function but not Subscribe to the Notifications.

    The example below describes that a listener is to be created to listen for Sencustomnotification Events from Handlers and then do a Callback to get the response data from the Custom notification, can anyone give me an example of how this is achieved?

    Input Parameters


    The scripter has to define the header containing the objectID, eventID pairs that they want to subscribe to. For example:

    var headers = [
      { "objectId": "CompletePurchaseObjectID", "eventId": "CompletePurchaseEventID" },
      { "objectId": "NextTransactionObjectID", "eventId": "NextTransactionEventID" }

    This is a user-defined function that is called upon the reception of a notification from the custom handler. This function accepts three parameters: objectId, eventId and data. For example:

    function executeWhenHandlerResponds(objectId, eventId, data)
    { console.log('ObjectID returned was: '+ objectId); console.log('EventID returned was: '+ eventId); console.log('DataReturned was '+ data); }

    The user can parse the data object returned as they wish. However, they should be able to anticipate the type of data the notification contains which requires knowledge of the custom handler's steps.

    Kind Regards


    Stephen Collins
    acrinax Ltd