1.1.0 • Published 4 years ago

nami-cc v1.1.0

Weekly downloads
57
License
-
Repository
github
Last release
4 years ago

NAMI-CC

nami-cc 是一个 node 连接 asterisk 的 ami 库。 根据CC项目 Fork Nami

  • 修改package.json, 重命名 nami-cc 发布到 NAM.
  • 添加相关 action
  • 删除冗余日志

安装

npm install nami-cc

-or- Download it from this repo :)

配置

Nami expects a configuration object, very much like this:

let 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();

Adding variables to actions

Use the property 'variables' in the actions:

var action = new namiLib.Actions.Status();
action.variables = {
    'var1': 'val1'
};
nami.send(action, function(response) {
    ...
});
1.1.0

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

6 years ago

0.6.12

8 years ago

0.6.10

8 years ago

0.6.9

8 years ago

0.6.8

9 years ago

0.6.7

9 years ago