f4a95553fa4c2696d3f04321389103e8bfac6c38
[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 _0xcd37=['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','exports','util','lodash','isNil','string','voiceQueue','uniqueid','name','Contact','firstName','lastName','number','phone','queue','active','type','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry'];(function(_0x1f4c3c,_0x43ea33){var _0x4c8c4c=function(_0x350845){while(--_0x350845){_0x1f4c3c['push'](_0x1f4c3c['shift']());}};_0x4c8c4c(++_0x43ea33);}(_0xcd37,0xee));var _0x7cd3=function(_0x38779f,_0x5db949){_0x38779f=_0x38779f-0x0;var _0x219989=_0xcd37[_0x38779f];return _0x219989;};'use strict';var util=require(_0x7cd3('0x0'));var _=require(_0x7cd3('0x1'));var moment=require('moment');function checkNameSurname(_0x455c7a,_0x10f52e,_0x243e26){var _0x185ce6='';if(!_[_0x7cd3('0x2')](_0x10f52e)&&'string'===typeof _0x10f52e){_0x185ce6+=_0x10f52e;}if(!_[_0x7cd3('0x2')](_0x243e26)&&_0x7cd3('0x3')===typeof _0x243e26){_0x185ce6+='\x20'+_0x243e26;}if(_0x185ce6!==''){return _0x185ce6;}return _0x455c7a;}function Action(_0x15a509,_0xafd6f4,_0x5d024c){this[_0x7cd3('0x4')]=_0x15a509;this[_0x7cd3('0x5')]=_0x5d024c||undefined;this[_0x7cd3('0x6')]=checkNameSurname(_0xafd6f4[_0x7cd3('0x7')]['phone'],_0xafd6f4[_0x7cd3('0x7')][_0x7cd3('0x8')],_0xafd6f4[_0x7cd3('0x7')][_0x7cd3('0x9')]);this[_0x7cd3('0xa')]=_0xafd6f4[_0x7cd3('0x7')][_0x7cd3('0xb')];this[_0x7cd3('0xc')]=_0x15a509[_0x7cd3('0x6')];this['active']=_0xafd6f4[_0x7cd3('0xd')]||![];this[_0x7cd3('0xe')]=_0x15a509[_0x7cd3('0xe')];this[_0x7cd3('0xf')]=_0x15a509['dialQueueTimeout']||0x3;this['scheduledat']=_0xafd6f4['scheduledat'];this['countbusyretry']=_0xafd6f4[_0x7cd3('0x10')];this[_0x7cd3('0x11')]=_0xafd6f4[_0x7cd3('0x11')];this[_0x7cd3('0x12')]=_0xafd6f4['countnoanswerretry'];this[_0x7cd3('0x13')]=_0xafd6f4[_0x7cd3('0x13')];this[_0x7cd3('0x14')]=_0xafd6f4[_0x7cd3('0x14')];this[_0x7cd3('0x15')]=_0xafd6f4['countabandonedretry'];this['countmachineretry']=_0xafd6f4[_0x7cd3('0x16')];this['countagentrejectretry']=_0xafd6f4[_0x7cd3('0x17')];this[_0x7cd3('0x18')]=_0xafd6f4[_0x7cd3('0x18')];this['ListId']=_0xafd6f4[_0x7cd3('0x19')];this[_0x7cd3('0x1a')]=_0xafd6f4[_0x7cd3('0x1a')];this[_0x7cd3('0x1b')]=_0xafd6f4[_0x7cd3('0x1b')];this['CampaignId']=_0xafd6f4[_0x7cd3('0x1c')];this[_0x7cd3('0x1d')]=_0xafd6f4['id'];this[_0x7cd3('0x1e')]=_0xafd6f4[_0x7cd3('0x7')][_0x7cd3('0x8')]||'';this[_0x7cd3('0x1f')]=moment()[_0x7cd3('0x20')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7cd3('0x21')]=_0xafd6f4[_0x7cd3('0x21')];this['callbackuniqueid']=_0xafd6f4[_0x7cd3('0x22')];this[_0x7cd3('0x23')]=_0xafd6f4[_0x7cd3('0x23')];this[_0x7cd3('0x24')]=_0xafd6f4['recallme'];this[_0x7cd3('0x25')]='';this[_0x7cd3('0x26')]='';}Action[_0x7cd3('0x27')]['getCaller']=function(){return util['format'](_0x7cd3('0x28'),this[_0x7cd3('0x6')],this[_0x7cd3('0x4')][_0x7cd3('0x29')]>0x0?this[_0x7cd3('0xa')]['substring'](this[_0x7cd3('0x4')]['dialCutDigit']):this[_0x7cd3('0xa')]);};Action['prototype']['getQueue']=function(){return this[_0x7cd3('0xc')];};module[_0x7cd3('0x2a')]=Action;