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

next-yate-compat

v0.0.5

Published

Next-Yate is Nodejs interface library to the Yate external module (Yet Another Telephony Engine) compatible to javascript.yate module

Downloads

2

Readme

Next-Yate-Compat (experimental)

Next-Yate-Compat is Nodejs interface library to the Yate external module (Yet Another Telephony Engine) compatible with javascript.yate module.

This is the next level of abstraction over the Next-Yate library to provide some code compatibility with original javascript.yate API

Compatibility table

| API | javascrip.yate | next-yate | (*) | | :-------------------- | :------------- | :-------- | :--------- | | Message.watch | - | yes | | | Message.unwatch | - | yes | | | Message.install | yes | yes | | | Message.uninstall | yes | yes | | | Message.enqueue | yes | yes | void | | Message.dispatch | yes | yes | async | | Message.handlers | yes | - | | | Message.installHook | yes | - | | | Message.uninstallHook | yes | - | | | Message.trackName | yes | yes | async | | Message.broadcast | yes | - | | | Message.getParam | yes | yes | | | Message.setParam | yes | yes | | | Message.copyParams | yes | yes | | | Message.retValue | yes | yes | | | Message.msgTime | yes | yes | | | Message.getColumn | yes | - | | | Message.getRow | yes | - | | | Message.getResult | yes | - | | | Engine.output | yes | yes | | | Engine.debug | yes | yes | | | Engine.alarm | yes | yes | | | Engine.sleep | yes | yes | async | | Engine.usleep | yes | yes | async | | Engine.yield | yes | - | | | Engine.idle | yes | - | | | Engine.restart | yes | - | | | Engine.dump_r | yes | yes | async | | Engine.print_r | yes | yes | | | Engine.dump_t | yes | yes | async | | Engine.print_t | yes | yes | | | Engine.debugName | yes | yes | | | Engine.debugLevel | yes | yes | | | Engine.debugEnabled | yes | yes | | | Engine.debugAt | yes | yes | | | Engine.setDebug | yes | yes | | | Engine.started | yes | yes | | | Engine.runParams | yes | - | | | Engine.configFile | yes | - | | | Engine.setInterval | yes | yes | | | Engine.setTimeout | yes | yes | | | Engine.clearInterval | yes | yes | | | Engine.clearTimeout | yes | yes | | | Engine.loadLibrary | yes | - | | | Engine.loadObject | yes | - | | | Engine.replaceParams | yes | yes | | | Engine.atob | yes | yes | | | Engine.btoa | yes | yes | | | Engine.atoh | yes | - | | | Engine.htoa | yes | - | | | Engine.btoh | yes | - | | | Engine.htob | yes | - | | | Engine.shared | yes | - | | | Engine.name | yes | yes | | | Math.abs | yes | yes | | | Math.max | yes | yes | | | Math.min | yes | yes | | | Math.random | yes | yes | different| | parseInt | yes | yes | | | isNan | yes | - | | | RegExp.test | yes | yes | | | RegExp.valid | yes | - | | | Date | yes | yes | | | XML | yes | - | | | Hasher | yes | - | | | JSON.parse | yes | yes | | | JSON.stringify | yes | yes | | | JSON.loadFile | yes | - | | | JSON.saveFile | yes | - | | | JSON.replaceParams | yes | - | | | DNS | yes | - | | | Shared | yes | - | | | File | yes | - | | | ConfigFile | yes | - | | | ConfigSection | yes | - | | | Channel | yes | yes | async | | String | yes | yes | different|

Quick start

Before starting

(If you still don't know what Yate is https://docs.yate.ro/wiki/Main_Page)

Make sure the Yate's module extmodule.yate is successfully loaded (https://docs.yate.ro/wiki/External_Module)

yate.conf:

[modules]
extmodule.yate=true

extmodule.conf:

; For network connection
[listener sample]
type=tcp
addr=127.0.0.1
port=5040
role=global
;
; Local stdin/stdout connected scripts
[scripts]
myscript.sh=            ; Custom shell wrapper around Nodejs script
node.sh=my_script.js    ; Run my_script.js with example wrapper: examples/node.sh

Install

npm install next-yate

Network connected script

example_compatible_api.js:

const { Engine, Message } = require("next-yate-compat").getEngine({ host: "127.0.0.1" });

Engine.output("Hello World!");

Local connected script

When launching your script, be sure that Nodejs will find the necessary libraries.

extmodule.conf:

[scripts]
node.sh=my_scrypt.js

Example of shell wrapper around Nodejs

node.sh:

#!/bin/sh

SCRIPTS=/path_to/share/scripts
export NODE_PATH=$SCRIPTS
NODE=`which node`

$NODE $SCRIPTS/$1

Direct script execution in channel mode

regexroute.conf:

^NNN=extmodule/nodata/node.sh example.js

example.js

const {Engine, Message, Channel} = require("next-yate-compat").getEngine({channel: true});
Channel.init(main, {autoring: true});

async function main(message) {
    await Channel.callTo("wave/play/./share/sounds/welcome.au");
    await Channel.answered();
    Channel.callJust("conf/333", {"lonely": true});
}

(Please find welcome.js in /examples)

Examples

/examples

API

javascript.yate API