Built motion from commit (unavailable).|2.4.18
[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 _0x0056=['hook','exports','VoiceExtension','setMaxListeners','update','remove','emit'];(function(_0x440723,_0x411fec){var _0xb3cc53=function(_0xe41e8e){while(--_0xe41e8e){_0x440723['push'](_0x440723['shift']());}};_0xb3cc53(++_0x411fec);}(_0x0056,0xdb));var _0x6005=function(_0x3acee8,_0x5f3924){_0x3acee8=_0x3acee8-0x0;var _0x5046cc=_0x0056[_0x3acee8];return _0x5046cc;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0x6005('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x6005('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6005('0x2'),'afterDestroy':_0x6005('0x3')};function emitEvent(_0x184e38){return function(_0x3e090,_0x56209f,_0x4fe505){VoiceExtensionEvents['emit'](_0x184e38+':'+_0x3e090['id'],_0x3e090);VoiceExtensionEvents[_0x6005('0x4')](_0x184e38,_0x3e090);_0x4fe505(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x6005('0x5')](e,emitEvent(event));}}module[_0x6005('0x6')]=VoiceExtensionEvents;