1a06f11cc118a96a348bafc0f10b0771ed9a7537
[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 _0x5204=['isNil','uniqueid','idContact','name','type','campaigntype','queue','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','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','originatecalleridnum','originatecalleridname','prototype','getCaller','exports','util','lodash'];(function(_0x597ede,_0x19ffb2){var _0x4fff70=function(_0x48b76f){while(--_0x48b76f){_0x597ede['push'](_0x597ede['shift']());}};_0x4fff70(++_0x19ffb2);}(_0x5204,0xdf));var _0x4520=function(_0x2074db,_0x10b81b){_0x2074db=_0x2074db-0x0;var _0x27324c=_0x5204[_0x2074db];return _0x27324c;};'use strict';var util=require(_0x4520('0x0'));var _=require(_0x4520('0x1'));var moment=require('moment');function checkNameSurname(_0x12a3a1,_0x3bf0b1,_0x10cbc2){var _0x36caca='';if(!_[_0x4520('0x2')](_0x3bf0b1)&&'string'===typeof _0x3bf0b1){_0x36caca+=_0x3bf0b1;}if(!_[_0x4520('0x2')](_0x10cbc2)&&'string'===typeof _0x10cbc2){_0x36caca+='\x20'+_0x10cbc2;}if(_0x36caca!==''){return _0x36caca;}return _0x12a3a1;}function Action(_0x180174,_0x209381,_0xe0a256,_0xe741c2,_0x396d29){this[_0x4520('0x3')]=_0xe0a256||undefined;this[_0x4520('0x4')]=_0x180174['id'];this['queue']=_0x209381[_0x4520('0x5')];this['type']=_0x209381[_0x4520('0x6')];this[_0x4520('0x7')]=_0x4520('0x8');this[_0x4520('0x9')]=![];this[_0x4520('0xa')]=_[_0x4520('0x2')](_0x180174[_0x4520('0xb')])?undefined:_0x180174[_0x4520('0xb')][_0x4520('0x5')];this[_0x4520('0xc')]=this[_0x4520('0xa')]?util[_0x4520('0xd')](_0x4520('0xe'),this[_0x4520('0xa')]):_0xe741c2||undefined;this[_0x4520('0xf')]=checkNameSurname(_0x180174[_0x4520('0x10')][_0x4520('0x11')],_0x180174[_0x4520('0x10')][_0x4520('0x12')],_0x180174[_0x4520('0x10')][_0x4520('0x13')]);this['active']=_0x180174[_0x4520('0x14')]||![];this[_0x4520('0x15')]=_0x180174[_0x4520('0x11')];this[_0x4520('0x16')]=_0x180174[_0x4520('0x16')];this['countbusyretry']=_0x180174[_0x4520('0x17')]||0x0;this[_0x4520('0x18')]=_0x180174[_0x4520('0x18')]||0x0;this[_0x4520('0x19')]=_0x180174[_0x4520('0x19')]||0x0;this[_0x4520('0x1a')]=(_0x180174[_0x4520('0x17')]||0x0)+(_0x180174[_0x4520('0x18')]||0x0)+(_0x180174[_0x4520('0x19')]||0x0)+(_0x180174[_0x4520('0x1b')]||0x0)+(_0x180174[_0x4520('0x1c')]||0x0)+(_0x180174[_0x4520('0x1d')]||0x0)+(_0x180174['countmachineretry']||0x0)+(_0x180174[_0x4520('0x1e')]||0x0);this['countnosuchnumberretry']=_0x180174['countnosuchnumberretry']||0x0;this['countdropretry']=_0x180174[_0x4520('0x1c')]||0x0;this['countabandonedretry']=_0x180174[_0x4520('0x1d')]||0x0;this[_0x4520('0x1f')]=_0x180174[_0x4520('0x1f')]||0x0;this['countagentrejectretry']=_0x180174[_0x4520('0x1e')]||0x0;this[_0x4520('0x20')]=_0x180174[_0x4520('0x20')];this['callbackuniqueid']=_0x180174[_0x4520('0x21')];this[_0x4520('0x22')]=_0x180174[_0x4520('0x22')];this[_0x4520('0x23')]=_0x180174[_0x4520('0x23')];this['ContactId']=_0x180174[_0x4520('0x24')];this[_0x4520('0x25')]=_0x180174[_0x4520('0x25')];this[_0x4520('0x26')]=_['isNil'](_0x180174[_0x4520('0xb')])?_0x180174[_0x4520('0x26')]:_0x180174[_0x4520('0xb')]['id'];this[_0x4520('0x27')]=_0x180174[_0x4520('0x27')];this[_0x4520('0x28')]='';this[_0x4520('0x29')]='';}Action[_0x4520('0x2a')][_0x4520('0x2b')]=function(){return util[_0x4520('0xd')]('\x22%s\x22\x20<%s>',this[_0x4520('0xf')],this['number']);};module[_0x4520('0x2c')]=Action;