3fa807f6002f2562cfe29473293157a83560c2ef
[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 _0xc852=['CampaignId','idHopper','ContactFirstName','firstName','starttime','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','format','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','lodash','isNil','string','voiceQueue','uniqueid','name','phone','Contact','number','queue','active','type','dialQueueTimeout','scheduledat','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId'];(function(_0x319efe,_0x392c35){var _0x28411f=function(_0x7d8729){while(--_0x7d8729){_0x319efe['push'](_0x319efe['shift']());}};_0x28411f(++_0x392c35);}(_0xc852,0x150));var _0x2c85=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc852[_0x14add3];return _0x4a174f;};'use strict';var util=require('util');var _=require(_0x2c85('0x0'));var moment=require('moment');function checkNameSurname(_0x3739fd,_0x55ef4a,_0x47b723){var _0x48a7f6='';if(!_[_0x2c85('0x1')](_0x55ef4a)&&_0x2c85('0x2')===typeof _0x55ef4a){_0x48a7f6+=_0x55ef4a;}if(!_['isNil'](_0x47b723)&&'string'===typeof _0x47b723){_0x48a7f6+='\x20'+_0x47b723;}if(_0x48a7f6!==''){return _0x48a7f6;}return _0x3739fd;}function Action(_0xcccc71,_0x2f062c,_0x339b1b){this[_0x2c85('0x3')]=_0xcccc71;this[_0x2c85('0x4')]=_0x339b1b||undefined;this[_0x2c85('0x5')]=checkNameSurname(_0x2f062c['Contact'][_0x2c85('0x6')],_0x2f062c[_0x2c85('0x7')]['firstName'],_0x2f062c[_0x2c85('0x7')]['lastName']);this[_0x2c85('0x8')]=_0x2f062c['phone'];this[_0x2c85('0x9')]=_0xcccc71[_0x2c85('0x5')];this[_0x2c85('0xa')]=_0x2f062c[_0x2c85('0xa')]||![];this[_0x2c85('0xb')]=_0xcccc71[_0x2c85('0xb')];this[_0x2c85('0xc')]=_0xcccc71[_0x2c85('0xc')]||0x3;this[_0x2c85('0xd')]=_0x2f062c[_0x2c85('0xd')];this['countbusyretry']=_0x2f062c['countbusyretry'];this[_0x2c85('0xe')]=_0x2f062c[_0x2c85('0xe')];this[_0x2c85('0xf')]=_0x2f062c[_0x2c85('0xf')];this[_0x2c85('0x10')]=_0x2f062c[_0x2c85('0x10')];this['countdropretry']=_0x2f062c[_0x2c85('0x11')];this[_0x2c85('0x12')]=_0x2f062c[_0x2c85('0x12')];this[_0x2c85('0x13')]=_0x2f062c[_0x2c85('0x13')];this[_0x2c85('0x14')]=_0x2f062c['countagentrejectretry'];this[_0x2c85('0x15')]=_0x2f062c[_0x2c85('0x15')];this[_0x2c85('0x16')]=_0x2f062c[_0x2c85('0x16')];this[_0x2c85('0x17')]=_0x2f062c[_0x2c85('0x17')];this['VoiceQueueId']=_0x2f062c['VoiceQueueId'];this[_0x2c85('0x18')]=_0x2f062c[_0x2c85('0x18')];this[_0x2c85('0x19')]=_0x2f062c['id'];this[_0x2c85('0x1a')]=_0x2f062c[_0x2c85('0x7')][_0x2c85('0x1b')]||'';this[_0x2c85('0x1c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x2c85('0x1d')]=_0x2f062c['callback'];this[_0x2c85('0x1e')]=_0x2f062c['callbackuniqueid'];this[_0x2c85('0x1f')]=_0x2f062c[_0x2c85('0x1f')];this[_0x2c85('0x20')]=_0x2f062c['recallme'];this['originatecalleridnum']='';this[_0x2c85('0x21')]='';}Action[_0x2c85('0x22')]['getCaller']=function(){return util[_0x2c85('0x23')](_0x2c85('0x24'),this[_0x2c85('0x5')],this[_0x2c85('0x3')][_0x2c85('0x25')]>0x0?this[_0x2c85('0x8')][_0x2c85('0x26')](this[_0x2c85('0x3')][_0x2c85('0x25')]):this[_0x2c85('0x8')]);};Action[_0x2c85('0x22')][_0x2c85('0x27')]=function(){return this[_0x2c85('0x9')];};module['exports']=Action;