Built motion from commit 87cd5f02.|2.5.48
[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 _0xc008=['../../mysqldb','VoiceExtension','setMaxListeners','save','remove','emit','hook','exports','events'];(function(_0xccc0d4,_0x2f6bf7){var _0x27a653=function(_0x285e63){while(--_0x285e63){_0xccc0d4['push'](_0xccc0d4['shift']());}};_0x27a653(++_0x2f6bf7);}(_0xc008,0x1a6));var _0x8c00=function(_0x417726,_0x9fb029){_0x417726=_0x417726-0x0;var _0x4e3fbb=_0xc008[_0x417726];return _0x4e3fbb;};'use strict';var EventEmitter=require(_0x8c00('0x0'));var VoiceExtension=require(_0x8c00('0x1'))['db'][_0x8c00('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x8c00('0x3')](0x0);var events={'afterCreate':_0x8c00('0x4'),'afterUpdate':'update','afterDestroy':_0x8c00('0x5')};function emitEvent(_0x2ad3b0){return function(_0x459d0c,_0x4dfc0a,_0x4afb30){VoiceExtensionEvents[_0x8c00('0x6')](_0x2ad3b0+':'+_0x459d0c['id'],_0x459d0c);VoiceExtensionEvents[_0x8c00('0x6')](_0x2ad3b0,_0x459d0c);_0x4afb30(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x8c00('0x7')](e,emitEvent(event));}}module[_0x8c00('0x8')]=VoiceExtensionEvents;