e9fc1c3e05e2adba35f782879afaf35e133da497
[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 _0xc990=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','save','update','remove','emit'];(function(_0x386af8,_0x377b3e){var _0x16ca73=function(_0x5bddeb){while(--_0x5bddeb){_0x386af8['push'](_0x386af8['shift']());}};_0x16ca73(++_0x377b3e);}(_0xc990,0x1a7));var _0x0c99=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xc990[_0x279d37];return _0x530173;};'use strict';var EventEmitter=require(_0x0c99('0x0'));var VoiceExtension=require(_0x0c99('0x1'))['db'][_0x0c99('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0c99('0x3'),'afterUpdate':_0x0c99('0x4'),'afterDestroy':_0x0c99('0x5')};function emitEvent(_0x484e73){return function(_0x8c77d9,_0x1a776f,_0x5b18b8){VoiceExtensionEvents[_0x0c99('0x6')](_0x484e73+':'+_0x8c77d9['id'],_0x8c77d9);VoiceExtensionEvents['emit'](_0x484e73,_0x8c77d9);_0x5b18b8(null);};}for(var e in events){if(events[_0x0c99('0x7')](e)){var event=events[e];VoiceExtension[_0x0c99('0x8')](e,emitEvent(event));}}module[_0x0c99('0x9')]=VoiceExtensionEvents;