Built motion from commit e02f907f.|2.6.14
[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 _0xc86d=['VoiceExtension','save','update','remove','hook','exports','../../mysqldb'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xc86d,0x99));var _0xdc86=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xc86d[_0x164eca];return _0x2ce562;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xdc86('0x0'))['db'][_0xdc86('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdc86('0x2'),'afterUpdate':_0xdc86('0x3'),'afterDestroy':_0xdc86('0x4')};function emitEvent(_0x2d5389){return function(_0x2179ad,_0x5557a7,_0x153ff9){VoiceExtensionEvents['emit'](_0x2d5389+':'+_0x2179ad['id'],_0x2179ad);VoiceExtensionEvents['emit'](_0x2d5389,_0x2179ad);_0x153ff9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xdc86('0x5')](e,emitEvent(event));}}module[_0xdc86('0x6')]=VoiceExtensionEvents;