2915c14e40ed74885e2f992ce0265d6fab830e08
[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 _0xb06e=['isNil','uniqueid','queue','name','type','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','firstName','active','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','string'];(function(_0x514f24,_0xe54e86){var _0x80634c=function(_0x785ee5){while(--_0x785ee5){_0x514f24['push'](_0x514f24['shift']());}};_0x80634c(++_0xe54e86);}(_0xb06e,0x1c0));var _0xeb06=function(_0x13c0f3,_0x33d4bf){_0x13c0f3=_0x13c0f3-0x0;var _0x1c2c33=_0xb06e[_0x13c0f3];return _0x1c2c33;};'use strict';var util=require(_0xeb06('0x0'));var _=require(_0xeb06('0x1'));var moment=require('moment');function checkNameSurname(_0x161d3d,_0x32d1c7,_0x5b237d){var _0x30061d='';if(!_['isNil'](_0x32d1c7)&&_0xeb06('0x2')===typeof _0x32d1c7){_0x30061d+=_0x32d1c7;}if(!_[_0xeb06('0x3')](_0x5b237d)&&_0xeb06('0x2')===typeof _0x5b237d){_0x30061d+='\x20'+_0x5b237d;}if(_0x30061d!==''){return _0x30061d;}return _0x161d3d;}function Action(_0x31a63e,_0x3a5403,_0x2c9598,_0x484f7e,_0x2d692c){this[_0xeb06('0x4')]=_0x2c9598||undefined;this['idContact']=_0x31a63e['id'];this[_0xeb06('0x5')]=_0x3a5403[_0xeb06('0x6')];this[_0xeb06('0x7')]=_0x3a5403[_0xeb06('0x7')];this['campaigntype']=_0xeb06('0x5');this[_0xeb06('0x8')]=![];this[_0xeb06('0x9')]=_['isNil'](_0x31a63e[_0xeb06('0xa')])?undefined:_0x31a63e[_0xeb06('0xa')][_0xeb06('0x6')];this[_0xeb06('0xb')]=this[_0xeb06('0x9')]?util[_0xeb06('0xc')](_0xeb06('0xd'),this[_0xeb06('0x9')]):_0x484f7e||undefined;this[_0xeb06('0xe')]=checkNameSurname(_0x31a63e[_0xeb06('0xf')]['phone'],_0x31a63e[_0xeb06('0xf')][_0xeb06('0x10')],_0x31a63e[_0xeb06('0xf')]['lastName']);this['active']=_0x31a63e[_0xeb06('0x11')]||![];this['calleridnum']=_0x31a63e[_0xeb06('0xf')][_0xeb06('0x12')];this[_0xeb06('0x13')]=_0x31a63e['scheduledat'];this[_0xeb06('0x14')]=_0x31a63e[_0xeb06('0x14')]||0x0;this['countcongestionretry']=_0x31a63e[_0xeb06('0x15')]||0x0;this['countnoanswerretry']=_0x31a63e[_0xeb06('0x16')]||0x0;this['countglobal']=(_0x31a63e[_0xeb06('0x14')]||0x0)+(_0x31a63e[_0xeb06('0x15')]||0x0)+(_0x31a63e['countnoanswerretry']||0x0)+(_0x31a63e[_0xeb06('0x17')]||0x0)+(_0x31a63e['countdropretry']||0x0)+(_0x31a63e[_0xeb06('0x18')]||0x0)+(_0x31a63e['countmachineretry']||0x0)+(_0x31a63e[_0xeb06('0x19')]||0x0);this[_0xeb06('0x17')]=_0x31a63e['countnosuchnumberretry']||0x0;this['countdropretry']=_0x31a63e[_0xeb06('0x1a')]||0x0;this[_0xeb06('0x18')]=_0x31a63e[_0xeb06('0x18')]||0x0;this[_0xeb06('0x1b')]=_0x31a63e['countmachineretry']||0x0;this[_0xeb06('0x19')]=_0x31a63e[_0xeb06('0x19')]||0x0;this[_0xeb06('0x1c')]=_0x31a63e['callback'];this[_0xeb06('0x1d')]=_0x31a63e['callbackuniqueid'];this['callbackat']=_0x31a63e[_0xeb06('0x1e')];this[_0xeb06('0x1f')]=_0x31a63e[_0xeb06('0x1f')];this[_0xeb06('0x20')]=_0x31a63e['ContactId'];this[_0xeb06('0x21')]=_0x31a63e[_0xeb06('0x21')];this['UserId']=_[_0xeb06('0x3')](_0x31a63e[_0xeb06('0xa')])?_0x31a63e['UserId']:_0x31a63e[_0xeb06('0xa')]['id'];this[_0xeb06('0x22')]=_0x31a63e[_0xeb06('0x22')];this['originatecalleridnum']='';this[_0xeb06('0x23')]='';}Action[_0xeb06('0x24')][_0xeb06('0x25')]=function(){return util[_0xeb06('0xc')](_0xeb06('0x26'),this['calleridname'],this[_0xeb06('0x27')]);};module[_0xeb06('0x28')]=Action;