Built motion from commit 06a208af.|2.6.26
[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 _0x2cff=['countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','getQueue','exports','util','lodash','moment','isNil','string','uniqueid','name','phone','Contact','firstName','lastName','number','queue','active','type','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x5806e2,_0x272c9d){var _0x33e191=function(_0x4a184a){while(--_0x4a184a){_0x5806e2['push'](_0x5806e2['shift']());}};_0x33e191(++_0x272c9d);}(_0x2cff,0x152));var _0xf2cf=function(_0x2a58f4,_0x13885b){_0x2a58f4=_0x2a58f4-0x0;var _0x58ef72=_0x2cff[_0x2a58f4];return _0x58ef72;};'use strict';var util=require(_0xf2cf('0x0'));var _=require(_0xf2cf('0x1'));var moment=require(_0xf2cf('0x2'));function checkNameSurname(_0x470416,_0x3eb107,_0x135532){var _0x27b63c='';if(!_[_0xf2cf('0x3')](_0x3eb107)&&_0xf2cf('0x4')===typeof _0x3eb107){_0x27b63c+=_0x3eb107;}if(!_[_0xf2cf('0x3')](_0x135532)&&_0xf2cf('0x4')===typeof _0x135532){_0x27b63c+='\x20'+_0x135532;}if(_0x27b63c!==''){return _0x27b63c;}return _0x470416;}function Action(_0x54722a,_0x2e17e8,_0x24bf91){this['voiceQueue']=_0x54722a;this[_0xf2cf('0x5')]=_0x24bf91||undefined;this[_0xf2cf('0x6')]=checkNameSurname(_0x2e17e8['Contact'][_0xf2cf('0x7')],_0x2e17e8[_0xf2cf('0x8')][_0xf2cf('0x9')],_0x2e17e8['Contact'][_0xf2cf('0xa')]);this[_0xf2cf('0xb')]=_0x2e17e8[_0xf2cf('0x7')];this[_0xf2cf('0xc')]=_0x54722a[_0xf2cf('0x6')];this[_0xf2cf('0xd')]=_0x2e17e8['active']||![];this[_0xf2cf('0xe')]=_0x54722a[_0xf2cf('0xe')];this[_0xf2cf('0xf')]=_0x54722a[_0xf2cf('0xf')]||0x3;this['scheduledat']=_0x2e17e8['scheduledat'];this[_0xf2cf('0x10')]=_0x2e17e8[_0xf2cf('0x10')];this[_0xf2cf('0x11')]=_0x2e17e8[_0xf2cf('0x11')];this[_0xf2cf('0x12')]=_0x2e17e8[_0xf2cf('0x12')];this[_0xf2cf('0x13')]=_0x2e17e8[_0xf2cf('0x13')];this[_0xf2cf('0x14')]=_0x2e17e8[_0xf2cf('0x14')];this[_0xf2cf('0x15')]=_0x2e17e8[_0xf2cf('0x15')];this['countmachineretry']=_0x2e17e8[_0xf2cf('0x16')];this[_0xf2cf('0x17')]=_0x2e17e8[_0xf2cf('0x17')];this[_0xf2cf('0x18')]=_0x2e17e8[_0xf2cf('0x18')];this[_0xf2cf('0x19')]=_0x2e17e8[_0xf2cf('0x19')];this[_0xf2cf('0x1a')]=_0x2e17e8['UserId'];this[_0xf2cf('0x1b')]=_0x2e17e8[_0xf2cf('0x1b')];this[_0xf2cf('0x1c')]=_0x2e17e8[_0xf2cf('0x1c')];this['idHopper']=_0x2e17e8['id'];this['ContactFirstName']=_0x2e17e8[_0xf2cf('0x8')][_0xf2cf('0x9')]||'';this['starttime']=moment()[_0xf2cf('0x1d')](_0xf2cf('0x1e'));this[_0xf2cf('0x1f')]=_0x2e17e8[_0xf2cf('0x1f')];this[_0xf2cf('0x20')]=_0x2e17e8['callbackuniqueid'];this['callbackat']=_0x2e17e8[_0xf2cf('0x21')];this['recallme']=_0x2e17e8[_0xf2cf('0x22')];this[_0xf2cf('0x23')]='';this[_0xf2cf('0x24')]='';}Action[_0xf2cf('0x25')][_0xf2cf('0x26')]=function(){return util['format'](_0xf2cf('0x27'),this[_0xf2cf('0x6')],this[_0xf2cf('0x28')][_0xf2cf('0x29')]>0x0?this[_0xf2cf('0xb')][_0xf2cf('0x2a')](this[_0xf2cf('0x28')]['dialCutDigit']):this['number']);};Action[_0xf2cf('0x25')][_0xf2cf('0x2b')]=function(){return this[_0xf2cf('0xc')];};module[_0xf2cf('0x2c')]=Action;