Built motion from commit (unavailable).|2.5.3
[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 _0xbc8b=['callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','dialCutDigit','substring','prototype','getQueue','exports','lodash','isNil','string','voiceQueue','name','Contact','firstName','lastName','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback'];(function(_0x486236,_0x325e27){var _0x58d527=function(_0x4ad5f9){while(--_0x4ad5f9){_0x486236['push'](_0x486236['shift']());}};_0x58d527(++_0x325e27);}(_0xbc8b,0x16b));var _0xbbc8=function(_0x134827,_0x21f6ed){_0x134827=_0x134827-0x0;var _0x366671=_0xbc8b[_0x134827];return _0x366671;};'use strict';var util=require('util');var _=require(_0xbbc8('0x0'));var moment=require('moment');function checkNameSurname(_0x12415b,_0x258371,_0x472e52){var _0x1bb600='';if(!_[_0xbbc8('0x1')](_0x258371)&&_0xbbc8('0x2')===typeof _0x258371){_0x1bb600+=_0x258371;}if(!_['isNil'](_0x472e52)&&_0xbbc8('0x2')===typeof _0x472e52){_0x1bb600+='\x20'+_0x472e52;}if(_0x1bb600!==''){return _0x1bb600;}return _0x12415b;}function Action(_0x9ae972,_0x15cdc6,_0x21f15a){this[_0xbbc8('0x3')]=_0x9ae972;this['uniqueid']=_0x21f15a||undefined;this[_0xbbc8('0x4')]=checkNameSurname(_0x15cdc6[_0xbbc8('0x5')]['phone'],_0x15cdc6[_0xbbc8('0x5')][_0xbbc8('0x6')],_0x15cdc6[_0xbbc8('0x5')][_0xbbc8('0x7')]);this[_0xbbc8('0x8')]=_0x15cdc6[_0xbbc8('0x5')][_0xbbc8('0x9')];this[_0xbbc8('0xa')]=_0x9ae972[_0xbbc8('0x4')];this[_0xbbc8('0xb')]=_0x15cdc6[_0xbbc8('0xb')]||![];this[_0xbbc8('0xc')]=_0x9ae972['type'];this[_0xbbc8('0xd')]=_0x9ae972[_0xbbc8('0xd')]||0x3;this[_0xbbc8('0xe')]=_0x15cdc6['scheduledat'];this['countbusyretry']=_0x15cdc6[_0xbbc8('0xf')];this['countcongestionretry']=_0x15cdc6[_0xbbc8('0x10')];this[_0xbbc8('0x11')]=_0x15cdc6[_0xbbc8('0x11')];this[_0xbbc8('0x12')]=_0x15cdc6[_0xbbc8('0x12')];this[_0xbbc8('0x13')]=_0x15cdc6[_0xbbc8('0x13')];this[_0xbbc8('0x14')]=_0x15cdc6[_0xbbc8('0x14')];this[_0xbbc8('0x15')]=_0x15cdc6[_0xbbc8('0x15')];this[_0xbbc8('0x16')]=_0x15cdc6[_0xbbc8('0x16')];this[_0xbbc8('0x17')]=_0x15cdc6['ContactId'];this[_0xbbc8('0x18')]=_0x15cdc6[_0xbbc8('0x18')];this[_0xbbc8('0x19')]=_0x15cdc6[_0xbbc8('0x19')];this['VoiceQueueId']=_0x15cdc6[_0xbbc8('0x1a')];this['CampaignId']=_0x15cdc6[_0xbbc8('0x1b')];this[_0xbbc8('0x1c')]=_0x15cdc6['id'];this['ContactFirstName']=_0x15cdc6[_0xbbc8('0x5')][_0xbbc8('0x6')]||'';this[_0xbbc8('0x1d')]=moment()[_0xbbc8('0x1e')](_0xbbc8('0x1f'));this[_0xbbc8('0x20')]=_0x15cdc6[_0xbbc8('0x20')];this['callbackuniqueid']=_0x15cdc6[_0xbbc8('0x21')];this['callbackat']=_0x15cdc6[_0xbbc8('0x22')];this[_0xbbc8('0x23')]=_0x15cdc6[_0xbbc8('0x23')];this[_0xbbc8('0x24')]='';this[_0xbbc8('0x25')]='';}Action['prototype'][_0xbbc8('0x26')]=function(){return util[_0xbbc8('0x1e')]('\x22%s\x22\x20<%s>',this['name'],this['voiceQueue'][_0xbbc8('0x27')]>0x0?this[_0xbbc8('0x8')][_0xbbc8('0x28')](this[_0xbbc8('0x3')][_0xbbc8('0x27')]):this[_0xbbc8('0x8')]);};Action[_0xbbc8('0x29')][_0xbbc8('0x2a')]=function(){return this['queue'];};module[_0xbbc8('0x2b')]=Action;