Built motion from commit 85328c08.|2.5.50
[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 _0x003b=['../../mysqldb','VoiceExtension','emit','hasOwnProperty','hook','exports'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x003b,0x90));var _0xb003=function(_0x1f6c99,_0x3644d2){_0x1f6c99=_0x1f6c99-0x0;var _0x18d895=_0x003b[_0x1f6c99];return _0x18d895;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xb003('0x0'))['db'][_0xb003('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x410919){return function(_0x2abbed,_0x4b23e2,_0x1d556a){VoiceExtensionEvents[_0xb003('0x2')](_0x410919+':'+_0x2abbed['id'],_0x2abbed);VoiceExtensionEvents[_0xb003('0x2')](_0x410919,_0x2abbed);_0x1d556a(null);};}for(var e in events){if(events[_0xb003('0x3')](e)){var event=events[e];VoiceExtension[_0xb003('0x4')](e,emitEvent(event));}}module[_0xb003('0x5')]=VoiceExtensionEvents;