568b3d628710b5b4a796e4b640637506a141269b
[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 _0x57ca=['name','type','campaigntype','dialAnswer','Agent','membername','format','SIP/%s','calleridname','phone','firstName','Contact','lastName','active','calleridnum','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','lodash','moment','isNil','string','uniqueid','idContact'];(function(_0x49d23f,_0x5ad2b1){var _0xf3b3d2=function(_0x2320cd){while(--_0x2320cd){_0x49d23f['push'](_0x49d23f['shift']());}};_0xf3b3d2(++_0x5ad2b1);}(_0x57ca,0x108));var _0xa57c=function(_0x6497,_0x5acf8a){_0x6497=_0x6497-0x0;var _0x4397b8=_0x57ca[_0x6497];return _0x4397b8;};'use strict';var util=require('util');var _=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));function checkNameSurname(_0x4b1712,_0x3a7394,_0x396613){var _0x1d38e7='';if(!_[_0xa57c('0x2')](_0x3a7394)&&_0xa57c('0x3')===typeof _0x3a7394){_0x1d38e7+=_0x3a7394;}if(!_['isNil'](_0x396613)&&_0xa57c('0x3')===typeof _0x396613){_0x1d38e7+='\x20'+_0x396613;}if(_0x1d38e7!==''){return _0x1d38e7;}return _0x4b1712;}function Action(_0x1c3e31,_0x113dcf,_0x19473f,_0xbdfffb,_0x314574){this[_0xa57c('0x4')]=_0x19473f||undefined;this[_0xa57c('0x5')]=_0x1c3e31['id'];this['queue']=_0x113dcf[_0xa57c('0x6')];this['type']=_0x113dcf[_0xa57c('0x7')];this[_0xa57c('0x8')]='queue';this[_0xa57c('0x9')]=![];this['membername']=_[_0xa57c('0x2')](_0x1c3e31[_0xa57c('0xa')])?undefined:_0x1c3e31['Agent'][_0xa57c('0x6')];this['channelAgent']=this[_0xa57c('0xb')]?util[_0xa57c('0xc')](_0xa57c('0xd'),this[_0xa57c('0xb')]):_0xbdfffb||undefined;this[_0xa57c('0xe')]=checkNameSurname(_0x1c3e31['Contact'][_0xa57c('0xf')],_0x1c3e31['Contact'][_0xa57c('0x10')],_0x1c3e31[_0xa57c('0x11')][_0xa57c('0x12')]);this[_0xa57c('0x13')]=_0x1c3e31[_0xa57c('0x13')]||![];this[_0xa57c('0x14')]=_0x1c3e31[_0xa57c('0xf')];this['scheduledat']=_0x1c3e31[_0xa57c('0x15')];this[_0xa57c('0x16')]=_0x1c3e31[_0xa57c('0x16')]||0x0;this['countcongestionretry']=_0x1c3e31[_0xa57c('0x17')]||0x0;this['countnoanswerretry']=_0x1c3e31[_0xa57c('0x18')]||0x0;this[_0xa57c('0x19')]=(_0x1c3e31[_0xa57c('0x16')]||0x0)+(_0x1c3e31[_0xa57c('0x17')]||0x0)+(_0x1c3e31[_0xa57c('0x18')]||0x0)+(_0x1c3e31[_0xa57c('0x1a')]||0x0)+(_0x1c3e31[_0xa57c('0x1b')]||0x0)+(_0x1c3e31[_0xa57c('0x1c')]||0x0)+(_0x1c3e31['countmachineretry']||0x0)+(_0x1c3e31[_0xa57c('0x1d')]||0x0);this['countnosuchnumberretry']=_0x1c3e31['countnosuchnumberretry']||0x0;this[_0xa57c('0x1b')]=_0x1c3e31[_0xa57c('0x1b')]||0x0;this[_0xa57c('0x1c')]=_0x1c3e31[_0xa57c('0x1c')]||0x0;this['countmachineretry']=_0x1c3e31[_0xa57c('0x1e')]||0x0;this[_0xa57c('0x1d')]=_0x1c3e31[_0xa57c('0x1d')]||0x0;this[_0xa57c('0x1f')]=_0x1c3e31[_0xa57c('0x1f')];this[_0xa57c('0x20')]=_0x1c3e31[_0xa57c('0x20')];this[_0xa57c('0x21')]=_0x1c3e31[_0xa57c('0x21')];this[_0xa57c('0x22')]=_0x1c3e31[_0xa57c('0x22')];this[_0xa57c('0x23')]=_0x1c3e31[_0xa57c('0x23')];this[_0xa57c('0x24')]=_0x1c3e31[_0xa57c('0x24')];this['UserId']=_[_0xa57c('0x2')](_0x1c3e31[_0xa57c('0xa')])?_0x1c3e31[_0xa57c('0x25')]:_0x1c3e31[_0xa57c('0xa')]['id'];this[_0xa57c('0x26')]=_0x1c3e31[_0xa57c('0x26')];this[_0xa57c('0x27')]='';this[_0xa57c('0x28')]='';}Action[_0xa57c('0x29')][_0xa57c('0x2a')]=function(){return util['format'](_0xa57c('0x2b'),this['calleridname'],this['number']);};module[_0xa57c('0x2c')]=Action;