Built motion from commit fd055180.|2.6.30
[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 _0x47c5=['originatecalleridnum','prototype','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','format','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x5c2cfc,_0x225457){var _0x39ef01=function(_0x2b507b){while(--_0x2b507b){_0x5c2cfc['push'](_0x5c2cfc['shift']());}};_0x39ef01(++_0x225457);}(_0x47c5,0x165));var _0x547c=function(_0x99facc,_0x548cd6){_0x99facc=_0x99facc-0x0;var _0xd39ed0=_0x47c5[_0x99facc];return _0xd39ed0;};'use strict';var util=require(_0x547c('0x0'));var _=require(_0x547c('0x1'));var moment=require(_0x547c('0x2'));function checkNameSurname(_0x123697,_0x5fe74c,_0x3260c8){var _0x500b86='';if(!_[_0x547c('0x3')](_0x5fe74c)&&_0x547c('0x4')===typeof _0x5fe74c){_0x500b86+=_0x5fe74c;}if(!_['isNil'](_0x3260c8)&&_0x547c('0x4')===typeof _0x3260c8){_0x500b86+='\x20'+_0x3260c8;}if(_0x500b86!==''){return _0x500b86;}return _0x123697;}function Action(_0x468220,_0x51ab7f,_0x2e5b57,_0x439f25,_0x381f2e){this[_0x547c('0x5')]=_0x2e5b57||undefined;this[_0x547c('0x6')]=_0x468220['id'];this[_0x547c('0x7')]=_0x51ab7f[_0x547c('0x8')];this[_0x547c('0x9')]=_0x51ab7f[_0x547c('0x9')];this[_0x547c('0xa')]=_0x547c('0x7');this[_0x547c('0xb')]=![];this[_0x547c('0xc')]=_[_0x547c('0x3')](_0x468220[_0x547c('0xd')])?undefined:_0x468220[_0x547c('0xd')][_0x547c('0x8')];this['channelAgent']=this[_0x547c('0xc')]?util[_0x547c('0xe')]('SIP/%s',this[_0x547c('0xc')]):_0x439f25||undefined;this[_0x547c('0xf')]=checkNameSurname(_0x468220[_0x547c('0x10')][_0x547c('0x11')],_0x468220[_0x547c('0x10')][_0x547c('0x12')],_0x468220[_0x547c('0x10')][_0x547c('0x13')]);this[_0x547c('0x14')]=_0x468220[_0x547c('0x14')]||![];this[_0x547c('0x15')]=_0x468220[_0x547c('0x11')];this[_0x547c('0x16')]=_0x468220[_0x547c('0x16')];this[_0x547c('0x17')]=_0x468220[_0x547c('0x17')]||0x0;this[_0x547c('0x18')]=_0x468220[_0x547c('0x18')]||0x0;this['countnoanswerretry']=_0x468220['countnoanswerretry']||0x0;this[_0x547c('0x19')]=(_0x468220[_0x547c('0x17')]||0x0)+(_0x468220[_0x547c('0x18')]||0x0)+(_0x468220['countnoanswerretry']||0x0)+(_0x468220[_0x547c('0x1a')]||0x0)+(_0x468220[_0x547c('0x1b')]||0x0)+(_0x468220[_0x547c('0x1c')]||0x0)+(_0x468220['countmachineretry']||0x0)+(_0x468220[_0x547c('0x1d')]||0x0);this[_0x547c('0x1a')]=_0x468220['countnosuchnumberretry']||0x0;this['countdropretry']=_0x468220[_0x547c('0x1b')]||0x0;this[_0x547c('0x1c')]=_0x468220['countabandonedretry']||0x0;this[_0x547c('0x1e')]=_0x468220[_0x547c('0x1e')]||0x0;this['countagentrejectretry']=_0x468220[_0x547c('0x1d')]||0x0;this[_0x547c('0x1f')]=_0x468220[_0x547c('0x1f')];this['callbackuniqueid']=_0x468220[_0x547c('0x20')];this[_0x547c('0x21')]=_0x468220[_0x547c('0x21')];this[_0x547c('0x22')]=_0x468220[_0x547c('0x22')];this[_0x547c('0x23')]=_0x468220[_0x547c('0x23')];this[_0x547c('0x24')]=_0x468220['ListId'];this[_0x547c('0x25')]=_['isNil'](_0x468220['Agent'])?_0x468220['UserId']:_0x468220['Agent']['id'];this[_0x547c('0x26')]=_0x468220['VoiceQueueId'];this[_0x547c('0x27')]='';this['originatecalleridname']='';}Action[_0x547c('0x28')]['getCaller']=function(){return util[_0x547c('0xe')](_0x547c('0x29'),this[_0x547c('0xf')],this[_0x547c('0x2a')]);};module[_0x547c('0x2b')]=Action;