Built motion from commit 1cfc41f6.|2.5.41
[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 _0x9b57=['string','uniqueid','idContact','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0x9b57,0x14c));var _0x79b5=function(_0x279046,_0x4b86a5){_0x279046=_0x279046-0x0;var _0x5d1182=_0x9b57[_0x279046];return _0x5d1182;};'use strict';var util=require(_0x79b5('0x0'));var _=require(_0x79b5('0x1'));var moment=require(_0x79b5('0x2'));function checkNameSurname(_0x4f6a5f,_0xebe560,_0x302840){var _0x114f0e='';if(!_[_0x79b5('0x3')](_0xebe560)&&_0x79b5('0x4')===typeof _0xebe560){_0x114f0e+=_0xebe560;}if(!_[_0x79b5('0x3')](_0x302840)&&_0x79b5('0x4')===typeof _0x302840){_0x114f0e+='\x20'+_0x302840;}if(_0x114f0e!==''){return _0x114f0e;}return _0x4f6a5f;}function Action(_0x270144,_0x4c5fd1,_0x1fb454,_0x6983a7,_0xe486f4){this[_0x79b5('0x5')]=_0x1fb454||undefined;this[_0x79b5('0x6')]=_0x270144['id'];this['queue']=_0x4c5fd1['name'];this[_0x79b5('0x7')]=_0x4c5fd1[_0x79b5('0x7')];this[_0x79b5('0x8')]='queue';this[_0x79b5('0x9')]=![];this[_0x79b5('0xa')]=_['isNil'](_0x270144[_0x79b5('0xb')])?undefined:_0x270144[_0x79b5('0xb')]['name'];this[_0x79b5('0xc')]=this[_0x79b5('0xa')]?util[_0x79b5('0xd')](_0x79b5('0xe'),this['membername']):_0x6983a7||undefined;this[_0x79b5('0xf')]=checkNameSurname(_0x270144[_0x79b5('0x10')][_0x79b5('0x11')],_0x270144[_0x79b5('0x10')]['firstName'],_0x270144[_0x79b5('0x10')][_0x79b5('0x12')]);this[_0x79b5('0x13')]=_0x270144['active']||![];this[_0x79b5('0x14')]=_0x270144[_0x79b5('0x10')]['phone'];this[_0x79b5('0x15')]=_0x270144['scheduledat'];this['countbusyretry']=_0x270144[_0x79b5('0x16')]||0x0;this[_0x79b5('0x17')]=_0x270144['countcongestionretry']||0x0;this[_0x79b5('0x18')]=_0x270144[_0x79b5('0x18')]||0x0;this['countglobal']=(_0x270144[_0x79b5('0x16')]||0x0)+(_0x270144[_0x79b5('0x17')]||0x0)+(_0x270144[_0x79b5('0x18')]||0x0)+(_0x270144[_0x79b5('0x19')]||0x0)+(_0x270144['countdropretry']||0x0)+(_0x270144['countabandonedretry']||0x0)+(_0x270144[_0x79b5('0x1a')]||0x0)+(_0x270144[_0x79b5('0x1b')]||0x0);this[_0x79b5('0x19')]=_0x270144[_0x79b5('0x19')]||0x0;this['countdropretry']=_0x270144['countdropretry']||0x0;this[_0x79b5('0x1c')]=_0x270144[_0x79b5('0x1c')]||0x0;this[_0x79b5('0x1a')]=_0x270144[_0x79b5('0x1a')]||0x0;this[_0x79b5('0x1b')]=_0x270144[_0x79b5('0x1b')]||0x0;this[_0x79b5('0x1d')]=_0x270144['callback'];this[_0x79b5('0x1e')]=_0x270144[_0x79b5('0x1e')];this[_0x79b5('0x1f')]=_0x270144['callbackat'];this[_0x79b5('0x20')]=_0x270144[_0x79b5('0x20')];this[_0x79b5('0x21')]=_0x270144['ContactId'];this[_0x79b5('0x22')]=_0x270144[_0x79b5('0x22')];this[_0x79b5('0x23')]=_[_0x79b5('0x3')](_0x270144[_0x79b5('0xb')])?_0x270144[_0x79b5('0x23')]:_0x270144[_0x79b5('0xb')]['id'];this[_0x79b5('0x24')]=_0x270144['VoiceQueueId'];this['originatecalleridnum']='';this[_0x79b5('0x25')]='';}Action['prototype'][_0x79b5('0x26')]=function(){return util[_0x79b5('0xd')](_0x79b5('0x27'),this[_0x79b5('0xf')],this[_0x79b5('0x28')]);};module[_0x79b5('0x29')]=Action;