Built motion from commit (unavailable).|2.5.4
[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 _0x4ded=['scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','CampaignId','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','\x22%s\x22\x20<%s>','substring','dialCutDigit','prototype','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','name','Contact','phone','lastName','number','queue','active','type','dialQueueTimeout'];(function(_0x4a4d88,_0x2be95a){var _0x479329=function(_0x37bb8e){while(--_0x37bb8e){_0x4a4d88['push'](_0x4a4d88['shift']());}};_0x479329(++_0x2be95a);}(_0x4ded,0xf3));var _0xd4de=function(_0x218071,_0x7a9c21){_0x218071=_0x218071-0x0;var _0x560737=_0x4ded[_0x218071];return _0x560737;};'use strict';var util=require(_0xd4de('0x0'));var _=require(_0xd4de('0x1'));var moment=require(_0xd4de('0x2'));function checkNameSurname(_0x113629,_0x8f179f,_0x23f5ba){var _0x256a8c='';if(!_[_0xd4de('0x3')](_0x8f179f)&&_0xd4de('0x4')===typeof _0x8f179f){_0x256a8c+=_0x8f179f;}if(!_['isNil'](_0x23f5ba)&&_0xd4de('0x4')===typeof _0x23f5ba){_0x256a8c+='\x20'+_0x23f5ba;}if(_0x256a8c!==''){return _0x256a8c;}return _0x113629;}function Action(_0x28661a,_0x1b9510,_0x71865e){this[_0xd4de('0x5')]=_0x28661a;this['uniqueid']=_0x71865e||undefined;this[_0xd4de('0x6')]=checkNameSurname(_0x1b9510[_0xd4de('0x7')][_0xd4de('0x8')],_0x1b9510[_0xd4de('0x7')]['firstName'],_0x1b9510[_0xd4de('0x7')][_0xd4de('0x9')]);this[_0xd4de('0xa')]=_0x1b9510[_0xd4de('0x7')]['phone'];this[_0xd4de('0xb')]=_0x28661a[_0xd4de('0x6')];this[_0xd4de('0xc')]=_0x1b9510[_0xd4de('0xc')]||![];this[_0xd4de('0xd')]=_0x28661a[_0xd4de('0xd')];this[_0xd4de('0xe')]=_0x28661a[_0xd4de('0xe')]||0x3;this['scheduledat']=_0x1b9510[_0xd4de('0xf')];this[_0xd4de('0x10')]=_0x1b9510[_0xd4de('0x10')];this[_0xd4de('0x11')]=_0x1b9510[_0xd4de('0x11')];this[_0xd4de('0x12')]=_0x1b9510[_0xd4de('0x12')];this[_0xd4de('0x13')]=_0x1b9510['countnosuchnumberretry'];this['countdropretry']=_0x1b9510['countdropretry'];this[_0xd4de('0x14')]=_0x1b9510[_0xd4de('0x14')];this[_0xd4de('0x15')]=_0x1b9510['countmachineretry'];this['countagentrejectretry']=_0x1b9510[_0xd4de('0x16')];this[_0xd4de('0x17')]=_0x1b9510[_0xd4de('0x17')];this[_0xd4de('0x18')]=_0x1b9510[_0xd4de('0x18')];this[_0xd4de('0x19')]=_0x1b9510[_0xd4de('0x19')];this['VoiceQueueId']=_0x1b9510['VoiceQueueId'];this[_0xd4de('0x1a')]=_0x1b9510['CampaignId'];this['idHopper']=_0x1b9510['id'];this[_0xd4de('0x1b')]=_0x1b9510[_0xd4de('0x7')][_0xd4de('0x1c')]||'';this[_0xd4de('0x1d')]=moment()[_0xd4de('0x1e')](_0xd4de('0x1f'));this[_0xd4de('0x20')]=_0x1b9510['callback'];this[_0xd4de('0x21')]=_0x1b9510[_0xd4de('0x21')];this[_0xd4de('0x22')]=_0x1b9510[_0xd4de('0x22')];this['recallme']=_0x1b9510[_0xd4de('0x23')];this['originatecalleridnum']='';this[_0xd4de('0x24')]='';}Action['prototype']['getCaller']=function(){return util[_0xd4de('0x1e')](_0xd4de('0x25'),this[_0xd4de('0x6')],this[_0xd4de('0x5')]['dialCutDigit']>0x0?this['number'][_0xd4de('0x26')](this[_0xd4de('0x5')][_0xd4de('0x27')]):this[_0xd4de('0xa')]);};Action[_0xd4de('0x28')][_0xd4de('0x29')]=function(){return this['queue'];};module[_0xd4de('0x2a')]=Action;