I’m using the following code:
var app = require('app');
var util = require('util');
app.init();
var presenceReporter = { };
presenceReporter.bindListeners = function() {
digium.event.observe({
'eventName' : 'digium.phone.contact_presence',
'callback' : this.reportPresence()
});
};
presenceReporter.reportPresence = function(params) {
//var msg = params.eventData;
util.debug("Presence Changed: ");
util.debug(JSON.stringify(params));
};
presenceReporter.init = function () {
digium.app.exitAfterBackground = false;
this.bindListeners();
};
presenceReporter.init();
This code works the first time it starts, then every other time the event is fired, I get the following error:
error executing handler for event digium.phone.contact_presence: TypeError: Property ‘0’ of object is not a function
I’m a C# developer so JS is new to me.