Built motion from commit 4c281f94.|2.6.31
[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 _0x992c=['hasOwnProperty','exports','events','../../mysqldb','VoiceExtension','update','remove','emit'];(function(_0x581fac,_0x165cbc){var _0x207776=function(_0x3a2b5e){while(--_0x3a2b5e){_0x581fac['push'](_0x581fac['shift']());}};_0x207776(++_0x165cbc);}(_0x992c,0x102));var _0xc992=function(_0x1f7ed8,_0x2cc952){_0x1f7ed8=_0x1f7ed8-0x0;var _0x226012=_0x992c[_0x1f7ed8];return _0x226012;};'use strict';var EventEmitter=require(_0xc992('0x0'));var VoiceExtension=require(_0xc992('0x1'))['db'][_0xc992('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc992('0x3'),'afterDestroy':_0xc992('0x4')};function emitEvent(_0x2e2200){return function(_0x460c43,_0x184703,_0x4139fa){VoiceExtensionEvents['emit'](_0x2e2200+':'+_0x460c43['id'],_0x460c43);VoiceExtensionEvents[_0xc992('0x5')](_0x2e2200,_0x460c43);_0x4139fa(null);};}for(var e in events){if(events[_0xc992('0x6')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xc992('0x7')]=VoiceExtensionEvents;