1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0x1e45=['setMaxListeners','update','remove','emit','hook','VoiceExtension'];(function(_0x159134,_0x21d468){var _0x56a11d=function(_0x153adc){while(--_0x153adc){_0x159134['push'](_0x159134['shift']());}};_0x56a11d(++_0x21d468);}(_0x1e45,0x1eb));var _0x51e4=function(_0x2f55b0,_0x3f5aa1){_0x2f55b0=_0x2f55b0-0x0;var _0x3e6e82=_0x1e45[_0x2f55b0];return _0x3e6e82;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0x51e4('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x51e4('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x51e4('0x2'),'afterDestroy':_0x51e4('0x3')};function emitEvent(_0x3664b3){return function(_0x5b70da,_0x32b5b9,_0x5d06f6){VoiceExtensionEvents[_0x51e4('0x4')](_0x3664b3+':'+_0x5b70da['id'],_0x5b70da);VoiceExtensionEvents[_0x51e4('0x4')](_0x3664b3,_0x5b70da);_0x5d06f6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x51e4('0x5')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;