8db27db5085fbb54f83b28dda31877085664cf5d
[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 _0xc1ca=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','voiceQueue','dialCutDigit','number','substring','exports','lodash','moment','isNil','string','uniqueid','name','Contact','firstName','lastName','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x5b1b1e,_0x12a719){var _0x33f8e8=function(_0x35c36a){while(--_0x35c36a){_0x5b1b1e['push'](_0x5b1b1e['shift']());}};_0x33f8e8(++_0x12a719);}(_0xc1ca,0xd4));var _0xac1c=function(_0x25e6ab,_0x58c0ec){_0x25e6ab=_0x25e6ab-0x0;var _0x574eea=_0xc1ca[_0x25e6ab];return _0x574eea;};'use strict';var util=require('util');var _=require(_0xac1c('0x0'));var moment=require(_0xac1c('0x1'));function checkNameSurname(_0x36f518,_0x34793a,_0x2b958b){var _0x4a2102='';if(!_[_0xac1c('0x2')](_0x34793a)&&_0xac1c('0x3')===typeof _0x34793a){_0x4a2102+=_0x34793a;}if(!_['isNil'](_0x2b958b)&&_0xac1c('0x3')===typeof _0x2b958b){_0x4a2102+='\x20'+_0x2b958b;}if(_0x4a2102!==''){return _0x4a2102;}return _0x36f518;}function Action(_0x4c40ad,_0x56706e,_0x15ba30){this['voiceQueue']=_0x4c40ad;this[_0xac1c('0x4')]=_0x15ba30||undefined;this[_0xac1c('0x5')]=checkNameSurname(_0x56706e[_0xac1c('0x6')]['phone'],_0x56706e[_0xac1c('0x6')][_0xac1c('0x7')],_0x56706e[_0xac1c('0x6')][_0xac1c('0x8')]);this['number']=_0x56706e[_0xac1c('0x9')];this[_0xac1c('0xa')]=_0x4c40ad[_0xac1c('0x5')];this[_0xac1c('0xb')]=_0x56706e['active']||![];this[_0xac1c('0xc')]=_0x4c40ad['type'];this[_0xac1c('0xd')]=_0x4c40ad[_0xac1c('0xd')]||0x3;this[_0xac1c('0xe')]=_0x56706e[_0xac1c('0xe')];this[_0xac1c('0xf')]=_0x56706e[_0xac1c('0xf')];this['countcongestionretry']=_0x56706e[_0xac1c('0x10')];this['countnoanswerretry']=_0x56706e[_0xac1c('0x11')];this[_0xac1c('0x12')]=_0x56706e['countnosuchnumberretry'];this['countdropretry']=_0x56706e[_0xac1c('0x13')];this[_0xac1c('0x14')]=_0x56706e[_0xac1c('0x14')];this['countmachineretry']=_0x56706e[_0xac1c('0x15')];this['countagentrejectretry']=_0x56706e[_0xac1c('0x16')];this[_0xac1c('0x17')]=_0x56706e[_0xac1c('0x17')];this[_0xac1c('0x18')]=_0x56706e['ListId'];this[_0xac1c('0x19')]=_0x56706e[_0xac1c('0x19')];this[_0xac1c('0x1a')]=_0x56706e[_0xac1c('0x1a')];this[_0xac1c('0x1b')]=_0x56706e['CampaignId'];this[_0xac1c('0x1c')]=_0x56706e['id'];this[_0xac1c('0x1d')]=_0x56706e[_0xac1c('0x6')]['firstName']||'';this[_0xac1c('0x1e')]=moment()[_0xac1c('0x1f')](_0xac1c('0x20'));this[_0xac1c('0x21')]=_0x56706e[_0xac1c('0x21')];this[_0xac1c('0x22')]=_0x56706e['callbackuniqueid'];this[_0xac1c('0x23')]=_0x56706e['callbackat'];this[_0xac1c('0x24')]=_0x56706e['recallme'];this[_0xac1c('0x25')]='';this[_0xac1c('0x26')]='';}Action[_0xac1c('0x27')][_0xac1c('0x28')]=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0xac1c('0x5')],this[_0xac1c('0x29')][_0xac1c('0x2a')]>0x0?this[_0xac1c('0x2b')][_0xac1c('0x2c')](this[_0xac1c('0x29')]['dialCutDigit']):this[_0xac1c('0x2b')]);};Action[_0xac1c('0x27')]['getQueue']=function(){return this[_0xac1c('0xa')];};module[_0xac1c('0x2d')]=Action;