Built motion from commit 3e059bc2.|2.5.32
[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 _0xc1dc=['VoiceExtension','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1dbaee,_0x433c30){var _0x55b745=function(_0x201a2b){while(--_0x201a2b){_0x1dbaee['push'](_0x1dbaee['shift']());}};_0x55b745(++_0x433c30);}(_0xc1dc,0x184));var _0xcc1d=function(_0x31a776,_0x48c42b){_0x31a776=_0x31a776-0x0;var _0x3cfbab=_0xc1dc[_0x31a776];return _0x3cfbab;};'use strict';var EventEmitter=require(_0xcc1d('0x0'));var VoiceExtension=require(_0xcc1d('0x1'))['db'][_0xcc1d('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xcc1d('0x3')](0x0);var events={'afterCreate':_0xcc1d('0x4'),'afterUpdate':_0xcc1d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4566a9){return function(_0x2b22d3,_0x2b4308,_0x234623){VoiceExtensionEvents['emit'](_0x4566a9+':'+_0x2b22d3['id'],_0x2b22d3);VoiceExtensionEvents[_0xcc1d('0x6')](_0x4566a9,_0x2b22d3);_0x234623(null);};}for(var e in events){if(events[_0xcc1d('0x7')](e)){var event=events[e];VoiceExtension[_0xcc1d('0x8')](e,emitEvent(event));}}module[_0xcc1d('0x9')]=VoiceExtensionEvents;