84bdd1e2df83f49ad7db9137b2d07fd8c2c52507
[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 _0xeb17=['events','../../mysqldb','VoiceExtension','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x36293b,_0xc78ab7){var _0x67a604=function(_0x43e31f){while(--_0x43e31f){_0x36293b['push'](_0x36293b['shift']());}};_0x67a604(++_0xc78ab7);}(_0xeb17,0x87));var _0x7eb1=function(_0x67c08c,_0x563a4a){_0x67c08c=_0x67c08c-0x0;var _0x33ee57=_0xeb17[_0x67c08c];return _0x33ee57;};'use strict';var EventEmitter=require(_0x7eb1('0x0'));var VoiceExtension=require(_0x7eb1('0x1'))['db'][_0x7eb1('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7eb1('0x3'),'afterUpdate':'update','afterDestroy':_0x7eb1('0x4')};function emitEvent(_0x581bf2){return function(_0x495e05,_0x5b8b6c,_0x53b64e){VoiceExtensionEvents['emit'](_0x581bf2+':'+_0x495e05['id'],_0x495e05);VoiceExtensionEvents[_0x7eb1('0x5')](_0x581bf2,_0x495e05);_0x53b64e(null);};}for(var e in events){if(events[_0x7eb1('0x6')](e)){var event=events[e];VoiceExtension[_0x7eb1('0x7')](e,emitEvent(event));}}module[_0x7eb1('0x8')]=VoiceExtensionEvents;