Built motion from commit 00bf23f6.|2.6.16
[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 _0x60d0=['hook','exports','events','VoiceExtension','update','remove','emit','hasOwnProperty'];(function(_0x23c811,_0x259bfc){var _0x2d2eda=function(_0x2ef492){while(--_0x2ef492){_0x23c811['push'](_0x23c811['shift']());}};_0x2d2eda(++_0x259bfc);}(_0x60d0,0xc2));var _0x060d=function(_0x470218,_0x50613e){_0x470218=_0x470218-0x0;var _0x31883c=_0x60d0[_0x470218];return _0x31883c;};'use strict';var EventEmitter=require(_0x060d('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x060d('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x060d('0x2'),'afterDestroy':_0x060d('0x3')};function emitEvent(_0x577547){return function(_0x2e5509,_0x8430e3,_0x555d5a){VoiceExtensionEvents[_0x060d('0x4')](_0x577547+':'+_0x2e5509['id'],_0x2e5509);VoiceExtensionEvents[_0x060d('0x4')](_0x577547,_0x2e5509);_0x555d5a(null);};}for(var e in events){if(events[_0x060d('0x5')](e)){var event=events[e];VoiceExtension[_0x060d('0x6')](e,emitEvent(event));}}module[_0x060d('0x7')]=VoiceExtensionEvents;