Built motion from commit 10af8726.|2.6.34
[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 _0xf769=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners'];(function(_0x242602,_0x57f8a6){var _0x3588ac=function(_0x8c8707){while(--_0x8c8707){_0x242602['push'](_0x242602['shift']());}};_0x3588ac(++_0x57f8a6);}(_0xf769,0x88));var _0x9f76=function(_0x421725,_0x318a04){_0x421725=_0x421725-0x0;var _0x51b322=_0xf769[_0x421725];return _0x51b322;};'use strict';var EventEmitter=require(_0x9f76('0x0'));var VoiceExtension=require(_0x9f76('0x1'))['db'][_0x9f76('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x9f76('0x3')](0x0);var events={'afterCreate':_0x9f76('0x4'),'afterUpdate':'update','afterDestroy':_0x9f76('0x5')};function emitEvent(_0x3bfb5a){return function(_0x325d27,_0x18da2d,_0x4df2fb){VoiceExtensionEvents[_0x9f76('0x6')](_0x3bfb5a+':'+_0x325d27['id'],_0x325d27);VoiceExtensionEvents[_0x9f76('0x6')](_0x3bfb5a,_0x325d27);_0x4df2fb(null);};}for(var e in events){if(events[_0x9f76('0x7')](e)){var event=events[e];VoiceExtension[_0x9f76('0x8')](e,emitEvent(event));}}module[_0x9f76('0x9')]=VoiceExtensionEvents;