Built motion from commit d1eab355.|2.6.28
[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 _0xf2e3=['active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','exports','util','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName'];(function(_0x25a19a,_0x536079){var _0x9d8a38=function(_0x55a45c){while(--_0x55a45c){_0x25a19a['push'](_0x25a19a['shift']());}};_0x9d8a38(++_0x536079);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xf2e3[_0x12fc8d];return _0x3f9d04;};'use strict';var util=require(_0x3f2e('0x0'));var _=require('lodash');var moment=require(_0x3f2e('0x1'));function checkNameSurname(_0x231b2b,_0x3fba4b,_0x30f1bb){var _0x27d28c='';if(!_[_0x3f2e('0x2')](_0x3fba4b)&&_0x3f2e('0x3')===typeof _0x3fba4b){_0x27d28c+=_0x3fba4b;}if(!_[_0x3f2e('0x2')](_0x30f1bb)&&_0x3f2e('0x3')===typeof _0x30f1bb){_0x27d28c+='\x20'+_0x30f1bb;}if(_0x27d28c!==''){return _0x27d28c;}return _0x231b2b;}function Action(_0x5f254a,_0x33a3b7,_0xdd6b3e,_0x3c0864,_0xdf499f){this[_0x3f2e('0x4')]=_0xdd6b3e||undefined;this[_0x3f2e('0x5')]=_0x5f254a['id'];this[_0x3f2e('0x6')]=_0x33a3b7[_0x3f2e('0x7')];this[_0x3f2e('0x8')]=_0x33a3b7[_0x3f2e('0x8')];this[_0x3f2e('0x9')]=_0x3f2e('0x6');this[_0x3f2e('0xa')]=![];this[_0x3f2e('0xb')]=_[_0x3f2e('0x2')](_0x5f254a[_0x3f2e('0xc')])?undefined:_0x5f254a[_0x3f2e('0xc')][_0x3f2e('0x7')];this[_0x3f2e('0xd')]=this['membername']?util[_0x3f2e('0xe')](_0x3f2e('0xf'),this['membername']):_0x3c0864||undefined;this[_0x3f2e('0x10')]=checkNameSurname(_0x5f254a[_0x3f2e('0x11')][_0x3f2e('0x12')],_0x5f254a[_0x3f2e('0x11')][_0x3f2e('0x13')],_0x5f254a['Contact'][_0x3f2e('0x14')]);this[_0x3f2e('0x15')]=_0x5f254a[_0x3f2e('0x15')]||![];this['calleridnum']=_0x5f254a[_0x3f2e('0x12')];this[_0x3f2e('0x16')]=_0x5f254a[_0x3f2e('0x16')];this[_0x3f2e('0x17')]=_0x5f254a[_0x3f2e('0x17')]||0x0;this[_0x3f2e('0x18')]=_0x5f254a[_0x3f2e('0x18')]||0x0;this[_0x3f2e('0x19')]=_0x5f254a[_0x3f2e('0x19')]||0x0;this[_0x3f2e('0x1a')]=(_0x5f254a[_0x3f2e('0x17')]||0x0)+(_0x5f254a['countcongestionretry']||0x0)+(_0x5f254a[_0x3f2e('0x19')]||0x0)+(_0x5f254a[_0x3f2e('0x1b')]||0x0)+(_0x5f254a[_0x3f2e('0x1c')]||0x0)+(_0x5f254a[_0x3f2e('0x1d')]||0x0)+(_0x5f254a[_0x3f2e('0x1e')]||0x0)+(_0x5f254a['countagentrejectretry']||0x0);this['countnosuchnumberretry']=_0x5f254a[_0x3f2e('0x1b')]||0x0;this[_0x3f2e('0x1c')]=_0x5f254a[_0x3f2e('0x1c')]||0x0;this[_0x3f2e('0x1d')]=_0x5f254a[_0x3f2e('0x1d')]||0x0;this[_0x3f2e('0x1e')]=_0x5f254a['countmachineretry']||0x0;this['countagentrejectretry']=_0x5f254a[_0x3f2e('0x1f')]||0x0;this[_0x3f2e('0x20')]=_0x5f254a['callback'];this['callbackuniqueid']=_0x5f254a[_0x3f2e('0x21')];this['callbackat']=_0x5f254a[_0x3f2e('0x22')];this[_0x3f2e('0x23')]=_0x5f254a['recallme'];this['ContactId']=_0x5f254a['ContactId'];this[_0x3f2e('0x24')]=_0x5f254a[_0x3f2e('0x24')];this['UserId']=_[_0x3f2e('0x2')](_0x5f254a['Agent'])?_0x5f254a[_0x3f2e('0x25')]:_0x5f254a['Agent']['id'];this[_0x3f2e('0x26')]=_0x5f254a[_0x3f2e('0x26')];this[_0x3f2e('0x27')]='';this[_0x3f2e('0x28')]='';}Action[_0x3f2e('0x29')]['getCaller']=function(){return util[_0x3f2e('0xe')](_0x3f2e('0x2a'),this['calleridname'],this['number']);};module[_0x3f2e('0x2b')]=Action;