10ba4d5c43ec4facef01344fe529624b8203827b
[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 _0x0cbb=['firstName','YYYY-MM-DD\x20HH:mm:ss','callback','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','phone','Contact','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ListId','UserId','CampaignId','idHopper'];(function(_0x30cd7e,_0x4db10a){var _0x462a02=function(_0x157d81){while(--_0x157d81){_0x30cd7e['push'](_0x30cd7e['shift']());}};_0x462a02(++_0x4db10a);}(_0x0cbb,0x8b));var _0xb0cb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0cbb[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xb0cb('0x0'));var _=require(_0xb0cb('0x1'));var moment=require(_0xb0cb('0x2'));function checkNameSurname(_0x2ff4ee,_0x583a6e,_0x31c360){var _0x2272b0='';if(!_[_0xb0cb('0x3')](_0x583a6e)&&_0xb0cb('0x4')===typeof _0x583a6e){_0x2272b0+=_0x583a6e;}if(!_['isNil'](_0x31c360)&&_0xb0cb('0x4')===typeof _0x31c360){_0x2272b0+='\x20'+_0x31c360;}if(_0x2272b0!==''){return _0x2272b0;}return _0x2ff4ee;}function Action(_0x17d2cb,_0x63c134,_0x2508ac){this[_0xb0cb('0x5')]=_0x17d2cb;this[_0xb0cb('0x6')]=_0x2508ac||undefined;this[_0xb0cb('0x7')]=checkNameSurname(_0x63c134['Contact'][_0xb0cb('0x8')],_0x63c134[_0xb0cb('0x9')]['firstName'],_0x63c134['Contact'][_0xb0cb('0xa')]);this[_0xb0cb('0xb')]=_0x63c134[_0xb0cb('0x8')];this[_0xb0cb('0xc')]=_0x17d2cb[_0xb0cb('0x7')];this[_0xb0cb('0xd')]=_0x63c134[_0xb0cb('0xd')]||![];this[_0xb0cb('0xe')]=_0x17d2cb[_0xb0cb('0xe')];this[_0xb0cb('0xf')]=_0x17d2cb[_0xb0cb('0xf')]||0x3;this[_0xb0cb('0x10')]=_0x63c134[_0xb0cb('0x10')];this['countbusyretry']=_0x63c134[_0xb0cb('0x11')];this[_0xb0cb('0x12')]=_0x63c134[_0xb0cb('0x12')];this[_0xb0cb('0x13')]=_0x63c134[_0xb0cb('0x13')];this['countnosuchnumberretry']=_0x63c134[_0xb0cb('0x14')];this[_0xb0cb('0x15')]=_0x63c134[_0xb0cb('0x15')];this[_0xb0cb('0x16')]=_0x63c134[_0xb0cb('0x16')];this[_0xb0cb('0x17')]=_0x63c134[_0xb0cb('0x17')];this[_0xb0cb('0x18')]=_0x63c134[_0xb0cb('0x18')];this['ContactId']=_0x63c134['ContactId'];this['ListId']=_0x63c134[_0xb0cb('0x19')];this[_0xb0cb('0x1a')]=_0x63c134[_0xb0cb('0x1a')];this['VoiceQueueId']=_0x63c134['VoiceQueueId'];this[_0xb0cb('0x1b')]=_0x63c134[_0xb0cb('0x1b')];this[_0xb0cb('0x1c')]=_0x63c134['id'];this['ContactFirstName']=_0x63c134[_0xb0cb('0x9')][_0xb0cb('0x1d')]||'';this['starttime']=moment()['format'](_0xb0cb('0x1e'));this[_0xb0cb('0x1f')]=_0x63c134[_0xb0cb('0x1f')];this['callbackuniqueid']=_0x63c134['callbackuniqueid'];this[_0xb0cb('0x20')]=_0x63c134['callbackat'];this[_0xb0cb('0x21')]=_0x63c134['recallme'];this[_0xb0cb('0x22')]='';this[_0xb0cb('0x23')]='';}Action[_0xb0cb('0x24')][_0xb0cb('0x25')]=function(){return util['format'](_0xb0cb('0x26'),this['name'],this[_0xb0cb('0x5')][_0xb0cb('0x27')]>0x0?this[_0xb0cb('0xb')]['substring'](this[_0xb0cb('0x5')][_0xb0cb('0x27')]):this[_0xb0cb('0xb')]);};Action['prototype'][_0xb0cb('0x28')]=function(){return this[_0xb0cb('0xc')];};module[_0xb0cb('0x29')]=Action;