Built motion from commit d5e4af8c.|2.6.23
[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 _0x5f2f=['phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','exports','util','lodash','moment','isNil','string','idContact','queue','name','type','campaigntype','membername','Agent','format','SIP/%s','calleridname','Contact','firstName','lastName','active','calleridnum'];(function(_0x433e98,_0x1450d0){var _0xc5c7cb=function(_0x57701c){while(--_0x57701c){_0x433e98['push'](_0x433e98['shift']());}};_0xc5c7cb(++_0x1450d0);}(_0x5f2f,0x73));var _0xf5f2=function(_0x11eb9e,_0x29ac97){_0x11eb9e=_0x11eb9e-0x0;var _0x220d91=_0x5f2f[_0x11eb9e];return _0x220d91;};'use strict';var util=require(_0xf5f2('0x0'));var _=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));function checkNameSurname(_0x1a7be1,_0x1172dd,_0x174bc7){var _0x3c72ee='';if(!_[_0xf5f2('0x3')](_0x1172dd)&&'string'===typeof _0x1172dd){_0x3c72ee+=_0x1172dd;}if(!_['isNil'](_0x174bc7)&&_0xf5f2('0x4')===typeof _0x174bc7){_0x3c72ee+='\x20'+_0x174bc7;}if(_0x3c72ee!==''){return _0x3c72ee;}return _0x1a7be1;}function Action(_0x192215,_0xad7f65,_0x3eebf6,_0x3133bc,_0x473100){this['uniqueid']=_0x3eebf6||undefined;this[_0xf5f2('0x5')]=_0x192215['id'];this[_0xf5f2('0x6')]=_0xad7f65[_0xf5f2('0x7')];this['type']=_0xad7f65[_0xf5f2('0x8')];this[_0xf5f2('0x9')]=_0xf5f2('0x6');this['dialAnswer']=![];this[_0xf5f2('0xa')]=_['isNil'](_0x192215['Agent'])?undefined:_0x192215[_0xf5f2('0xb')][_0xf5f2('0x7')];this['channelAgent']=this[_0xf5f2('0xa')]?util[_0xf5f2('0xc')](_0xf5f2('0xd'),this[_0xf5f2('0xa')]):_0x3133bc||undefined;this[_0xf5f2('0xe')]=checkNameSurname(_0x192215[_0xf5f2('0xf')]['phone'],_0x192215[_0xf5f2('0xf')][_0xf5f2('0x10')],_0x192215[_0xf5f2('0xf')][_0xf5f2('0x11')]);this[_0xf5f2('0x12')]=_0x192215['active']||![];this[_0xf5f2('0x13')]=_0x192215[_0xf5f2('0x14')];this[_0xf5f2('0x15')]=_0x192215[_0xf5f2('0x15')];this[_0xf5f2('0x16')]=_0x192215[_0xf5f2('0x16')]||0x0;this[_0xf5f2('0x17')]=_0x192215[_0xf5f2('0x17')]||0x0;this[_0xf5f2('0x18')]=_0x192215[_0xf5f2('0x18')]||0x0;this[_0xf5f2('0x19')]=(_0x192215[_0xf5f2('0x16')]||0x0)+(_0x192215[_0xf5f2('0x17')]||0x0)+(_0x192215[_0xf5f2('0x18')]||0x0)+(_0x192215[_0xf5f2('0x1a')]||0x0)+(_0x192215[_0xf5f2('0x1b')]||0x0)+(_0x192215[_0xf5f2('0x1c')]||0x0)+(_0x192215['countmachineretry']||0x0)+(_0x192215[_0xf5f2('0x1d')]||0x0);this[_0xf5f2('0x1a')]=_0x192215['countnosuchnumberretry']||0x0;this['countdropretry']=_0x192215[_0xf5f2('0x1b')]||0x0;this[_0xf5f2('0x1c')]=_0x192215['countabandonedretry']||0x0;this[_0xf5f2('0x1e')]=_0x192215[_0xf5f2('0x1e')]||0x0;this[_0xf5f2('0x1d')]=_0x192215[_0xf5f2('0x1d')]||0x0;this[_0xf5f2('0x1f')]=_0x192215['callback'];this[_0xf5f2('0x20')]=_0x192215[_0xf5f2('0x20')];this[_0xf5f2('0x21')]=_0x192215[_0xf5f2('0x21')];this[_0xf5f2('0x22')]=_0x192215['recallme'];this['ContactId']=_0x192215[_0xf5f2('0x23')];this[_0xf5f2('0x24')]=_0x192215[_0xf5f2('0x24')];this[_0xf5f2('0x25')]=_[_0xf5f2('0x3')](_0x192215[_0xf5f2('0xb')])?_0x192215[_0xf5f2('0x25')]:_0x192215[_0xf5f2('0xb')]['id'];this[_0xf5f2('0x26')]=_0x192215['VoiceQueueId'];this[_0xf5f2('0x27')]='';this[_0xf5f2('0x28')]='';}Action[_0xf5f2('0x29')][_0xf5f2('0x2a')]=function(){return util[_0xf5f2('0xc')](_0xf5f2('0x2b'),this['calleridname'],this['number']);};module[_0xf5f2('0x2c')]=Action;