Closed andreabianco closed 7 years ago
It's not "a json", it's a plain ol' javascript object. if evt
is the name of the event argument in your handler callback Object.keys(evt.variable)[0]
should be the name of the variable - e.g.
ami.on('varset', function(evt) {
console.log(Object.keys(evt.variable)[0], 'set to', evt.value);
});
Hi! I'm listing on VarSet event but it's not clear how I can get the variable name: in the last variable is set as a json and the variable name is the key. Can you change with a string?
An example: variable: { sipcallid: '' }, value: 'xxxxxx'