Built motion from commit 97153652.|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 _0x7486=['UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','getCaller','format','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','prototype','exports','lodash','moment','isNil','string','uniqueid','name','Contact','lastName','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId'];(function(_0x316dab,_0x2261ba){var _0x11d71f=function(_0x321488){while(--_0x321488){_0x316dab['push'](_0x316dab['shift']());}};_0x11d71f(++_0x2261ba);}(_0x7486,0x1a9));var _0x6748=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7486[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require(_0x6748('0x0'));var moment=require(_0x6748('0x1'));function checkNameSurname(_0x1f5043,_0x28d5e8,_0x4c79c6){var _0x144cd3='';if(!_[_0x6748('0x2')](_0x28d5e8)&&_0x6748('0x3')===typeof _0x28d5e8){_0x144cd3+=_0x28d5e8;}if(!_[_0x6748('0x2')](_0x4c79c6)&&_0x6748('0x3')===typeof _0x4c79c6){_0x144cd3+='\x20'+_0x4c79c6;}if(_0x144cd3!==''){return _0x144cd3;}return _0x1f5043;}function Action(_0x1fec22,_0x4d75b5,_0x161950){this['voiceQueue']=_0x1fec22;this[_0x6748('0x4')]=_0x161950||undefined;this[_0x6748('0x5')]=checkNameSurname(_0x4d75b5[_0x6748('0x6')]['phone'],_0x4d75b5[_0x6748('0x6')]['firstName'],_0x4d75b5['Contact'][_0x6748('0x7')]);this[_0x6748('0x8')]=_0x4d75b5[_0x6748('0x9')];this[_0x6748('0xa')]=_0x1fec22[_0x6748('0x5')];this['active']=_0x4d75b5[_0x6748('0xb')]||![];this[_0x6748('0xc')]=_0x1fec22[_0x6748('0xc')];this[_0x6748('0xd')]=_0x1fec22[_0x6748('0xd')]||0x3;this[_0x6748('0xe')]=_0x4d75b5[_0x6748('0xe')];this[_0x6748('0xf')]=_0x4d75b5[_0x6748('0xf')];this[_0x6748('0x10')]=_0x4d75b5[_0x6748('0x10')];this[_0x6748('0x11')]=_0x4d75b5[_0x6748('0x11')];this[_0x6748('0x12')]=_0x4d75b5['countnosuchnumberretry'];this['countdropretry']=_0x4d75b5[_0x6748('0x13')];this['countabandonedretry']=_0x4d75b5[_0x6748('0x14')];this[_0x6748('0x15')]=_0x4d75b5[_0x6748('0x15')];this[_0x6748('0x16')]=_0x4d75b5[_0x6748('0x16')];this['ContactId']=_0x4d75b5[_0x6748('0x17')];this[_0x6748('0x18')]=_0x4d75b5['ListId'];this[_0x6748('0x19')]=_0x4d75b5[_0x6748('0x19')];this[_0x6748('0x1a')]=_0x4d75b5[_0x6748('0x1a')];this['CampaignId']=_0x4d75b5[_0x6748('0x1b')];this[_0x6748('0x1c')]=_0x4d75b5['id'];this[_0x6748('0x1d')]=_0x4d75b5[_0x6748('0x6')][_0x6748('0x1e')]||'';this[_0x6748('0x1f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x6748('0x20')]=_0x4d75b5[_0x6748('0x20')];this[_0x6748('0x21')]=_0x4d75b5['callbackuniqueid'];this[_0x6748('0x22')]=_0x4d75b5[_0x6748('0x22')];this[_0x6748('0x23')]=_0x4d75b5['recallme'];this[_0x6748('0x24')]='';this['originatecalleridname']='';}Action['prototype'][_0x6748('0x25')]=function(){return util[_0x6748('0x26')](_0x6748('0x27'),this[_0x6748('0x5')],this[_0x6748('0x28')][_0x6748('0x29')]>0x0?this['number'][_0x6748('0x2a')](this[_0x6748('0x28')]['dialCutDigit']):this[_0x6748('0x8')]);};Action[_0x6748('0x2b')]['getQueue']=function(){return this[_0x6748('0xa')];};module[_0x6748('0x2c')]=Action;