6cf9314ac17839025ffadab1afcd96685134a01f
[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 _0xc4e6=['callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','voiceQueue','substring','dialCutDigit','getQueue','exports','util','lodash','string','isNil','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback'];(function(_0x3432ca,_0x77ca){var _0x450277=function(_0x331cb6){while(--_0x331cb6){_0x3432ca['push'](_0x3432ca['shift']());}};_0x450277(++_0x77ca);}(_0xc4e6,0x1d9));var _0x6c4e=function(_0x545a3a,_0x3123aa){_0x545a3a=_0x545a3a-0x0;var _0x5a5493=_0xc4e6[_0x545a3a];return _0x5a5493;};'use strict';var util=require(_0x6c4e('0x0'));var _=require(_0x6c4e('0x1'));var moment=require('moment');function checkNameSurname(_0x79153b,_0x1b3896,_0x86fe20){var _0x399a44='';if(!_['isNil'](_0x1b3896)&&_0x6c4e('0x2')===typeof _0x1b3896){_0x399a44+=_0x1b3896;}if(!_[_0x6c4e('0x3')](_0x86fe20)&&_0x6c4e('0x2')===typeof _0x86fe20){_0x399a44+='\x20'+_0x86fe20;}if(_0x399a44!==''){return _0x399a44;}return _0x79153b;}function Action(_0x5d8d70,_0x266061,_0x587927){this['voiceQueue']=_0x5d8d70;this[_0x6c4e('0x4')]=_0x587927||undefined;this[_0x6c4e('0x5')]=checkNameSurname(_0x266061[_0x6c4e('0x6')][_0x6c4e('0x7')],_0x266061[_0x6c4e('0x6')][_0x6c4e('0x8')],_0x266061[_0x6c4e('0x6')][_0x6c4e('0x9')]);this[_0x6c4e('0xa')]=_0x266061[_0x6c4e('0x6')][_0x6c4e('0x7')];this[_0x6c4e('0xb')]=_0x5d8d70['name'];this['active']=_0x266061[_0x6c4e('0xc')]||![];this[_0x6c4e('0xd')]=_0x5d8d70[_0x6c4e('0xd')];this['dialQueueTimeout']=_0x5d8d70[_0x6c4e('0xe')]||0x3;this[_0x6c4e('0xf')]=_0x266061[_0x6c4e('0xf')];this[_0x6c4e('0x10')]=_0x266061['countbusyretry'];this[_0x6c4e('0x11')]=_0x266061[_0x6c4e('0x11')];this[_0x6c4e('0x12')]=_0x266061[_0x6c4e('0x12')];this[_0x6c4e('0x13')]=_0x266061['countnosuchnumberretry'];this[_0x6c4e('0x14')]=_0x266061[_0x6c4e('0x14')];this[_0x6c4e('0x15')]=_0x266061['countabandonedretry'];this['countmachineretry']=_0x266061['countmachineretry'];this['countagentrejectretry']=_0x266061[_0x6c4e('0x16')];this[_0x6c4e('0x17')]=_0x266061[_0x6c4e('0x17')];this['ListId']=_0x266061[_0x6c4e('0x18')];this[_0x6c4e('0x19')]=_0x266061['UserId'];this[_0x6c4e('0x1a')]=_0x266061['VoiceQueueId'];this[_0x6c4e('0x1b')]=_0x266061[_0x6c4e('0x1b')];this[_0x6c4e('0x1c')]=_0x266061['id'];this[_0x6c4e('0x1d')]=_0x266061['Contact'][_0x6c4e('0x8')]||'';this[_0x6c4e('0x1e')]=moment()['format'](_0x6c4e('0x1f'));this[_0x6c4e('0x20')]=_0x266061[_0x6c4e('0x20')];this[_0x6c4e('0x21')]=_0x266061[_0x6c4e('0x21')];this['callbackat']=_0x266061[_0x6c4e('0x22')];this[_0x6c4e('0x23')]=_0x266061['recallme'];this['originatecalleridnum']='';this[_0x6c4e('0x24')]='';}Action[_0x6c4e('0x25')][_0x6c4e('0x26')]=function(){return util[_0x6c4e('0x27')](_0x6c4e('0x28'),this[_0x6c4e('0x5')],this[_0x6c4e('0x29')]['dialCutDigit']>0x0?this[_0x6c4e('0xa')][_0x6c4e('0x2a')](this[_0x6c4e('0x29')][_0x6c4e('0x2b')]):this['number']);};Action[_0x6c4e('0x25')][_0x6c4e('0x2c')]=function(){return this[_0x6c4e('0xb')];};module[_0x6c4e('0x2d')]=Action;