Built motion from commit e1760111.|2.6.18
[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 _0x0257=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','name','Contact','firstName','lastName','number','phone','active','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry'];(function(_0x59e7a5,_0x351d44){var _0x272605=function(_0x241003){while(--_0x241003){_0x59e7a5['push'](_0x59e7a5['shift']());}};_0x272605(++_0x351d44);}(_0x0257,0x96));var _0x7025=function(_0x4c0dd,_0x72eeba){_0x4c0dd=_0x4c0dd-0x0;var _0x1134a9=_0x0257[_0x4c0dd];return _0x1134a9;};'use strict';var util=require(_0x7025('0x0'));var _=require(_0x7025('0x1'));var moment=require(_0x7025('0x2'));function checkNameSurname(_0x16a121,_0x2b8b71,_0x50cf6a){var _0x24fddb='';if(!_[_0x7025('0x3')](_0x2b8b71)&&_0x7025('0x4')===typeof _0x2b8b71){_0x24fddb+=_0x2b8b71;}if(!_[_0x7025('0x3')](_0x50cf6a)&&_0x7025('0x4')===typeof _0x50cf6a){_0x24fddb+='\x20'+_0x50cf6a;}if(_0x24fddb!==''){return _0x24fddb;}return _0x16a121;}function Action(_0x95aa46,_0x351e11,_0x128de5){this[_0x7025('0x5')]=_0x95aa46;this['uniqueid']=_0x128de5||undefined;this[_0x7025('0x6')]=checkNameSurname(_0x351e11[_0x7025('0x7')]['phone'],_0x351e11[_0x7025('0x7')][_0x7025('0x8')],_0x351e11[_0x7025('0x7')][_0x7025('0x9')]);this[_0x7025('0xa')]=_0x351e11[_0x7025('0xb')];this['queue']=_0x95aa46[_0x7025('0x6')];this[_0x7025('0xc')]=_0x351e11[_0x7025('0xc')]||![];this['type']=_0x95aa46['type'];this[_0x7025('0xd')]=_0x95aa46[_0x7025('0xd')]||0x3;this['scheduledat']=_0x351e11['scheduledat'];this[_0x7025('0xe')]=_0x351e11[_0x7025('0xe')];this['countcongestionretry']=_0x351e11[_0x7025('0xf')];this['countnoanswerretry']=_0x351e11[_0x7025('0x10')];this[_0x7025('0x11')]=_0x351e11[_0x7025('0x11')];this['countdropretry']=_0x351e11[_0x7025('0x12')];this[_0x7025('0x13')]=_0x351e11[_0x7025('0x13')];this['countmachineretry']=_0x351e11[_0x7025('0x14')];this[_0x7025('0x15')]=_0x351e11['countagentrejectretry'];this[_0x7025('0x16')]=_0x351e11['ContactId'];this['ListId']=_0x351e11[_0x7025('0x17')];this[_0x7025('0x18')]=_0x351e11[_0x7025('0x18')];this[_0x7025('0x19')]=_0x351e11[_0x7025('0x19')];this[_0x7025('0x1a')]=_0x351e11['CampaignId'];this['idHopper']=_0x351e11['id'];this['ContactFirstName']=_0x351e11[_0x7025('0x7')][_0x7025('0x8')]||'';this[_0x7025('0x1b')]=moment()[_0x7025('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7025('0x1d')]=_0x351e11[_0x7025('0x1d')];this[_0x7025('0x1e')]=_0x351e11[_0x7025('0x1e')];this[_0x7025('0x1f')]=_0x351e11[_0x7025('0x1f')];this[_0x7025('0x20')]=_0x351e11[_0x7025('0x20')];this[_0x7025('0x21')]='';this[_0x7025('0x22')]='';}Action[_0x7025('0x23')][_0x7025('0x24')]=function(){return util['format'](_0x7025('0x25'),this[_0x7025('0x6')],this[_0x7025('0x5')][_0x7025('0x26')]>0x0?this[_0x7025('0xa')][_0x7025('0x27')](this[_0x7025('0x5')][_0x7025('0x26')]):this['number']);};Action[_0x7025('0x23')][_0x7025('0x28')]=function(){return this['queue'];};module[_0x7025('0x29')]=Action;