Built motion from commit d5e4af8c.|2.6.23
[motion2.git] / server / services / ami / dialer / models / 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 _0x1146=['isNil','voiceQueue','uniqueid','name','phone','Contact','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','prototype','getCaller','format','\x22%s\x22\x20<%s>','substring','dialCutDigit','getQueue','exports','util','lodash','moment','string'];(function(_0x3c1cc0,_0x286ab8){var _0x136153=function(_0x3c5adb){while(--_0x3c5adb){_0x3c1cc0['push'](_0x3c1cc0['shift']());}};_0x136153(++_0x286ab8);}(_0x1146,0xb4));var _0x6114=function(_0xc47837,_0x4c8a63){_0xc47837=_0xc47837-0x0;var _0x376bb7=_0x1146[_0xc47837];return _0x376bb7;};'use strict';var util=require(_0x6114('0x0'));var _=require(_0x6114('0x1'));var moment=require(_0x6114('0x2'));function checkNameSurname(_0x20a0c1,_0x3ccb7e,_0x365518){var _0x4ddc4e='';if(!_['isNil'](_0x3ccb7e)&&_0x6114('0x3')===typeof _0x3ccb7e){_0x4ddc4e+=_0x3ccb7e;}if(!_[_0x6114('0x4')](_0x365518)&&_0x6114('0x3')===typeof _0x365518){_0x4ddc4e+='\x20'+_0x365518;}if(_0x4ddc4e!==''){return _0x4ddc4e;}return _0x20a0c1;}function Action(_0x57b843,_0x4b365b,_0x31fd32){this[_0x6114('0x5')]=_0x57b843;this[_0x6114('0x6')]=_0x31fd32||undefined;this[_0x6114('0x7')]=checkNameSurname(_0x4b365b['Contact'][_0x6114('0x8')],_0x4b365b[_0x6114('0x9')][_0x6114('0xa')],_0x4b365b[_0x6114('0x9')][_0x6114('0xb')]);this[_0x6114('0xc')]=_0x4b365b[_0x6114('0x8')];this[_0x6114('0xd')]=_0x57b843['name'];this[_0x6114('0xe')]=_0x4b365b[_0x6114('0xe')]||![];this[_0x6114('0xf')]=_0x57b843[_0x6114('0xf')];this[_0x6114('0x10')]=_0x57b843[_0x6114('0x10')]||0x3;this[_0x6114('0x11')]=_0x4b365b[_0x6114('0x11')];this[_0x6114('0x12')]=_0x4b365b[_0x6114('0x12')];this[_0x6114('0x13')]=_0x4b365b[_0x6114('0x13')];this[_0x6114('0x14')]=_0x4b365b[_0x6114('0x14')];this[_0x6114('0x15')]=_0x4b365b[_0x6114('0x15')];this['countdropretry']=_0x4b365b[_0x6114('0x16')];this[_0x6114('0x17')]=_0x4b365b[_0x6114('0x17')];this[_0x6114('0x18')]=_0x4b365b['countmachineretry'];this[_0x6114('0x19')]=_0x4b365b['countagentrejectretry'];this[_0x6114('0x1a')]=_0x4b365b[_0x6114('0x1a')];this[_0x6114('0x1b')]=_0x4b365b[_0x6114('0x1b')];this[_0x6114('0x1c')]=_0x4b365b[_0x6114('0x1c')];this['VoiceQueueId']=_0x4b365b[_0x6114('0x1d')];this[_0x6114('0x1e')]=_0x4b365b[_0x6114('0x1e')];this[_0x6114('0x1f')]=_0x4b365b['id'];this['ContactFirstName']=_0x4b365b[_0x6114('0x9')][_0x6114('0xa')]||'';this[_0x6114('0x20')]=moment()['format'](_0x6114('0x21'));this[_0x6114('0x22')]=_0x4b365b[_0x6114('0x22')];this[_0x6114('0x23')]=_0x4b365b['callbackuniqueid'];this[_0x6114('0x24')]=_0x4b365b[_0x6114('0x24')];this[_0x6114('0x25')]=_0x4b365b[_0x6114('0x25')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x6114('0x26')][_0x6114('0x27')]=function(){return util[_0x6114('0x28')](_0x6114('0x29'),this[_0x6114('0x7')],this[_0x6114('0x5')]['dialCutDigit']>0x0?this[_0x6114('0xc')][_0x6114('0x2a')](this['voiceQueue'][_0x6114('0x2b')]):this['number']);};Action[_0x6114('0x26')][_0x6114('0x2c')]=function(){return this[_0x6114('0xd')];};module[_0x6114('0x2d')]=Action;