ea5359b37a1e26406c9064579e664890c92e3fc9
[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 _0xe681=['countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','util','isNil','idContact','queue','name','type','campaigntype','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','active','calleridnum','phone','scheduledat','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry'];(function(_0x503ac6,_0x5ef9f5){var _0x3aa041=function(_0xd5fb4c){while(--_0xd5fb4c){_0x503ac6['push'](_0x503ac6['shift']());}};_0x3aa041(++_0x5ef9f5);}(_0xe681,0x128));var _0x1e68=function(_0x5ecc8d,_0x7b7f49){_0x5ecc8d=_0x5ecc8d-0x0;var _0x5c123a=_0xe681[_0x5ecc8d];return _0x5c123a;};'use strict';var util=require(_0x1e68('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x8e4e1c,_0x57a9fe,_0x5c8666){var _0x529924='';if(!_[_0x1e68('0x1')](_0x57a9fe)&&'string'===typeof _0x57a9fe){_0x529924+=_0x57a9fe;}if(!_[_0x1e68('0x1')](_0x5c8666)&&'string'===typeof _0x5c8666){_0x529924+='\x20'+_0x5c8666;}if(_0x529924!==''){return _0x529924;}return _0x8e4e1c;}function Action(_0x2cd961,_0x3e6f71,_0x3d3b2f,_0x42bfe3,_0x32747e){this['uniqueid']=_0x3d3b2f||undefined;this[_0x1e68('0x2')]=_0x2cd961['id'];this[_0x1e68('0x3')]=_0x3e6f71[_0x1e68('0x4')];this[_0x1e68('0x5')]=_0x3e6f71[_0x1e68('0x5')];this[_0x1e68('0x6')]=_0x1e68('0x3');this['dialAnswer']=![];this[_0x1e68('0x7')]=_[_0x1e68('0x1')](_0x2cd961['Agent'])?undefined:_0x2cd961[_0x1e68('0x8')][_0x1e68('0x4')];this[_0x1e68('0x9')]=this[_0x1e68('0x7')]?util[_0x1e68('0xa')](_0x1e68('0xb'),this[_0x1e68('0x7')]):_0x42bfe3||undefined;this[_0x1e68('0xc')]=checkNameSurname(_0x2cd961[_0x1e68('0xd')]['phone'],_0x2cd961['Contact']['firstName'],_0x2cd961[_0x1e68('0xd')]['lastName']);this['active']=_0x2cd961[_0x1e68('0xe')]||![];this[_0x1e68('0xf')]=_0x2cd961[_0x1e68('0xd')][_0x1e68('0x10')];this[_0x1e68('0x11')]=_0x2cd961['scheduledat'];this['countbusyretry']=_0x2cd961['countbusyretry']||0x0;this[_0x1e68('0x12')]=_0x2cd961['countcongestionretry']||0x0;this['countnoanswerretry']=_0x2cd961[_0x1e68('0x13')]||0x0;this[_0x1e68('0x14')]=(_0x2cd961[_0x1e68('0x15')]||0x0)+(_0x2cd961[_0x1e68('0x12')]||0x0)+(_0x2cd961[_0x1e68('0x13')]||0x0)+(_0x2cd961[_0x1e68('0x16')]||0x0)+(_0x2cd961[_0x1e68('0x17')]||0x0)+(_0x2cd961[_0x1e68('0x18')]||0x0)+(_0x2cd961['countmachineretry']||0x0)+(_0x2cd961[_0x1e68('0x19')]||0x0);this[_0x1e68('0x16')]=_0x2cd961[_0x1e68('0x16')]||0x0;this[_0x1e68('0x17')]=_0x2cd961[_0x1e68('0x17')]||0x0;this['countabandonedretry']=_0x2cd961[_0x1e68('0x18')]||0x0;this[_0x1e68('0x1a')]=_0x2cd961[_0x1e68('0x1a')]||0x0;this['countagentrejectretry']=_0x2cd961[_0x1e68('0x19')]||0x0;this[_0x1e68('0x1b')]=_0x2cd961['callback'];this[_0x1e68('0x1c')]=_0x2cd961[_0x1e68('0x1c')];this[_0x1e68('0x1d')]=_0x2cd961[_0x1e68('0x1d')];this[_0x1e68('0x1e')]=_0x2cd961[_0x1e68('0x1e')];this[_0x1e68('0x1f')]=_0x2cd961[_0x1e68('0x1f')];this[_0x1e68('0x20')]=_0x2cd961[_0x1e68('0x20')];this[_0x1e68('0x21')]=_['isNil'](_0x2cd961['Agent'])?_0x2cd961[_0x1e68('0x21')]:_0x2cd961['Agent']['id'];this[_0x1e68('0x22')]=_0x2cd961['VoiceQueueId'];this[_0x1e68('0x23')]='';this[_0x1e68('0x24')]='';}Action['prototype'][_0x1e68('0x25')]=function(){return util[_0x1e68('0xa')](_0x1e68('0x26'),this['calleridname'],this[_0x1e68('0x27')]);};module['exports']=Action;