Built motion from commit da24aabd.|2.6.20
[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 _0x77af=['setMaxListeners','save','remove','emit','hasOwnProperty','exports','VoiceExtension'];(function(_0x3df7c7,_0x15e60f){var _0x267105=function(_0x531785){while(--_0x531785){_0x3df7c7['push'](_0x3df7c7['shift']());}};_0x267105(++_0x15e60f);}(_0x77af,0x92));var _0xf77a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x77af[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0xf77a('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xf77a('0x1')](0x0);var events={'afterCreate':_0xf77a('0x2'),'afterUpdate':'update','afterDestroy':_0xf77a('0x3')};function emitEvent(_0x13e219){return function(_0xf479b2,_0x46859d,_0x45b2b6){VoiceExtensionEvents[_0xf77a('0x4')](_0x13e219+':'+_0xf479b2['id'],_0xf479b2);VoiceExtensionEvents[_0xf77a('0x4')](_0x13e219,_0xf479b2);_0x45b2b6(null);};}for(var e in events){if(events[_0xf77a('0x5')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xf77a('0x6')]=VoiceExtensionEvents;