6d3ad5d247eb4ef2c70addee0c4471aedec68adc
[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 _0x1b56=['\x22%s\x22\x20<%s>','calleridname','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','Agent','channelAgent','format','SIP/%s','Contact','firstName','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x1b56,0xee));var _0x61b5=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x1b56[_0x266618];return _0x54dbf5;};'use strict';var util=require(_0x61b5('0x0'));var _=require(_0x61b5('0x1'));var moment=require(_0x61b5('0x2'));function checkNameSurname(_0x49e2a5,_0x4b2584,_0x1e0a4b){var _0x5505f9='';if(!_[_0x61b5('0x3')](_0x4b2584)&&_0x61b5('0x4')===typeof _0x4b2584){_0x5505f9+=_0x4b2584;}if(!_[_0x61b5('0x3')](_0x1e0a4b)&&_0x61b5('0x4')===typeof _0x1e0a4b){_0x5505f9+='\x20'+_0x1e0a4b;}if(_0x5505f9!==''){return _0x5505f9;}return _0x49e2a5;}function Action(_0x11aa8c,_0x6d54c5,_0x1c08a7,_0x3e1e4e,_0x3ed669){this[_0x61b5('0x5')]=_0x1c08a7||undefined;this[_0x61b5('0x6')]=_0x11aa8c['id'];this[_0x61b5('0x7')]=_0x6d54c5[_0x61b5('0x8')];this[_0x61b5('0x9')]=_0x6d54c5['type'];this[_0x61b5('0xa')]=_0x61b5('0x7');this[_0x61b5('0xb')]=![];this['membername']=_['isNil'](_0x11aa8c['Agent'])?undefined:_0x11aa8c[_0x61b5('0xc')]['name'];this[_0x61b5('0xd')]=this['membername']?util[_0x61b5('0xe')](_0x61b5('0xf'),this['membername']):_0x3e1e4e||undefined;this['calleridname']=checkNameSurname(_0x11aa8c[_0x61b5('0x10')]['phone'],_0x11aa8c['Contact'][_0x61b5('0x11')],_0x11aa8c['Contact'][_0x61b5('0x12')]);this['active']=_0x11aa8c[_0x61b5('0x13')]||![];this[_0x61b5('0x14')]=_0x11aa8c['Contact'][_0x61b5('0x15')];this[_0x61b5('0x16')]=_0x11aa8c[_0x61b5('0x16')];this['countbusyretry']=_0x11aa8c[_0x61b5('0x17')]||0x0;this[_0x61b5('0x18')]=_0x11aa8c['countcongestionretry']||0x0;this[_0x61b5('0x19')]=_0x11aa8c[_0x61b5('0x19')]||0x0;this[_0x61b5('0x1a')]=(_0x11aa8c[_0x61b5('0x17')]||0x0)+(_0x11aa8c[_0x61b5('0x18')]||0x0)+(_0x11aa8c[_0x61b5('0x19')]||0x0);this[_0x61b5('0x1b')]=_0x11aa8c[_0x61b5('0x1b')];this[_0x61b5('0x1c')]=_0x11aa8c['callbackuniqueid'];this[_0x61b5('0x1d')]=_0x11aa8c[_0x61b5('0x1d')];this['recallme']=_0x11aa8c['recallme'];this[_0x61b5('0x1e')]=_0x11aa8c['ContactId'];this[_0x61b5('0x1f')]=_0x11aa8c[_0x61b5('0x1f')];this['UserId']=_[_0x61b5('0x3')](_0x11aa8c[_0x61b5('0xc')])?_0x11aa8c[_0x61b5('0x20')]:_0x11aa8c['Agent']['id'];this[_0x61b5('0x21')]=_0x11aa8c[_0x61b5('0x21')];this[_0x61b5('0x22')]='';this['originatecalleridname']='';}Action['prototype']['getCaller']=function(){return util[_0x61b5('0xe')](_0x61b5('0x23'),this[_0x61b5('0x24')],this[_0x61b5('0x25')]);};module[_0x61b5('0x26')]=Action;