eb44a7b8fb690a83959007a56a12a17963d6f92b
[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 _0x1893=['type','queue','dialAnswer','membername','Agent','channelAgent','format','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','getCaller','\x22%s\x22\x20<%s>','number','exports','moment','isNil','string','uniqueid','idContact','name'];(function(_0x52f611,_0x49a6a0){var _0x4d9bc4=function(_0x5957c6){while(--_0x5957c6){_0x52f611['push'](_0x52f611['shift']());}};_0x4d9bc4(++_0x49a6a0);}(_0x1893,0xa2));var _0x3189=function(_0x41e3e5,_0x441240){_0x41e3e5=_0x41e3e5-0x0;var _0x4b5b5c=_0x1893[_0x41e3e5];return _0x4b5b5c;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x3189('0x0'));function checkNameSurname(_0x3aec2b,_0x1b12ad,_0x106df4){var _0x10c189='';if(!_[_0x3189('0x1')](_0x1b12ad)&&_0x3189('0x2')===typeof _0x1b12ad){_0x10c189+=_0x1b12ad;}if(!_['isNil'](_0x106df4)&&_0x3189('0x2')===typeof _0x106df4){_0x10c189+='\x20'+_0x106df4;}if(_0x10c189!==''){return _0x10c189;}return _0x3aec2b;}function Action(_0x4faebf,_0x2333e6,_0x4080a9,_0x77c566,_0x118970){this[_0x3189('0x3')]=_0x4080a9||undefined;this[_0x3189('0x4')]=_0x4faebf['id'];this['queue']=_0x2333e6[_0x3189('0x5')];this['type']=_0x2333e6[_0x3189('0x6')];this['campaigntype']=_0x3189('0x7');this[_0x3189('0x8')]=![];this[_0x3189('0x9')]=_[_0x3189('0x1')](_0x4faebf['Agent'])?undefined:_0x4faebf[_0x3189('0xa')][_0x3189('0x5')];this[_0x3189('0xb')]=this[_0x3189('0x9')]?util[_0x3189('0xc')]('SIP/%s',this[_0x3189('0x9')]):_0x77c566||undefined;this[_0x3189('0xd')]=checkNameSurname(_0x4faebf[_0x3189('0xe')][_0x3189('0xf')],_0x4faebf[_0x3189('0xe')][_0x3189('0x10')],_0x4faebf[_0x3189('0xe')][_0x3189('0x11')]);this['active']=_0x4faebf[_0x3189('0x12')]||![];this[_0x3189('0x13')]=_0x4faebf[_0x3189('0xf')];this[_0x3189('0x14')]=_0x4faebf['scheduledat'];this[_0x3189('0x15')]=_0x4faebf['countbusyretry']||0x0;this['countcongestionretry']=_0x4faebf[_0x3189('0x16')]||0x0;this['countnoanswerretry']=_0x4faebf[_0x3189('0x17')]||0x0;this[_0x3189('0x18')]=(_0x4faebf[_0x3189('0x15')]||0x0)+(_0x4faebf[_0x3189('0x16')]||0x0)+(_0x4faebf['countnoanswerretry']||0x0)+(_0x4faebf[_0x3189('0x19')]||0x0)+(_0x4faebf[_0x3189('0x1a')]||0x0)+(_0x4faebf[_0x3189('0x1b')]||0x0)+(_0x4faebf['countmachineretry']||0x0)+(_0x4faebf[_0x3189('0x1c')]||0x0);this[_0x3189('0x19')]=_0x4faebf[_0x3189('0x19')]||0x0;this[_0x3189('0x1a')]=_0x4faebf[_0x3189('0x1a')]||0x0;this['countabandonedretry']=_0x4faebf[_0x3189('0x1b')]||0x0;this[_0x3189('0x1d')]=_0x4faebf[_0x3189('0x1d')]||0x0;this['countagentrejectretry']=_0x4faebf[_0x3189('0x1c')]||0x0;this['callback']=_0x4faebf[_0x3189('0x1e')];this[_0x3189('0x1f')]=_0x4faebf[_0x3189('0x1f')];this[_0x3189('0x20')]=_0x4faebf[_0x3189('0x20')];this[_0x3189('0x21')]=_0x4faebf['recallme'];this['ContactId']=_0x4faebf[_0x3189('0x22')];this[_0x3189('0x23')]=_0x4faebf[_0x3189('0x23')];this[_0x3189('0x24')]=_[_0x3189('0x1')](_0x4faebf[_0x3189('0xa')])?_0x4faebf[_0x3189('0x24')]:_0x4faebf[_0x3189('0xa')]['id'];this[_0x3189('0x25')]=_0x4faebf[_0x3189('0x25')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action['prototype'][_0x3189('0x26')]=function(){return util[_0x3189('0xc')](_0x3189('0x27'),this[_0x3189('0xd')],this[_0x3189('0x28')]);};module[_0x3189('0x29')]=Action;