var channels = ['voice', 'chat', 'mail', 'fax', 'sms', 'openchannel'];
Agent.afterUpdate(function(doc, options) {
- io.to(util.format('%s:%s', doc.role, doc.id)).emit('agent:save', {
- id: doc.id,
- name: doc.name,
- online: doc.online,
- queueStatus: doc.queueStatus,
- queueStatusAt: doc.queueStatusAt,
- voicePause: doc.voicePause,
- chatPause: doc.chatPause,
- mailPause: doc.mailPause,
- faxPause: doc.faxPause,
- smsPause: doc.smsPause,
- openchannelPause: doc.openchannelPause,
- lastPauseAt: doc.lastPauseAt,
- phoneBarEnableSettings: doc.phoneBarEnableSettings,
- phoneBarAutoAnswer: doc.phoneBarAutoAnswer,
- phoneBarUnconditional: doc.phoneBarUnconditional,
- phoneBarUnconditionalNumber: doc.phoneBarUnconditionalNumber,
- phoneBarNoReply: doc.phoneBarNoReply,
- phoneBarNoReplyNumber: doc.phoneBarNoReplyNumber,
- phoneBarBusy: doc.phoneBarBusy,
- phoneBarBusyNumber: doc.phoneBarBusyNumber
- });
+ io.to(util.format('%s:%s', doc.role, doc.id)).emit('agent:save', doc);
});
process.on('message', function(data) {
execActions(actions, data, 'voice', 'queue', util, voice, mail, cm, jscripty, integration, urlForward);
break;
case 'ReportAgent.afterUpdate':
- if (data.changed('lastevent')) {
+ if (data.changed.lastevent) {
actions = util.getActionsByTriggers(data, _.filter(_triggers, {
channel: 'voice'
}));