0e63987e2d9d027bf52a6a4e6505165075da14a3
[motion2.git] / server / services / ami / preview / action.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 _0x7140=['idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','format','SIP/%s','calleridname','phone','Contact','active','calleridnum','scheduledat','countbusyretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','exports','util','moment','isNil','string','uniqueid'];(function(_0x4446dc,_0x316e68){var _0x4fe0a9=function(_0xb9c0c){while(--_0xb9c0c){_0x4446dc['push'](_0x4446dc['shift']());}};_0x4fe0a9(++_0x316e68);}(_0x7140,0x128));var _0x0714=function(_0x28e2cd,_0x153b42){_0x28e2cd=_0x28e2cd-0x0;var _0x11fd46=_0x7140[_0x28e2cd];return _0x11fd46;};'use strict';var util=require(_0x0714('0x0'));var _=require('lodash');var moment=require(_0x0714('0x1'));function checkNameSurname(_0x27e611,_0x2ea0c5,_0x18431b){var _0x49384c='';if(!_[_0x0714('0x2')](_0x2ea0c5)&&_0x0714('0x3')===typeof _0x2ea0c5){_0x49384c+=_0x2ea0c5;}if(!_['isNil'](_0x18431b)&&_0x0714('0x3')===typeof _0x18431b){_0x49384c+='\x20'+_0x18431b;}if(_0x49384c!==''){return _0x49384c;}return _0x27e611;}function Action(_0x285cc4,_0x48e262,_0x2ec3ea,_0x166dbd,_0x367c7b){this[_0x0714('0x4')]=_0x2ec3ea||undefined;this[_0x0714('0x5')]=_0x285cc4['id'];this[_0x0714('0x6')]=_0x48e262[_0x0714('0x7')];this[_0x0714('0x8')]=_0x48e262[_0x0714('0x8')];this[_0x0714('0x9')]='queue';this[_0x0714('0xa')]=![];this[_0x0714('0xb')]=_[_0x0714('0x2')](_0x285cc4[_0x0714('0xc')])?undefined:_0x285cc4[_0x0714('0xc')][_0x0714('0x7')];this['channelAgent']=this['membername']?util[_0x0714('0xd')](_0x0714('0xe'),this[_0x0714('0xb')]):_0x166dbd||undefined;this[_0x0714('0xf')]=checkNameSurname(_0x285cc4['Contact'][_0x0714('0x10')],_0x285cc4[_0x0714('0x11')]['firstName'],_0x285cc4['Contact']['lastName']);this['active']=_0x285cc4[_0x0714('0x12')]||![];this[_0x0714('0x13')]=_0x285cc4[_0x0714('0x11')][_0x0714('0x10')];this['scheduledat']=_0x285cc4[_0x0714('0x14')];this[_0x0714('0x15')]=_0x285cc4['countbusyretry']||0x0;this['countcongestionretry']=_0x285cc4['countcongestionretry']||0x0;this[_0x0714('0x16')]=_0x285cc4[_0x0714('0x16')]||0x0;this[_0x0714('0x17')]=(_0x285cc4['countbusyretry']||0x0)+(_0x285cc4['countcongestionretry']||0x0)+(_0x285cc4[_0x0714('0x16')]||0x0)+(_0x285cc4[_0x0714('0x18')]||0x0)+(_0x285cc4[_0x0714('0x19')]||0x0)+(_0x285cc4[_0x0714('0x1a')]||0x0)+(_0x285cc4[_0x0714('0x1b')]||0x0)+(_0x285cc4[_0x0714('0x1c')]||0x0);this[_0x0714('0x18')]=_0x285cc4[_0x0714('0x18')]||0x0;this[_0x0714('0x19')]=_0x285cc4[_0x0714('0x19')]||0x0;this[_0x0714('0x1a')]=_0x285cc4[_0x0714('0x1a')]||0x0;this[_0x0714('0x1b')]=_0x285cc4[_0x0714('0x1b')]||0x0;this['countagentrejectretry']=_0x285cc4[_0x0714('0x1c')]||0x0;this[_0x0714('0x1d')]=_0x285cc4['callback'];this[_0x0714('0x1e')]=_0x285cc4[_0x0714('0x1e')];this['callbackat']=_0x285cc4[_0x0714('0x1f')];this[_0x0714('0x20')]=_0x285cc4[_0x0714('0x20')];this[_0x0714('0x21')]=_0x285cc4[_0x0714('0x21')];this[_0x0714('0x22')]=_0x285cc4['ListId'];this[_0x0714('0x23')]=_[_0x0714('0x2')](_0x285cc4[_0x0714('0xc')])?_0x285cc4['UserId']:_0x285cc4[_0x0714('0xc')]['id'];this[_0x0714('0x24')]=_0x285cc4['VoiceQueueId'];this[_0x0714('0x25')]='';this[_0x0714('0x26')]='';}Action[_0x0714('0x27')][_0x0714('0x28')]=function(){return util[_0x0714('0xd')](_0x0714('0x29'),this[_0x0714('0xf')],this['number']);};module[_0x0714('0x2a')]=Action;