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 _0x370d=['events','../../mysqldb','VoiceExtension','update','remove','hasOwnProperty'];(function(_0x438685,_0x4ec0c0){var _0x41cca2=function(_0x532003){while(--_0x532003){_0x438685['push'](_0x438685['shift']());}};_0x41cca2(++_0x4ec0c0);}(_0x370d,0x144));var _0xd370=function(_0x10a21f,_0x414459){_0x10a21f=_0x10a21f-0x0;var _0x489175=_0x370d[_0x10a21f];return _0x489175;};'use strict';var EventEmitter=require(_0xd370('0x0'));var VoiceExtension=require(_0xd370('0x1'))['db'][_0xd370('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd370('0x3'),'afterDestroy':_0xd370('0x4')};function emitEvent(_0x145598){return function(_0xdb3e0d,_0x5dbad3,_0x808761){VoiceExtensionEvents['emit'](_0x145598+':'+_0xdb3e0d['id'],_0xdb3e0d);VoiceExtensionEvents['emit'](_0x145598,_0xdb3e0d);_0x808761(null);};}for(var e in events){if(events[_0xd370('0x5')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;