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 🙏

© 2026 – Pkg Stats / Ryan Hefner

oneyun-sipclient-desktop-js-sdk

v0.1.5

Published

onyun node sdk

Readme

JS SDK Version

SIP 客户端的 JS SDK

准备

安装

npm install oneyun-sipclient-desktop-js-sdk --save-dev

使用 CMD

import JsClient from 'oneyun-sipclient-desktop-js-sdk'
let Client = new jsClient('ws://localhost:2000/')

已用 UMD 包装,因此它们可以直接用作 AMD 模块

使用 AMD

// 引入文件
<script src="./node_modules/oneyun-sipclient-desktop-js-sdk/dist/oneyun-client-js.js"> </script>

// 创建实例
var Client = new OneYunJsSipClient('ws://localhost:2000/')

接口

| 方法 | 参数 | 说明 | |-----------------------|--------------|--------------------------| | answer | 无 | 应答 | | hangup | 无 | 挂断 | | minimize | 无 | 窗口最小化 | | show | 无 | 窗口最大化 | | getCurrentVolume | 无 | 获取当前振声器 | | getCurrentMicroVolume | 无 | 获取当前麦克风 | | setVolume | {int} volume | 设置当前振声器音量 0-100 | | setMicroVolume | {Int} volume | 设置当前麦克风音量 0-100 | | setAccount | {string} user, {string} password, {string} domain, {unit} timeout | 设置 SIP 账户信息|

用法

Client.answer()
Client.hangup()
Client.getCurrentVolume()
Client.setVolume(20)
Client.setAccount('100001888888','123456','sip.oneyun.com',300);

响应 & 事件

// 成功返回
{"jsonrpc":"2.0","result":"","id":1}
// 收到事件
{"jsonrpc":"2.0","result": {"events": "hangup"},"id":1}

// 失败返回
{"jsonrpc":"2.0","result":"失败原因","id":1}

事件列表

| 事件 | 说明 | |-----------|------------| | "hangup" | 挂断事件 | | "answer" | 来电事件 | | "calling" | 通话中事件 |

需要注意的是,这里的结果返回是在websocket 回调中获取

Client.ws.onmessage = function (callback) {
  ...callback
};

查看案例