6ac0caf3180daeb0dd21be01a5ff9de1fb589987
[motion2.git] / server / services / ami / dialer / 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 _0x4200=['number','substring','getQueue','exports','lodash','isNil','string','voiceQueue','name','Contact','firstName','phone','queue','active','type','dialQueueTimeout','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','dialCutDigit'];(function(_0x229f4b,_0x210904){var _0x2086dc=function(_0x5eca20){while(--_0x5eca20){_0x229f4b['push'](_0x229f4b['shift']());}};_0x2086dc(++_0x210904);}(_0x4200,0x175));var _0x0420=function(_0x707d1,_0x2aee92){_0x707d1=_0x707d1-0x0;var _0x471a4e=_0x4200[_0x707d1];return _0x471a4e;};'use strict';var util=require('util');var _=require(_0x0420('0x0'));var moment=require('moment');function checkNameSurname(_0x3490fd,_0x330c0c,_0x5e1386){var _0x18667a='';if(!_[_0x0420('0x1')](_0x330c0c)&&_0x0420('0x2')===typeof _0x330c0c){_0x18667a+=_0x330c0c;}if(!_[_0x0420('0x1')](_0x5e1386)&&_0x0420('0x2')===typeof _0x5e1386){_0x18667a+='\x20'+_0x5e1386;}if(_0x18667a!==''){return _0x18667a;}return _0x3490fd;}function Action(_0x42bd3e,_0x18281e,_0x3ac834){this[_0x0420('0x3')]=_0x42bd3e;this['uniqueid']=_0x3ac834||undefined;this[_0x0420('0x4')]=checkNameSurname(_0x18281e[_0x0420('0x5')]['phone'],_0x18281e[_0x0420('0x5')][_0x0420('0x6')],_0x18281e[_0x0420('0x5')]['lastName']);this['number']=_0x18281e[_0x0420('0x7')];this[_0x0420('0x8')]=_0x42bd3e[_0x0420('0x4')];this[_0x0420('0x9')]=_0x18281e['active']||![];this[_0x0420('0xa')]=_0x42bd3e['type'];this['dialQueueTimeout']=_0x42bd3e[_0x0420('0xb')]||0x3;this['scheduledat']=_0x18281e['scheduledat'];this['countbusyretry']=_0x18281e['countbusyretry'];this['countcongestionretry']=_0x18281e[_0x0420('0xc')];this[_0x0420('0xd')]=_0x18281e[_0x0420('0xd')];this[_0x0420('0xe')]=_0x18281e['countnosuchnumberretry'];this[_0x0420('0xf')]=_0x18281e[_0x0420('0xf')];this[_0x0420('0x10')]=_0x18281e['countabandonedretry'];this[_0x0420('0x11')]=_0x18281e[_0x0420('0x11')];this[_0x0420('0x12')]=_0x18281e[_0x0420('0x12')];this[_0x0420('0x13')]=_0x18281e[_0x0420('0x13')];this[_0x0420('0x14')]=_0x18281e[_0x0420('0x14')];this[_0x0420('0x15')]=_0x18281e[_0x0420('0x15')];this['VoiceQueueId']=_0x18281e[_0x0420('0x16')];this[_0x0420('0x17')]=_0x18281e[_0x0420('0x17')];this[_0x0420('0x18')]=_0x18281e['id'];this[_0x0420('0x19')]=_0x18281e[_0x0420('0x5')][_0x0420('0x6')]||'';this[_0x0420('0x1a')]=moment()[_0x0420('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x18281e[_0x0420('0x1c')];this[_0x0420('0x1d')]=_0x18281e['callbackuniqueid'];this[_0x0420('0x1e')]=_0x18281e[_0x0420('0x1e')];this[_0x0420('0x1f')]=_0x18281e[_0x0420('0x1f')];this[_0x0420('0x20')]='';this[_0x0420('0x21')]='';}Action[_0x0420('0x22')]['getCaller']=function(){return util['format'](_0x0420('0x23'),this['name'],this['voiceQueue'][_0x0420('0x24')]>0x0?this[_0x0420('0x25')][_0x0420('0x26')](this[_0x0420('0x3')][_0x0420('0x24')]):this[_0x0420('0x25')]);};Action['prototype'][_0x0420('0x27')]=function(){return this['queue'];};module[_0x0420('0x28')]=Action;