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

ue-softphone-sdk

v5.0.7

Published

ue-softphone-sdk

Readme

极简互联电话条sdk

4.0.12 针对safari 浏览器获取麦克风权限的适配 4.0.13 网络检测请求地址修改;增加音量检测事件 4.0.18 增加muteRing方法,关闭铃声 4.0.19 增加monitor监控开关,默认关闭;增加(监听,抢接,强拆,强插,耳语)方法 4.0.20 > a.增加closeSdkMonitor监控关闭方法,type(summary: 监控总览, agent: 座席监控, queue: 服务组监控) > b.sdkMonitorMsg方法,开启监控总览 type类型由string改为array 4.0.24 不论监听与否都会连接通话socket 4.0.27 修复退出登录时socket关闭错误,导致用户再次初始化状态异常 4.0.30 登录增加passwordPk参数

5.0.3

座席视频通话

完整初始化、API、事件和媒体处理说明见座席视频通话对接文档。

初始化时设置 enableVideoCall: true,SDK 会在座席登录成功后自动准备独立的视频通话连接。默认值为 false,不会改变既有客户的连接行为。

const ue = new ueSoftPhone({
  accountName: "8005@uecs1",
  password: "password",
  server: "https://example.com/api",
  enableVideoCall: true,
});

ue.videoCall.on("incomingCall", ({ caller, callerName, callerSip }) => {
  console.log("座席来电", callerName || caller, callerSip);
});

ue.videoCall.on("media", ({ localStream, remoteStream }) => {
  localVideo.srcObject = localStream;
  remoteVideo.srcObject = remoteStream;
});

await ue.videoCall.call({ targetExtension: "8006", mediaType: "video" });
// 呼入时调用:await ue.videoCall.answer({ mediaType: "video" });

呼出时 targetExtension 填被叫座席工号。SDK 会自动完成连接;收到来电时可通过 incomingCall 事件获取主叫座席工号和名称。

ue.videoCall 提供 call({ targetExtension, mediaType })、answer({ mediaType })、reject()、hangup()、getState()、getLocalStream()、getRemoteStream()、setCameraEnabled(boolean)、setMicrophoneEnabled(boolean)、isCameraEnabled() 和 isMicrophoneEnabled()。mediaType 可为 video 或 audio,默认是 video。媒体轨道仅在通话协商成功后可用。

可通过 on(event, callback) 监听 stateChange、incomingCall、progress、accepted、ended、failed 和 media 事件;on 返回取消监听函数,也可用 off(event, callback) 移除监听。销毁 SDK 时视频会话、注册和独立 SIP 连接会一并释放。

WebRTC麦克风控制

1、开启或关闭麦克风

该方法仅支持 WEBRTC 登录方式,并且需要在通话已建立、本地麦克风音轨存在时调用。其他登录方式调用时会返回失败提示。

ue.webrtc.setMicrophoneEnabled(Object object)

参数:

| 属性 | 类型 | 可选值 | 默认值 | 必填 | 说明 | | --- | --- | --- | --- | --- | --- | | success | function | - | - | 否 | 调用成功回调 | | fail | function | - | - | 否 | 调用失败回调 | | enabled | boolean | - | - | 是 | 是否开启麦克风 |

object.enabled 的合法值

| 值 | 说明 | | --- | --- | | true | 开启麦克风 | | false | 关闭麦克风 |

调用成功返回:

{
  success: true,
  message: "setMicrophoneEnabled success",
  enabled: true
}

非 WEBRTC 登录方式调用失败返回:

{
  success: false,
  message: "当前登录方式不支持麦克风控制,请切换为 WEBRTC 登录方式!"
}

示例:

// 开启麦克风
ue.webrtc.setMicrophoneEnabled({
  enabled: true,
  success: function (res) {
    console.log(res, "开启麦克风成功");
  },
  fail: function (error) {
    console.log(error, "开启麦克风失败");
  }
});

// 关闭麦克风
ue.webrtc.setMicrophoneEnabled({
  enabled: false,
  success: function (res) {
    console.log(res, "关闭麦克风成功");
  },
  fail: function (error) {
    console.log(error, "关闭麦克风失败");
  }
});

2、查询麦克风状态

该方法用于查询当前 WEBRTC 本地麦克风音轨是否开启。需要在 WEBRTC 登录方式下,并且本地麦克风音轨已存在时调用。

ue.webrtc.isMicrophoneEnabled()

参数:

无

返回值:

| 类型 | 说明 | | --- | --- | | boolean | true 表示麦克风已开启,false 表示麦克风已关闭或当前没有可用的本地麦克风音轨 |

示例:

const enabled = ue.webrtc.isMicrophoneEnabled();

if (enabled) {
  console.log("麦克风已开启");
} else {
  console.log("麦克风已关闭或暂无可用麦克风音轨");
}