Built motion from commit (unavailable).|2.5.4
[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 _0x6ad1=['queue','type','campaigntype','channelAgent','membername','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','Agent','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','exports','util','isNil','string','uniqueid','idContact'];(function(_0x383356,_0x33d2f5){var _0x32ee5a=function(_0x2741db){while(--_0x2741db){_0x383356['push'](_0x383356['shift']());}};_0x32ee5a(++_0x33d2f5);}(_0x6ad1,0x1f3));var _0x16ad=function(_0x39628b,_0x2784f7){_0x39628b=_0x39628b-0x0;var _0x8a62d6=_0x6ad1[_0x39628b];return _0x8a62d6;};'use strict';var util=require(_0x16ad('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x5ad8ba,_0x44343a,_0x9157dc){var _0x2534a4='';if(!_[_0x16ad('0x1')](_0x44343a)&&_0x16ad('0x2')===typeof _0x44343a){_0x2534a4+=_0x44343a;}if(!_[_0x16ad('0x1')](_0x9157dc)&&_0x16ad('0x2')===typeof _0x9157dc){_0x2534a4+='\x20'+_0x9157dc;}if(_0x2534a4!==''){return _0x2534a4;}return _0x5ad8ba;}function Action(_0x3d62c8,_0x54e3f7,_0x362272,_0x229710,_0x108136){this[_0x16ad('0x3')]=_0x362272||undefined;this[_0x16ad('0x4')]=_0x3d62c8['id'];this[_0x16ad('0x5')]=_0x54e3f7['name'];this[_0x16ad('0x6')]=_0x54e3f7['type'];this[_0x16ad('0x7')]=_0x16ad('0x5');this['dialAnswer']=![];this['membername']=_['isNil'](_0x3d62c8['Agent'])?undefined:_0x3d62c8['Agent']['name'];this[_0x16ad('0x8')]=this[_0x16ad('0x9')]?util[_0x16ad('0xa')](_0x16ad('0xb'),this[_0x16ad('0x9')]):_0x229710||undefined;this[_0x16ad('0xc')]=checkNameSurname(_0x3d62c8[_0x16ad('0xd')][_0x16ad('0xe')],_0x3d62c8[_0x16ad('0xd')][_0x16ad('0xf')],_0x3d62c8[_0x16ad('0xd')][_0x16ad('0x10')]);this[_0x16ad('0x11')]=_0x3d62c8['active']||![];this[_0x16ad('0x12')]=_0x3d62c8['Contact'][_0x16ad('0xe')];this[_0x16ad('0x13')]=_0x3d62c8['scheduledat'];this[_0x16ad('0x14')]=_0x3d62c8[_0x16ad('0x14')]||0x0;this[_0x16ad('0x15')]=_0x3d62c8[_0x16ad('0x15')]||0x0;this[_0x16ad('0x16')]=_0x3d62c8[_0x16ad('0x16')]||0x0;this['countglobal']=(_0x3d62c8[_0x16ad('0x14')]||0x0)+(_0x3d62c8[_0x16ad('0x15')]||0x0)+(_0x3d62c8['countnoanswerretry']||0x0)+(_0x3d62c8[_0x16ad('0x17')]||0x0)+(_0x3d62c8[_0x16ad('0x18')]||0x0)+(_0x3d62c8[_0x16ad('0x19')]||0x0)+(_0x3d62c8[_0x16ad('0x1a')]||0x0)+(_0x3d62c8[_0x16ad('0x1b')]||0x0);this[_0x16ad('0x17')]=_0x3d62c8[_0x16ad('0x17')]||0x0;this['countdropretry']=_0x3d62c8[_0x16ad('0x18')]||0x0;this[_0x16ad('0x19')]=_0x3d62c8[_0x16ad('0x19')]||0x0;this[_0x16ad('0x1a')]=_0x3d62c8[_0x16ad('0x1a')]||0x0;this['countagentrejectretry']=_0x3d62c8[_0x16ad('0x1b')]||0x0;this['callback']=_0x3d62c8[_0x16ad('0x1c')];this[_0x16ad('0x1d')]=_0x3d62c8['callbackuniqueid'];this[_0x16ad('0x1e')]=_0x3d62c8[_0x16ad('0x1e')];this['recallme']=_0x3d62c8[_0x16ad('0x1f')];this[_0x16ad('0x20')]=_0x3d62c8[_0x16ad('0x20')];this[_0x16ad('0x21')]=_0x3d62c8[_0x16ad('0x21')];this[_0x16ad('0x22')]=_['isNil'](_0x3d62c8[_0x16ad('0x23')])?_0x3d62c8[_0x16ad('0x22')]:_0x3d62c8[_0x16ad('0x23')]['id'];this['VoiceQueueId']=_0x3d62c8['VoiceQueueId'];this[_0x16ad('0x24')]='';this[_0x16ad('0x25')]='';}Action[_0x16ad('0x26')][_0x16ad('0x27')]=function(){return util[_0x16ad('0xa')](_0x16ad('0x28'),this[_0x16ad('0xc')],this['number']);};module[_0x16ad('0x29')]=Action;