Git Product home page Git Product logo

nami's Issues

Disconnect event

There is no way to correctly react on lost of connection.

I've recently got:

[2012-03-26 05:17:03.693] [INFO] console - warn - 'websocket parser error: reserved fields must be empty'

net.js:453
if (!this._handle) throw new Error('This socket is closed.');
^
Error: This socket is closed.
at Socket._write (net.js:453:28)
at Socket.write (net.js:446:15)

Because of asterisk has been restarted.

  1. Nami tries to write in a dead socket.
  2. I can't do anything to try to reconnect.

How to disable debug logging

When using the library there are get many debug log events printed to the console like the following:
[2016-02-26 11:47:56.036] [DEBUG] Nami.Client - Got event: Event { .....
[2016-02-26 11:47:56.036] [DEBUG] Nami.Client - Skipped 0 bytes

repeated thousands of times.

How do are these disabled?

Doubt using VoicemailUsersList

Hi guys, thanks for the library, it rocks! ;). But I have a problemv with the "VoicemailUsersList" function, I'm not able to capture this event, I've tried different options. Any idea please?

var action = new namiLib.Actions.VoicemailUsersList();

ami.on('VoicemailUserEntry', function (entry) {
ami.on('namiVoicemailUserEntry', function (entry) {
ami.on('namiEvent', function (evt) {

[2014-10-27 22:01:57.970] [WARN] Nami.Client - Discarded: |ActionID: 1
Event: VoicemailUserEntry
VMContext: default
VoiceMailbox: 2000
Fullname: Support
Email:
Pager:
ServerEmail:
MailCommand:
Language:
TimeZone:
Callback:
Dialout:
UniqueID:
ExitContext:
SayDurationMinimum: 2
SayEnvelope: No
SayCID: No
AttachMessage: No
AttachmentFormat:
DeleteMessage: No
VolumeGain: 0.00
CanReview: Yes
CallOperator: Yes
MaxMessageCount: 100
MaxMessageLength: 0
NewMessageCount: 1|

QueueReset

You forgot QueueReset in array actions in actions.js

var actions = [
....
QueueReset,
..
]

Originate Action isn't formatted correctly?

Hi, I've realized that when sending an originate action with Nami in async mode (async:true), asterisk doesn't recognize the ActionID correctly, so it's impossible to trace the subsequent related events (like OriginateResponse Event)

The call itself proceeds, but with actionid recognized as "1".

Example captured with tcpdump from an Asterisk 1.8.7.0:

what nami.js sends:

id: 1
ActionID: 1
Action: Originate
actionid: 1982
channel: Local/xxxxxx@from-internal
context: from-internal
callerid: xxxxxx
exten: xxxxxx
async: true
priority: 1
timeout: 180000

what asterisk responds (when the 1st leg of the call has been established):

Event: OriginateResponse
Privilege: call,all
ActionID: 1
Response: Success
Channel: Local/xxxxxx@from-internal-8789;1
Context: from-internal
Exten: xxxxxx
Reason: 4
Uniqueid: 1402076400.50940
CallerIDNum: xxxxxx
CallerIDName: xxxxxx

I don't know why Nami sends the first two lines ("id:1" and "ActionID: 1") but it clearly has an effect on asterisk's interpretation of the ActionID.

Has anyone encountered this issue?

Thank you

PJsip Actions

How about PJSIP actions?

PJSIPNotify
PJSIPQualify
PJSIPRegister
PJSIPShowEndpoint
PJSIPShowEndpoints
PJSIPShowRegistrationsInbound
PJSIPShowRegistrationsOutbound
PJSIPShowResourceLists
PJSIPShowSubscriptionsInbound
PJSIPShowSubscriptionsOutbound
PJSIPUnregister

Thanks, Jesús

Meteor cannot start when using with nami

I am using npm nami package inside Meteor app to listen to events from an Asterisk server. In server side, I have this code:

namiLib = Meteor.npmRequire "nami"
namiConfig =
    "host": "..."
    "port": 5038
    "username": "..."
    "secret": "...
nami = new namiLib.Nami namiConfig

If I remove the line nami = new namiLib.Nami namiConfig, the server runs fine. But with that line, the server stops at following step, and I cannot access http://localhost:3000, which is the default url for Meteor app. Nami package prevents Meteor from starting.

Any idea to help resolve this issue?

I have posted this question on Stackoverflow but still no solution except using other package instead of nami.

http://stackoverflow.com/questions/28430613/meteor-cannot-start-when-using-meteorhacksnpm-nami-package-cannot-access-loca/28445368?noredirect=1#comment45222484_28445368

Title:sip qualify peer additional parameters

If i am using asterisk 1.8.13 with realtime configuration and i have for example two sip trunks (foo1, foo2) . And i send
new namiLib.Actions.SipQualifyPeer()
i get :
"[2012-09-19 15:18:39.865] [FATAL] Nami.App - Error cant execute sip qualify for the sip peer
[2012-09-19 15:18:39.865] [INFO] console - debug - 'websocket writing' '5:::{"name":"errorOnSipQualify","args":[{"peer":"foo1"}]}'
".
But if i use the following code with PAMI :
(new CommandAction("sip qualify peer foo1 load"))
And later i use the "sip qualify peer foo1" functions.
Is it possible to send additional parameters with the "SipQualifyPeer" Action ?.

nami.connected never become true

In Nami.prototype.open we have:
this.socket.on('connect', this.onConnect);
instead of:
this.socket.on('connect', function () { self.onConnect() });

Not an issue , this is more a request for help

Hey marcelo ,
I'm in the middle of a trouble :D , im making an endpoint api tha takes a post , on that post a i have an an Action to Originate a call then i send the action , outside of that event i do the nami.open .
My problem is , if i leave it like that , the first request works , then the second one still runs the first action again and the second one , and so on .
If i put a nami.close in an outside function like the one you have StandardSend, i get the first action ok , but after that i get no action going to the AMI , but still the nami connects....
I know without giving you code could be difficult to get it but do you have any ideia what could be wrong ?
Thanks

I'm calling this inside the app.post

 nami.on('namiConnected', function (event) {
    var action = new namiLib.Actions.Originate()
    action.Channel = 'LOCAL/' + callid + '@frm-gencalls'
    action.Exten = AgentExtension
    action.Context = 'frm-gencalls-ag'
    action.Priority = '1'
    // action.Callerid = 'AutoCalls <000>'
    action.Variable = 'AgentExtension=' + AgentExtension + ',GCALLID=' + callid
    action.Async = true
    action.Timeout = 30000
    standardSend(action)
  })
  nami.open()

Error on the QuickStart example

Hey, is just me or there is no definition of namiLib on the code ?
Tried to implement the simple quickstart example and (the user on manager is ok so i know it can login) node complians with this.... can you give me a light ?
thanks

nami.send(new namiLib.Actions.CoreShowChannelsAction(), function(response){
^
ReferenceError: namiLib is not defined

sorry let me give you some versions:
nami 0.7.1
node v4.4.0 (and tested it on v0.12.2 too)
Asterisk 11.21.0

Trying to push to an undefined event.

Hello!

I built a call center monitoring application with NAMI.

I'm currently working on another program (not node.js/nami) to Originate a call. Every so often I'm getting the crash on the monitoring application

(Paths changed)

/home/user/app/node_modules/nami/src/nami.js:70
this.responses[event.actionid].events.push(event);
^
TypeError: Cannot read property 'events' of undefined
at Nami.onRawEvent
(/home/user/app/node_modules/nami/src/nami.js:70:39)
at Nami.EventEmitter.emit (events.js:96:17)
at Nami.onRawMessage
(/home/user/app/node_modules/nami/src/nami.js:119:14)
at Nami.EventEmitter.emit (events.js:96:17)
at Nami.onData
(/home/user/app/node_modules/nami/src/nami.js:142:14)
at Socket.Nami.onWelcomeMessage
(/home/user/app/node_modules/nami/src/nami.js:182:18)
at Socket.EventEmitter.emit (events.js:96:17)
at TCP.onread (net.js:392:31)

Even though I can't reproduce this all the time, I think this is directly related to my Originate or checking for OriginateResponse..

Other info: npm ls

├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └─┬ [email protected]
│ └── [email protected]
├── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ └── [email protected]
└─┬ [email protected]
├── [email protected]
├── [email protected]
└─┬ [email protected]
├─┬ [email protected]
│ └── [email protected]
├── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
└── [email protected]

Wrong handling of VarSet event

{ lines: 
   [ 'Event: VarSet',
     'Privilege: dialplan,all',
     'Channel: SIP/sip123456-000000be',
     'Variable: MACRO_DEPTH',
     'Value: 1',
     'Uniqueid: 1399421255.190' ],
  EOL: '\r\n',
  variables: { MACRO_DEPTH: undefined },
  event: 'VarSet',
  privilege: 'dialplan,all',
  channel: 'SIP/sip123456-000000be',
  value: '1',
  uniqueid: '1399421255.190' }

Hack in Message.prototype.unmarshall() that supposed to handle variables in event currently breaks resulted event obj for VarSet event.

There is no variable key in obj.
There is no values in variables storage.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.