Built motion from commit eddce310.|2.6.12
[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 _0xd688=['events','../../mysqldb','VoiceExtension','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0xd29892,_0x2b67b9){var _0x293dfd=function(_0x22f177){while(--_0x22f177){_0xd29892['push'](_0xd29892['shift']());}};_0x293dfd(++_0x2b67b9);}(_0xd688,0x12c));var _0x8d68=function(_0xc563c0,_0x43cd8c){_0xc563c0=_0xc563c0-0x0;var _0x254edb=_0xd688[_0xc563c0];return _0x254edb;};'use strict';var EventEmitter=require(_0x8d68('0x0'));var VoiceExtension=require(_0x8d68('0x1'))['db'][_0x8d68('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8d68('0x3'),'afterUpdate':_0x8d68('0x4'),'afterDestroy':_0x8d68('0x5')};function emitEvent(_0x43ba4f){return function(_0x322db1,_0xa5ffc4,_0x4fa417){VoiceExtensionEvents[_0x8d68('0x6')](_0x43ba4f+':'+_0x322db1['id'],_0x322db1);VoiceExtensionEvents[_0x8d68('0x6')](_0x43ba4f,_0x322db1);_0x4fa417(null);};}for(var e in events){if(events[_0x8d68('0x7')](e)){var event=events[e];VoiceExtension[_0x8d68('0x8')](e,emitEvent(event));}}module[_0x8d68('0x9')]=VoiceExtensionEvents;