Built motion from commit d6d69adf.|2.6.33
[motion2.git] / server / services / ami / dialer / models / 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 _0xc423=['callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback'];(function(_0x5083cc,_0xcd1903){var _0x27e884=function(_0x14045d){while(--_0x14045d){_0x5083cc['push'](_0x5083cc['shift']());}};_0x27e884(++_0xcd1903);}(_0xc423,0x14d));var _0x3c42=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xc423[_0x27af45];return _0x18df21;};'use strict';var util=require(_0x3c42('0x0'));var _=require(_0x3c42('0x1'));var moment=require(_0x3c42('0x2'));function checkNameSurname(_0x44f194,_0x474838,_0x4eddc2){var _0x4f9eab='';if(!_[_0x3c42('0x3')](_0x474838)&&_0x3c42('0x4')===typeof _0x474838){_0x4f9eab+=_0x474838;}if(!_[_0x3c42('0x3')](_0x4eddc2)&&_0x3c42('0x4')===typeof _0x4eddc2){_0x4f9eab+='\x20'+_0x4eddc2;}if(_0x4f9eab!==''){return _0x4f9eab;}return _0x44f194;}function Action(_0x19da08,_0x531351,_0x33a5a8){this[_0x3c42('0x5')]=_0x19da08;this[_0x3c42('0x6')]=_0x33a5a8||undefined;this[_0x3c42('0x7')]=checkNameSurname(_0x531351[_0x3c42('0x8')][_0x3c42('0x9')],_0x531351[_0x3c42('0x8')][_0x3c42('0xa')],_0x531351[_0x3c42('0x8')][_0x3c42('0xb')]);this[_0x3c42('0xc')]=_0x531351[_0x3c42('0x9')];this[_0x3c42('0xd')]=_0x19da08[_0x3c42('0x7')];this['active']=_0x531351[_0x3c42('0xe')]||![];this[_0x3c42('0xf')]=_0x19da08['type'];this['dialQueueTimeout']=_0x19da08['dialQueueTimeout']||0x3;this['scheduledat']=_0x531351['scheduledat'];this[_0x3c42('0x10')]=_0x531351[_0x3c42('0x10')];this[_0x3c42('0x11')]=_0x531351[_0x3c42('0x11')];this[_0x3c42('0x12')]=_0x531351[_0x3c42('0x12')];this['countnosuchnumberretry']=_0x531351[_0x3c42('0x13')];this['countdropretry']=_0x531351[_0x3c42('0x14')];this[_0x3c42('0x15')]=_0x531351[_0x3c42('0x15')];this[_0x3c42('0x16')]=_0x531351[_0x3c42('0x16')];this[_0x3c42('0x17')]=_0x531351['countagentrejectretry'];this[_0x3c42('0x18')]=_0x531351[_0x3c42('0x18')];this[_0x3c42('0x19')]=_0x531351[_0x3c42('0x19')];this[_0x3c42('0x1a')]=_0x531351[_0x3c42('0x1a')];this[_0x3c42('0x1b')]=_0x531351['VoiceQueueId'];this[_0x3c42('0x1c')]=_0x531351[_0x3c42('0x1c')];this[_0x3c42('0x1d')]=_0x531351['id'];this[_0x3c42('0x1e')]=_0x531351[_0x3c42('0x8')][_0x3c42('0xa')]||'';this[_0x3c42('0x1f')]=moment()[_0x3c42('0x20')](_0x3c42('0x21'));this[_0x3c42('0x22')]=_0x531351['callback'];this['callbackuniqueid']=_0x531351[_0x3c42('0x23')];this[_0x3c42('0x24')]=_0x531351[_0x3c42('0x24')];this['recallme']=_0x531351[_0x3c42('0x25')];this[_0x3c42('0x26')]='';this['originatecalleridname']='';}Action[_0x3c42('0x27')][_0x3c42('0x28')]=function(){return util[_0x3c42('0x20')](_0x3c42('0x29'),this['name'],this[_0x3c42('0x5')][_0x3c42('0x2a')]>0x0?this['number'][_0x3c42('0x2b')](this[_0x3c42('0x5')][_0x3c42('0x2a')]):this[_0x3c42('0xc')]);};Action[_0x3c42('0x27')][_0x3c42('0x2c')]=function(){return this['queue'];};module[_0x3c42('0x2d')]=Action;