158ba036ab4e6898a624151565ee53d1f4a0e985
[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 _0x1ff5=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','\x22%s\x22\x20<%s>','exports','util','lodash','moment','isNil','string','uniqueid','name','type','queue','membername','Agent','SIP/%s','calleridname','phone','firstName','Contact','lastName','active','scheduledat','countbusyretry','countnoanswerretry','countglobal','countcongestionretry'];(function(_0x29ac44,_0x3fc390){var _0x44e733=function(_0x8bedc5){while(--_0x8bedc5){_0x29ac44['push'](_0x29ac44['shift']());}};_0x44e733(++_0x3fc390);}(_0x1ff5,0x93));var _0x51ff=function(_0x3cbf16,_0x48f57d){_0x3cbf16=_0x3cbf16-0x0;var _0x27e32f=_0x1ff5[_0x3cbf16];return _0x27e32f;};'use strict';var util=require(_0x51ff('0x0'));var _=require(_0x51ff('0x1'));var moment=require(_0x51ff('0x2'));function checkNameSurname(_0x39a8b3,_0x3e2b66,_0x2e4675){var _0x5498ae='';if(!_[_0x51ff('0x3')](_0x3e2b66)&&_0x51ff('0x4')===typeof _0x3e2b66){_0x5498ae+=_0x3e2b66;}if(!_['isNil'](_0x2e4675)&&'string'===typeof _0x2e4675){_0x5498ae+='\x20'+_0x2e4675;}if(_0x5498ae!==''){return _0x5498ae;}return _0x39a8b3;}function Action(_0x187d21,_0x5dca74,_0x10f84f,_0x4922dc,_0x457f49){this[_0x51ff('0x5')]=_0x10f84f||undefined;this['idContact']=_0x187d21['id'];this['queue']=_0x5dca74[_0x51ff('0x6')];this['type']=_0x5dca74[_0x51ff('0x7')];this['campaigntype']=_0x51ff('0x8');this['dialAnswer']=![];this[_0x51ff('0x9')]=_[_0x51ff('0x3')](_0x187d21[_0x51ff('0xa')])?undefined:_0x187d21[_0x51ff('0xa')]['name'];this['channelAgent']=this[_0x51ff('0x9')]?util['format'](_0x51ff('0xb'),this[_0x51ff('0x9')]):_0x4922dc||undefined;this[_0x51ff('0xc')]=checkNameSurname(_0x187d21['Contact'][_0x51ff('0xd')],_0x187d21['Contact'][_0x51ff('0xe')],_0x187d21[_0x51ff('0xf')][_0x51ff('0x10')]);this[_0x51ff('0x11')]=_0x187d21['active']||![];this['calleridnum']=_0x187d21['Contact'][_0x51ff('0xd')];this[_0x51ff('0x12')]=_0x187d21['scheduledat'];this[_0x51ff('0x13')]=_0x187d21[_0x51ff('0x13')]||0x0;this['countcongestionretry']=_0x187d21['countcongestionretry']||0x0;this[_0x51ff('0x14')]=_0x187d21['countnoanswerretry']||0x0;this[_0x51ff('0x15')]=(_0x187d21['countbusyretry']||0x0)+(_0x187d21[_0x51ff('0x16')]||0x0)+(_0x187d21['countnoanswerretry']||0x0);this[_0x51ff('0x17')]=_0x187d21['callback'];this[_0x51ff('0x18')]=_0x187d21[_0x51ff('0x18')];this['callbackat']=_0x187d21[_0x51ff('0x19')];this[_0x51ff('0x1a')]=_0x187d21[_0x51ff('0x1a')];this['ContactId']=_0x187d21[_0x51ff('0x1b')];this[_0x51ff('0x1c')]=_0x187d21[_0x51ff('0x1c')];this['UserId']=_[_0x51ff('0x3')](_0x187d21[_0x51ff('0xa')])?_0x187d21[_0x51ff('0x1d')]:_0x187d21['Agent']['id'];this[_0x51ff('0x1e')]=_0x187d21[_0x51ff('0x1e')];this[_0x51ff('0x1f')]='';this['originatecalleridname']='';}Action['prototype']['getCaller']=function(){return util['format'](_0x51ff('0x20'),this['calleridname'],this['number']);};module[_0x51ff('0x21')]=Action;