Built motion from commit (unavailable).|2.5.4
[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 _0xa652=['lodash','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','name','format','SIP/%s','calleridname','phone','Contact','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','number','exports','util'];(function(_0x56cf02,_0x5311e1){var _0x41a008=function(_0x9fbc7c){while(--_0x9fbc7c){_0x56cf02['push'](_0x56cf02['shift']());}};_0x41a008(++_0x5311e1);}(_0xa652,0x179));var _0x2a65=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa652[_0x5b561d];return _0x431060;};'use strict';var util=require(_0x2a65('0x0'));var _=require(_0x2a65('0x1'));var moment=require(_0x2a65('0x2'));function checkNameSurname(_0x49c027,_0x21aae9,_0xc02076){var _0x4a5f5e='';if(!_[_0x2a65('0x3')](_0x21aae9)&&_0x2a65('0x4')===typeof _0x21aae9){_0x4a5f5e+=_0x21aae9;}if(!_['isNil'](_0xc02076)&&'string'===typeof _0xc02076){_0x4a5f5e+='\x20'+_0xc02076;}if(_0x4a5f5e!==''){return _0x4a5f5e;}return _0x49c027;}function Action(_0x2c5a9f,_0x215549,_0x1d204d,_0x4abf7e,_0x1119fb){this[_0x2a65('0x5')]=_0x1d204d||undefined;this[_0x2a65('0x6')]=_0x2c5a9f['id'];this[_0x2a65('0x7')]=_0x215549['name'];this[_0x2a65('0x8')]=_0x215549[_0x2a65('0x8')];this[_0x2a65('0x9')]=_0x2a65('0x7');this[_0x2a65('0xa')]=![];this[_0x2a65('0xb')]=_['isNil'](_0x2c5a9f[_0x2a65('0xc')])?undefined:_0x2c5a9f[_0x2a65('0xc')][_0x2a65('0xd')];this['channelAgent']=this[_0x2a65('0xb')]?util[_0x2a65('0xe')](_0x2a65('0xf'),this['membername']):_0x4abf7e||undefined;this[_0x2a65('0x10')]=checkNameSurname(_0x2c5a9f['Contact'][_0x2a65('0x11')],_0x2c5a9f[_0x2a65('0x12')]['firstName'],_0x2c5a9f[_0x2a65('0x12')]['lastName']);this[_0x2a65('0x13')]=_0x2c5a9f[_0x2a65('0x13')]||![];this[_0x2a65('0x14')]=_0x2c5a9f[_0x2a65('0x12')][_0x2a65('0x11')];this[_0x2a65('0x15')]=_0x2c5a9f[_0x2a65('0x15')];this['countbusyretry']=_0x2c5a9f[_0x2a65('0x16')]||0x0;this[_0x2a65('0x17')]=_0x2c5a9f[_0x2a65('0x17')]||0x0;this[_0x2a65('0x18')]=_0x2c5a9f[_0x2a65('0x18')]||0x0;this['countglobal']=(_0x2c5a9f['countbusyretry']||0x0)+(_0x2c5a9f[_0x2a65('0x17')]||0x0)+(_0x2c5a9f[_0x2a65('0x18')]||0x0)+(_0x2c5a9f['countnosuchnumberretry']||0x0)+(_0x2c5a9f['countdropretry']||0x0)+(_0x2c5a9f[_0x2a65('0x19')]||0x0)+(_0x2c5a9f['countmachineretry']||0x0)+(_0x2c5a9f[_0x2a65('0x1a')]||0x0);this['countnosuchnumberretry']=_0x2c5a9f[_0x2a65('0x1b')]||0x0;this['countdropretry']=_0x2c5a9f['countdropretry']||0x0;this[_0x2a65('0x19')]=_0x2c5a9f[_0x2a65('0x19')]||0x0;this[_0x2a65('0x1c')]=_0x2c5a9f[_0x2a65('0x1c')]||0x0;this[_0x2a65('0x1a')]=_0x2c5a9f['countagentrejectretry']||0x0;this[_0x2a65('0x1d')]=_0x2c5a9f[_0x2a65('0x1d')];this['callbackuniqueid']=_0x2c5a9f['callbackuniqueid'];this[_0x2a65('0x1e')]=_0x2c5a9f['callbackat'];this[_0x2a65('0x1f')]=_0x2c5a9f[_0x2a65('0x1f')];this[_0x2a65('0x20')]=_0x2c5a9f[_0x2a65('0x20')];this[_0x2a65('0x21')]=_0x2c5a9f[_0x2a65('0x21')];this[_0x2a65('0x22')]=_[_0x2a65('0x3')](_0x2c5a9f[_0x2a65('0xc')])?_0x2c5a9f[_0x2a65('0x22')]:_0x2c5a9f['Agent']['id'];this[_0x2a65('0x23')]=_0x2c5a9f[_0x2a65('0x23')];this[_0x2a65('0x24')]='';this[_0x2a65('0x25')]='';}Action[_0x2a65('0x26')][_0x2a65('0x27')]=function(){return util[_0x2a65('0xe')]('\x22%s\x22\x20<%s>',this[_0x2a65('0x10')],this[_0x2a65('0x28')]);};module[_0x2a65('0x29')]=Action;