712b765e6a2bd2c59f19ac00815692d040de027d
[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 _0xfde1=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','substring','dialCutDigit','number','getQueue','moment','isNil','string','voiceQueue','uniqueid','Contact','phone','lastName','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x4a4505,_0x338e67){var _0x1a5c8c=function(_0x1e7acb){while(--_0x1e7acb){_0x4a4505['push'](_0x4a4505['shift']());}};_0x1a5c8c(++_0x338e67);}(_0xfde1,0x76));var _0x1fde=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xfde1[_0x122ef9];return _0x42fba0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x1fde('0x0'));function checkNameSurname(_0x1762a8,_0x4bd4b7,_0x93c003){var _0x359774='';if(!_[_0x1fde('0x1')](_0x4bd4b7)&&_0x1fde('0x2')===typeof _0x4bd4b7){_0x359774+=_0x4bd4b7;}if(!_[_0x1fde('0x1')](_0x93c003)&&_0x1fde('0x2')===typeof _0x93c003){_0x359774+='\x20'+_0x93c003;}if(_0x359774!==''){return _0x359774;}return _0x1762a8;}function Action(_0x168458,_0x4da2a6,_0x58a302){this[_0x1fde('0x3')]=_0x168458;this[_0x1fde('0x4')]=_0x58a302||undefined;this['name']=checkNameSurname(_0x4da2a6[_0x1fde('0x5')][_0x1fde('0x6')],_0x4da2a6[_0x1fde('0x5')]['firstName'],_0x4da2a6[_0x1fde('0x5')][_0x1fde('0x7')]);this['number']=_0x4da2a6[_0x1fde('0x6')];this[_0x1fde('0x8')]=_0x168458[_0x1fde('0x9')];this[_0x1fde('0xa')]=_0x4da2a6['active']||![];this[_0x1fde('0xb')]=_0x168458[_0x1fde('0xb')];this[_0x1fde('0xc')]=_0x168458[_0x1fde('0xc')]||0x3;this[_0x1fde('0xd')]=_0x4da2a6[_0x1fde('0xd')];this[_0x1fde('0xe')]=_0x4da2a6[_0x1fde('0xe')];this[_0x1fde('0xf')]=_0x4da2a6[_0x1fde('0xf')];this[_0x1fde('0x10')]=_0x4da2a6[_0x1fde('0x10')];this['countnosuchnumberretry']=_0x4da2a6['countnosuchnumberretry'];this[_0x1fde('0x11')]=_0x4da2a6[_0x1fde('0x11')];this[_0x1fde('0x12')]=_0x4da2a6['countabandonedretry'];this[_0x1fde('0x13')]=_0x4da2a6['countmachineretry'];this[_0x1fde('0x14')]=_0x4da2a6['countagentrejectretry'];this['ContactId']=_0x4da2a6[_0x1fde('0x15')];this[_0x1fde('0x16')]=_0x4da2a6[_0x1fde('0x16')];this[_0x1fde('0x17')]=_0x4da2a6[_0x1fde('0x17')];this['VoiceQueueId']=_0x4da2a6[_0x1fde('0x18')];this[_0x1fde('0x19')]=_0x4da2a6[_0x1fde('0x19')];this[_0x1fde('0x1a')]=_0x4da2a6['id'];this[_0x1fde('0x1b')]=_0x4da2a6[_0x1fde('0x5')][_0x1fde('0x1c')]||'';this[_0x1fde('0x1d')]=moment()[_0x1fde('0x1e')](_0x1fde('0x1f'));this[_0x1fde('0x20')]=_0x4da2a6['callback'];this[_0x1fde('0x21')]=_0x4da2a6['callbackuniqueid'];this[_0x1fde('0x22')]=_0x4da2a6['callbackat'];this[_0x1fde('0x23')]=_0x4da2a6[_0x1fde('0x23')];this[_0x1fde('0x24')]='';this[_0x1fde('0x25')]='';}Action[_0x1fde('0x26')][_0x1fde('0x27')]=function(){return util['format'](_0x1fde('0x28'),this[_0x1fde('0x9')],this[_0x1fde('0x3')]['dialCutDigit']>0x0?this['number'][_0x1fde('0x29')](this[_0x1fde('0x3')][_0x1fde('0x2a')]):this[_0x1fde('0x2b')]);};Action[_0x1fde('0x26')][_0x1fde('0x2c')]=function(){return this['queue'];};module['exports']=Action;