5617fc993632f66f07aa1f5d4c385a9af1921b61
[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 _0x3ddd=['scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','firstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','substring','dialCutDigit','getQueue','exports','util','lodash','isNil','string','voiceQueue','uniqueid','name','Contact','lastName','number','phone','queue','active','type','dialQueueTimeout'];(function(_0x1930eb,_0x1b50de){var _0x114209=function(_0x20fe0c){while(--_0x20fe0c){_0x1930eb['push'](_0x1930eb['shift']());}};_0x114209(++_0x1b50de);}(_0x3ddd,0xad));var _0xd3dd=function(_0x44ead3,_0x25eaaa){_0x44ead3=_0x44ead3-0x0;var _0x4a15ea=_0x3ddd[_0x44ead3];return _0x4a15ea;};'use strict';var util=require(_0xd3dd('0x0'));var _=require(_0xd3dd('0x1'));var moment=require('moment');function checkNameSurname(_0x4e6afe,_0x4d7694,_0x32ed55){var _0x4887db='';if(!_[_0xd3dd('0x2')](_0x4d7694)&&_0xd3dd('0x3')===typeof _0x4d7694){_0x4887db+=_0x4d7694;}if(!_[_0xd3dd('0x2')](_0x32ed55)&&_0xd3dd('0x3')===typeof _0x32ed55){_0x4887db+='\x20'+_0x32ed55;}if(_0x4887db!==''){return _0x4887db;}return _0x4e6afe;}function Action(_0x413f15,_0x28e141,_0xfc3606){this[_0xd3dd('0x4')]=_0x413f15;this[_0xd3dd('0x5')]=_0xfc3606||undefined;this[_0xd3dd('0x6')]=checkNameSurname(_0x28e141['Contact']['phone'],_0x28e141[_0xd3dd('0x7')]['firstName'],_0x28e141[_0xd3dd('0x7')][_0xd3dd('0x8')]);this[_0xd3dd('0x9')]=_0x28e141[_0xd3dd('0xa')];this[_0xd3dd('0xb')]=_0x413f15[_0xd3dd('0x6')];this['active']=_0x28e141[_0xd3dd('0xc')]||![];this[_0xd3dd('0xd')]=_0x413f15[_0xd3dd('0xd')];this[_0xd3dd('0xe')]=_0x413f15[_0xd3dd('0xe')]||0x3;this['scheduledat']=_0x28e141[_0xd3dd('0xf')];this[_0xd3dd('0x10')]=_0x28e141['countbusyretry'];this[_0xd3dd('0x11')]=_0x28e141['countcongestionretry'];this['countnoanswerretry']=_0x28e141[_0xd3dd('0x12')];this['countnosuchnumberretry']=_0x28e141[_0xd3dd('0x13')];this[_0xd3dd('0x14')]=_0x28e141[_0xd3dd('0x14')];this[_0xd3dd('0x15')]=_0x28e141['countabandonedretry'];this[_0xd3dd('0x16')]=_0x28e141[_0xd3dd('0x16')];this[_0xd3dd('0x17')]=_0x28e141['countagentrejectretry'];this[_0xd3dd('0x18')]=_0x28e141[_0xd3dd('0x18')];this['ListId']=_0x28e141[_0xd3dd('0x19')];this[_0xd3dd('0x1a')]=_0x28e141[_0xd3dd('0x1a')];this[_0xd3dd('0x1b')]=_0x28e141['VoiceQueueId'];this['CampaignId']=_0x28e141[_0xd3dd('0x1c')];this['idHopper']=_0x28e141['id'];this[_0xd3dd('0x1d')]=_0x28e141[_0xd3dd('0x7')][_0xd3dd('0x1e')]||'';this[_0xd3dd('0x1f')]=moment()['format'](_0xd3dd('0x20'));this['callback']=_0x28e141[_0xd3dd('0x21')];this['callbackuniqueid']=_0x28e141[_0xd3dd('0x22')];this['callbackat']=_0x28e141[_0xd3dd('0x23')];this[_0xd3dd('0x24')]=_0x28e141[_0xd3dd('0x24')];this[_0xd3dd('0x25')]='';this[_0xd3dd('0x26')]='';}Action[_0xd3dd('0x27')][_0xd3dd('0x28')]=function(){return util[_0xd3dd('0x29')](_0xd3dd('0x2a'),this[_0xd3dd('0x6')],this[_0xd3dd('0x4')]['dialCutDigit']>0x0?this[_0xd3dd('0x9')][_0xd3dd('0x2b')](this[_0xd3dd('0x4')][_0xd3dd('0x2c')]):this['number']);};Action[_0xd3dd('0x27')][_0xd3dd('0x2d')]=function(){return this[_0xd3dd('0xb')];};module[_0xd3dd('0x2e')]=Action;