Built motion from commit f7863d46.|2.5.41
[motion2.git] / server / api / voiceExtension / voiceExtension.events.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x9215=['remove','emit','hasOwnProperty','hook','events','setMaxListeners','save','update'];(function(_0x1e2c76,_0x540046){var _0x2f6eea=function(_0x4ae571){while(--_0x4ae571){_0x1e2c76['push'](_0x1e2c76['shift']());}};_0x2f6eea(++_0x540046);}(_0x9215,0x19c));var _0x5921=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x9215[_0x5783f4];return _0x28e380;};'use strict';var EventEmitter=require(_0x5921('0x0'));var VoiceExtension=require('../../mysqldb')['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x5921('0x1')](0x0);var events={'afterCreate':_0x5921('0x2'),'afterUpdate':_0x5921('0x3'),'afterDestroy':_0x5921('0x4')};function emitEvent(_0x29016b){return function(_0x120fe0,_0x58043b,_0x3488fc){VoiceExtensionEvents[_0x5921('0x5')](_0x29016b+':'+_0x120fe0['id'],_0x120fe0);VoiceExtensionEvents[_0x5921('0x5')](_0x29016b,_0x120fe0);_0x3488fc(null);};}for(var e in events){if(events[_0x5921('0x6')](e)){var event=events[e];VoiceExtension[_0x5921('0x7')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;