Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
nami-raw-callinize
Advanced tools
Minor fork of NAMI. It adds a raw event emitter and ability to subscribe to events on connect, sets keepalive. Original Description: An asterisk manager interface client, uses EventEmitter to communicate events, will allow you to send actions, and recei
For API and docs, check out the homepage at http://marcelog.github.com/Nami
You can also download the distribution and doc from the CI server, at: http://ci.marcelog.name:8080/view/NodeJS/
A very similar, PHP alternative, is available at http://marcelog.github.com/PAMI An Erlang port is available at https://github.com/marcelog/erlami
Nami by itself is just a library that allows your nodejs code to communicate to an Asterisk Manager Interface (AMI). However, it includes a full application useful to monitor an asterisk installation.
You will be able to login, receive asynchronous events, and send actions (also, asynchronously receiving the according response with their optional related events).
This is supported by the Nami class (er.. function) which inherits from EventEmitter, so your application is able to subscribe to the interesting nami events.
namiConnected
: Emitted when nami could successfully connect and logged in to
an AMI server.namiConnection
: Emitted for all connection related events. Listen to this
generic event for the status of the socket connection.namiConnection(EventName)
: Emitted for the status of the connection. States
include: Connect
, End
, Error
, Timeout
, and Close
. The Error
event
will emit right before the Close
event and includes the error that was thrown.
The Close
event includes a boolean value (had_error
) if an error was thrown.namiEvent(EventName)
: These events are thrown based on the event name
received. Let's say nami gets an event named "Dial", "VarSet", or "Hangup".
This will emit the events: "namiEventDial", "namiEventVarSet", and
"NamiEventHangup".namiLoginIncorrect
: Emitted when the login action fails (wrong password,
etc).namiInvalidPeer
: Emitted if nami tried to connect to anything that did not
salute like an AMI 1.1, 1.2, or 1.3.namiRawMessage
: Whenever a full message is received from the
AMI (delimited by double crlf), this is emitted to invoke the decode routine.
After namiRawMessage, the decodification routine runs to properly identify this
message as a response, an event that belongs to a response, or an async event
from server.namiRawEvent
: Emitted when the decodification routine
classified the received message as an async event from server.namiRawResponse
: Emitted when the decodification routine classified the
received message as a response to an action.$ npm install nami
-or- Download it from this repo :)
Nami expects a configuration object, very much like this:
var namiConfig = {
host: "amihost",
port: 5038,
username: "admin",
secret: "secret"
};
$ mkdir testnami
$ cd testnami
$ npm install nami
var nami = new (require("nami").Nami)(namiConfig);
nami.on('namiEvent', function (event) { });
nami.on('namiEventDial', function (event) { });
nami.on('namiEventVarSet', function (event) { });
nami.on('namiEventHangup', function (event) { });
process.on('SIGINT', function () {
nami.close();
process.exit();
});
nami.on('namiConnected', function (event) {
nami.send(new namiLib.Actions.CoreShowChannelsAction(), function(response){
console.log(' ---- Response: ' + util.inspect(response));
});
});
nami.open();
Use the property 'variables' in the actions:
var action = new namiLib.Actions.Status();
action.variables = {
'var1': 'val1'
};
nami.send(action, function(response) {
...
});
See src/index.js for a better example (including how to reconnect when the current connection closes).
That's about it.
Nami config may contain an optional attribute 'logger'. If it exists, it will be used instead of console:
namiConfig.logger = require('log4js').getLogger('Nami.Core');
var nami = new (require("nami").Nami)(namiConfig);
Viable options: https://github.com/nomiddlename/log4js-node https://github.com/trentm/node-bunyan
Logger may be anything that can be looks like:
logger = {
error: function(message) {},
warn : function(message) {},
info : function(message) {},
debug: function(message) {},
}
If you are using your own logger (i.e: overriding the logger
property of
the Nami client), you should check the documentation for it and apply the needed
changes or configuration accordingly.
If you are using the default Nami logger, you can set the property logLevel
of the Nami client to one of the following values:
See this gist for an example of how to connect to multiple asterisk boxes.
FAQs
Minor fork of NAMI. It adds a raw event emitter and ability to subscribe to events on connect, sets keepalive. Original Description: An asterisk manager interface client, uses EventEmitter to communicate events, will allow you to send actions, and recei
We found that nami-raw-callinize demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 32 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.