npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ucclient-sdk

v1.0.10

Published

UCCLIENT - SDK is a client side SDK to access the Mondago family of UC desktop products. The SDK allows a developer to control the users device through the UC client. This includes actions such as Makecall, Answer, Hangup etc. The API also provides the ab

Downloads

21

Readme

UCCLIENT - SDK

UCCLIENT - SDK is a client side SDK to access the Mondago family of UC desktop products. The SDK allows a developer to control the users device through the UC client. This includes actions such as Makecall, Answer, Hangup etc. The API also provides the ability to get call events, which includes the callers phone number. This allows a developer to act on these events.

For complete examples, see our client examples repository.

Dependencies

Download your software dependencies here

Features

  • Monitor login: check for the start up and login of your desktop client, telling you when you can start using the api
  • Monitor calls: see your call events coming in, initial event and updates to your calls
  • Control handset: use the api to easily control your active calls and make new calls

Installing

Using npm:

$ npm install ucclient-sdk

Using our released zip (available here)

<script src="./path/to/ucsdk.js"></script>

Importing

Using npm:

import UCSession from "ucclient-sdk"

Using released zip:

const UCSession = window.ucsdk.default

Example

const ucSession = new UCSession()

ucSession.connect()

Events are communicated using event listeners. To receive an event add event listeners for "ucLogin" and "ucCall".

The objects, shown later, are stored in the detail property of the event.

Show data:

window.addEventListener("ucLogin", (loginEvent) => console.log(loginEvent.detail))
window.addEventListener("ucCall", (callEvent) => console.log(callEvent.detail))

Methods

ucSession.connect()

ucSession.callController.makeCall(destination)

ucSession.callController.hangupCall(id)

ucSession.callController.holdCall(id)

ucSession.callController.unHoldCall(id)

ucSession.callController.answerCall(id)

Examples

ucSession.callController.makeCall("0800123456")
ucSession.callController.holdCall("call_id_here:0123456789")

Objects

Shown below are the objects you may receive and handle.

Call

Call object, generated on any call event.

{
    "Type": "Call",

    // `Id` is important, will be used to control this call using the methods shown above
    "Id": "037d274e-64cb-406e-9531-09f205caf5a2",

    // `Event` can be UPDATE | REMOVE
    "Event": "UPDATE",

    // `State` can be "DIALBACK" | "DIALING" | "RINGING" | "CONNECTED" | "ENDED" | "HELD" | "CONFERENCED" | "DISCONNECTED"
    "State": "DIALING",

    "HostId": "",
    "Start": "2019/03/21 10:32:45",
    "DurationTotal": "1",
    "DurationRing": "",
    "DurationHeld": "",
    "DurationConnected": "",
    "DurationOther": "",
    "Caller": {
        "Id": "",
        "Tel": "1234",
        "DisplayTel": "1234",
        "Name": "John Smith",
        "DisplayName": "John Smith",
        "ForeignId": "",
        "DirectoryId": "",
        "Department": "Development"
    },
    "Called": {
        "Id": "321",
        "Tel": "0800500005",
        "DisplayTel": "(0800) 500 005",
        "Name": "United Kingdom",
        "DisplayName": "Freephone",
        "ForeignId": "",
        "DirectoryId": "",
        "Department": ""
    },
    "Connections": "",
    "Trunk": "",

    // `Direction` can either be I | O for inbound or outbound
    "Direction": "O",

    "External": "",
    "Missed": "1",
    "Category": "",
    "Custom1": "",
    "Custom2": ""
}

Login

Login event, generated on connection to the socket.

{
   "Type":"Login",

   // The most important part of this object is the id, this may need to be sent in with some methods
   "Id":"#USERID",

   "ShortName":"#SHORTNAME",
   "Name":"#USERNAME",
   "PolicyId":"#POLICYID",
   "Devices":[],
   "Email":"",
   "RegisteredDevices":"",
   "CurrentTel":"",
   "Photo":"",
   "Department":"",
   "State":"",
   "DirectionState":"",
   "UserState":"",
   "AgentState":"",
   "ContactState":"",
   "DndState":"",
   "ForwardState":"",
   "MessageState":"",
   "Location":"",
   "AbsenceText":"",
   "UsePBXName":"",
   "ClassType":"",
   "EquipmentId":"",
   "Changes":"",
   "DDI":"",
   "AvailabilityUntil":"",
   "UserSrc":"LoginUser"
}