Built motion from commit (unavailable).|2.5.6
[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 _0xe0f5=['countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','firstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','substring','queue','util','lodash','moment','isNil','string','uniqueid','Contact','phone','lastName','number','type','dialQueueTimeout','scheduledat'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0xe0f5,0xfd));var _0x5e0f=function(_0x3bf975,_0x5a749b){_0x3bf975=_0x3bf975-0x0;var _0x5af02d=_0xe0f5[_0x3bf975];return _0x5af02d;};'use strict';var util=require(_0x5e0f('0x0'));var _=require(_0x5e0f('0x1'));var moment=require(_0x5e0f('0x2'));function checkNameSurname(_0x130429,_0x5406d7,_0x198f89){var _0x2a019d='';if(!_[_0x5e0f('0x3')](_0x5406d7)&&_0x5e0f('0x4')===typeof _0x5406d7){_0x2a019d+=_0x5406d7;}if(!_[_0x5e0f('0x3')](_0x198f89)&&_0x5e0f('0x4')===typeof _0x198f89){_0x2a019d+='\x20'+_0x198f89;}if(_0x2a019d!==''){return _0x2a019d;}return _0x130429;}function Action(_0x4e0cfe,_0x46aaa3,_0x49959a){this['voiceQueue']=_0x4e0cfe;this[_0x5e0f('0x5')]=_0x49959a||undefined;this['name']=checkNameSurname(_0x46aaa3[_0x5e0f('0x6')][_0x5e0f('0x7')],_0x46aaa3[_0x5e0f('0x6')]['firstName'],_0x46aaa3[_0x5e0f('0x6')][_0x5e0f('0x8')]);this[_0x5e0f('0x9')]=_0x46aaa3[_0x5e0f('0x6')][_0x5e0f('0x7')];this['queue']=_0x4e0cfe['name'];this['active']=_0x46aaa3['active']||![];this[_0x5e0f('0xa')]=_0x4e0cfe[_0x5e0f('0xa')];this['dialQueueTimeout']=_0x4e0cfe[_0x5e0f('0xb')]||0x3;this[_0x5e0f('0xc')]=_0x46aaa3[_0x5e0f('0xc')];this[_0x5e0f('0xd')]=_0x46aaa3['countbusyretry'];this[_0x5e0f('0xe')]=_0x46aaa3[_0x5e0f('0xe')];this['countnoanswerretry']=_0x46aaa3[_0x5e0f('0xf')];this[_0x5e0f('0x10')]=_0x46aaa3[_0x5e0f('0x10')];this['countdropretry']=_0x46aaa3[_0x5e0f('0x11')];this['countabandonedretry']=_0x46aaa3['countabandonedretry'];this['countmachineretry']=_0x46aaa3[_0x5e0f('0x12')];this[_0x5e0f('0x13')]=_0x46aaa3[_0x5e0f('0x13')];this[_0x5e0f('0x14')]=_0x46aaa3[_0x5e0f('0x14')];this[_0x5e0f('0x15')]=_0x46aaa3['ListId'];this['UserId']=_0x46aaa3[_0x5e0f('0x16')];this[_0x5e0f('0x17')]=_0x46aaa3[_0x5e0f('0x17')];this['CampaignId']=_0x46aaa3[_0x5e0f('0x18')];this[_0x5e0f('0x19')]=_0x46aaa3['id'];this['ContactFirstName']=_0x46aaa3[_0x5e0f('0x6')][_0x5e0f('0x1a')]||'';this['starttime']=moment()[_0x5e0f('0x1b')](_0x5e0f('0x1c'));this[_0x5e0f('0x1d')]=_0x46aaa3['callback'];this[_0x5e0f('0x1e')]=_0x46aaa3[_0x5e0f('0x1e')];this['callbackat']=_0x46aaa3['callbackat'];this['recallme']=_0x46aaa3['recallme'];this[_0x5e0f('0x1f')]='';this[_0x5e0f('0x20')]='';}Action[_0x5e0f('0x21')][_0x5e0f('0x22')]=function(){return util[_0x5e0f('0x1b')](_0x5e0f('0x23'),this['name'],this['voiceQueue']['dialCutDigit']>0x0?this[_0x5e0f('0x9')][_0x5e0f('0x24')](this['voiceQueue']['dialCutDigit']):this[_0x5e0f('0x9')]);};Action[_0x5e0f('0x21')]['getQueue']=function(){return this[_0x5e0f('0x25')];};module['exports']=Action;