3cba02ef60ec3c6ebee7239c4c9c2a9281aa3c0f
[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 _0x16e2=['\x22%s\x22\x20<%s>','dialCutDigit','substring','number','getQueue','exports','util','isNil','string','voiceQueue','uniqueid','name','phone','Contact','firstName','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller'];(function(_0x483d2b,_0x4a18d7){var _0x37524d=function(_0x544a03){while(--_0x544a03){_0x483d2b['push'](_0x483d2b['shift']());}};_0x37524d(++_0x4a18d7);}(_0x16e2,0x13a));var _0x216e=function(_0x1628c4,_0xf5244a){_0x1628c4=_0x1628c4-0x0;var _0xb4a5af=_0x16e2[_0x1628c4];return _0xb4a5af;};'use strict';var util=require(_0x216e('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x402155,_0x1e4abc,_0x54abcb){var _0x2db3b4='';if(!_[_0x216e('0x1')](_0x1e4abc)&&_0x216e('0x2')===typeof _0x1e4abc){_0x2db3b4+=_0x1e4abc;}if(!_[_0x216e('0x1')](_0x54abcb)&&_0x216e('0x2')===typeof _0x54abcb){_0x2db3b4+='\x20'+_0x54abcb;}if(_0x2db3b4!==''){return _0x2db3b4;}return _0x402155;}function Action(_0x4ea7f3,_0x202257,_0x3de8ee){this[_0x216e('0x3')]=_0x4ea7f3;this[_0x216e('0x4')]=_0x3de8ee||undefined;this[_0x216e('0x5')]=checkNameSurname(_0x202257['Contact'][_0x216e('0x6')],_0x202257[_0x216e('0x7')][_0x216e('0x8')],_0x202257[_0x216e('0x7')][_0x216e('0x9')]);this['number']=_0x202257['phone'];this[_0x216e('0xa')]=_0x4ea7f3[_0x216e('0x5')];this[_0x216e('0xb')]=_0x202257[_0x216e('0xb')]||![];this[_0x216e('0xc')]=_0x4ea7f3[_0x216e('0xc')];this[_0x216e('0xd')]=_0x4ea7f3[_0x216e('0xd')]||0x3;this[_0x216e('0xe')]=_0x202257[_0x216e('0xe')];this[_0x216e('0xf')]=_0x202257[_0x216e('0xf')];this[_0x216e('0x10')]=_0x202257[_0x216e('0x10')];this[_0x216e('0x11')]=_0x202257[_0x216e('0x11')];this['countnosuchnumberretry']=_0x202257[_0x216e('0x12')];this['countdropretry']=_0x202257[_0x216e('0x13')];this[_0x216e('0x14')]=_0x202257['countabandonedretry'];this[_0x216e('0x15')]=_0x202257['countmachineretry'];this[_0x216e('0x16')]=_0x202257[_0x216e('0x16')];this[_0x216e('0x17')]=_0x202257[_0x216e('0x17')];this[_0x216e('0x18')]=_0x202257[_0x216e('0x18')];this[_0x216e('0x19')]=_0x202257[_0x216e('0x19')];this[_0x216e('0x1a')]=_0x202257[_0x216e('0x1a')];this[_0x216e('0x1b')]=_0x202257[_0x216e('0x1b')];this[_0x216e('0x1c')]=_0x202257['id'];this['ContactFirstName']=_0x202257[_0x216e('0x7')][_0x216e('0x8')]||'';this['starttime']=moment()[_0x216e('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x216e('0x1e')]=_0x202257[_0x216e('0x1e')];this[_0x216e('0x1f')]=_0x202257['callbackuniqueid'];this[_0x216e('0x20')]=_0x202257[_0x216e('0x20')];this[_0x216e('0x21')]=_0x202257[_0x216e('0x21')];this[_0x216e('0x22')]='';this[_0x216e('0x23')]='';}Action[_0x216e('0x24')][_0x216e('0x25')]=function(){return util['format'](_0x216e('0x26'),this['name'],this[_0x216e('0x3')][_0x216e('0x27')]>0x0?this['number'][_0x216e('0x28')](this[_0x216e('0x3')]['dialCutDigit']):this[_0x216e('0x29')]);};Action[_0x216e('0x24')][_0x216e('0x2a')]=function(){return this['queue'];};module[_0x216e('0x2b')]=Action;