af85320b837aabc7d45f7107c1c1e753a8d80613
[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 _0xcb9b=['countnoanswerretry','countdropretry','countabandonedretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','firstName','lastName','active','calleridnum','phone','scheduledat','countbusyretry'];(function(_0x27a03b,_0x11e2eb){var _0x1cdb5f=function(_0x5dba42){while(--_0x5dba42){_0x27a03b['push'](_0x27a03b['shift']());}};_0x1cdb5f(++_0x11e2eb);}(_0xcb9b,0xf0));var _0xbcb9=function(_0x34d3d9,_0x5adc0c){_0x34d3d9=_0x34d3d9-0x0;var _0x4b145e=_0xcb9b[_0x34d3d9];return _0x4b145e;};'use strict';var util=require(_0xbcb9('0x0'));var _=require(_0xbcb9('0x1'));var moment=require('moment');function checkNameSurname(_0x40a4cf,_0x1d8dfe,_0x3f4a61){var _0x1f449d='';if(!_[_0xbcb9('0x2')](_0x1d8dfe)&&_0xbcb9('0x3')===typeof _0x1d8dfe){_0x1f449d+=_0x1d8dfe;}if(!_[_0xbcb9('0x2')](_0x3f4a61)&&_0xbcb9('0x3')===typeof _0x3f4a61){_0x1f449d+='\x20'+_0x3f4a61;}if(_0x1f449d!==''){return _0x1f449d;}return _0x40a4cf;}function Action(_0x50bddc,_0x1f9d89,_0x156c5a,_0x581298,_0x54f189){this[_0xbcb9('0x4')]=_0x156c5a||undefined;this[_0xbcb9('0x5')]=_0x50bddc['id'];this[_0xbcb9('0x6')]=_0x1f9d89[_0xbcb9('0x7')];this[_0xbcb9('0x8')]=_0x1f9d89[_0xbcb9('0x8')];this[_0xbcb9('0x9')]='queue';this['dialAnswer']=![];this[_0xbcb9('0xa')]=_['isNil'](_0x50bddc[_0xbcb9('0xb')])?undefined:_0x50bddc[_0xbcb9('0xb')][_0xbcb9('0x7')];this[_0xbcb9('0xc')]=this[_0xbcb9('0xa')]?util[_0xbcb9('0xd')](_0xbcb9('0xe'),this[_0xbcb9('0xa')]):_0x581298||undefined;this[_0xbcb9('0xf')]=checkNameSurname(_0x50bddc['Contact']['phone'],_0x50bddc[_0xbcb9('0x10')][_0xbcb9('0x11')],_0x50bddc[_0xbcb9('0x10')][_0xbcb9('0x12')]);this['active']=_0x50bddc[_0xbcb9('0x13')]||![];this[_0xbcb9('0x14')]=_0x50bddc[_0xbcb9('0x10')][_0xbcb9('0x15')];this[_0xbcb9('0x16')]=_0x50bddc[_0xbcb9('0x16')];this[_0xbcb9('0x17')]=_0x50bddc[_0xbcb9('0x17')]||0x0;this['countcongestionretry']=_0x50bddc['countcongestionretry']||0x0;this[_0xbcb9('0x18')]=_0x50bddc[_0xbcb9('0x18')]||0x0;this['countglobal']=(_0x50bddc[_0xbcb9('0x17')]||0x0)+(_0x50bddc['countcongestionretry']||0x0)+(_0x50bddc[_0xbcb9('0x18')]||0x0)+(_0x50bddc['countnosuchnumberretry']||0x0)+(_0x50bddc[_0xbcb9('0x19')]||0x0)+(_0x50bddc[_0xbcb9('0x1a')]||0x0)+(_0x50bddc['countmachineretry']||0x0)+(_0x50bddc['countagentrejectretry']||0x0);this['countnosuchnumberretry']=_0x50bddc[_0xbcb9('0x1b')]||0x0;this[_0xbcb9('0x19')]=_0x50bddc['countdropretry']||0x0;this['countabandonedretry']=_0x50bddc['countabandonedretry']||0x0;this[_0xbcb9('0x1c')]=_0x50bddc[_0xbcb9('0x1c')]||0x0;this[_0xbcb9('0x1d')]=_0x50bddc['countagentrejectretry']||0x0;this[_0xbcb9('0x1e')]=_0x50bddc[_0xbcb9('0x1e')];this[_0xbcb9('0x1f')]=_0x50bddc[_0xbcb9('0x1f')];this[_0xbcb9('0x20')]=_0x50bddc['callbackat'];this['recallme']=_0x50bddc['recallme'];this[_0xbcb9('0x21')]=_0x50bddc['ContactId'];this[_0xbcb9('0x22')]=_0x50bddc[_0xbcb9('0x22')];this[_0xbcb9('0x23')]=_[_0xbcb9('0x2')](_0x50bddc[_0xbcb9('0xb')])?_0x50bddc['UserId']:_0x50bddc['Agent']['id'];this[_0xbcb9('0x24')]=_0x50bddc[_0xbcb9('0x24')];this[_0xbcb9('0x25')]='';this[_0xbcb9('0x26')]='';}Action[_0xbcb9('0x27')][_0xbcb9('0x28')]=function(){return util[_0xbcb9('0xd')](_0xbcb9('0x29'),this['calleridname'],this[_0xbcb9('0x2a')]);};module[_0xbcb9('0x2b')]=Action;