Built motion from commit 449495f6.|2.6.27
[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 _0x92a0=['recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','format','substring','dialCutDigit','getQueue','exports','lodash','isNil','string','voiceQueue','uniqueid','name','Contact','firstName','lastName','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','idHopper','ContactFirstName','callback','callbackuniqueid'];(function(_0x384e65,_0x1944de){var _0x547015=function(_0x104f32){while(--_0x104f32){_0x384e65['push'](_0x384e65['shift']());}};_0x547015(++_0x1944de);}(_0x92a0,0x1d8));var _0x092a=function(_0x48f7cf,_0x4baa04){_0x48f7cf=_0x48f7cf-0x0;var _0xc201c0=_0x92a0[_0x48f7cf];return _0xc201c0;};'use strict';var util=require('util');var _=require(_0x092a('0x0'));var moment=require('moment');function checkNameSurname(_0x5f20f4,_0x17850f,_0x5ebd24){var _0x3d11fd='';if(!_[_0x092a('0x1')](_0x17850f)&&_0x092a('0x2')===typeof _0x17850f){_0x3d11fd+=_0x17850f;}if(!_['isNil'](_0x5ebd24)&&_0x092a('0x2')===typeof _0x5ebd24){_0x3d11fd+='\x20'+_0x5ebd24;}if(_0x3d11fd!==''){return _0x3d11fd;}return _0x5f20f4;}function Action(_0x13d59c,_0x3d324a,_0x50210b){this[_0x092a('0x3')]=_0x13d59c;this[_0x092a('0x4')]=_0x50210b||undefined;this[_0x092a('0x5')]=checkNameSurname(_0x3d324a['Contact']['phone'],_0x3d324a[_0x092a('0x6')][_0x092a('0x7')],_0x3d324a['Contact'][_0x092a('0x8')]);this[_0x092a('0x9')]=_0x3d324a[_0x092a('0xa')];this[_0x092a('0xb')]=_0x13d59c[_0x092a('0x5')];this[_0x092a('0xc')]=_0x3d324a[_0x092a('0xc')]||![];this[_0x092a('0xd')]=_0x13d59c[_0x092a('0xd')];this[_0x092a('0xe')]=_0x13d59c[_0x092a('0xe')]||0x3;this[_0x092a('0xf')]=_0x3d324a[_0x092a('0xf')];this[_0x092a('0x10')]=_0x3d324a['countbusyretry'];this['countcongestionretry']=_0x3d324a[_0x092a('0x11')];this['countnoanswerretry']=_0x3d324a[_0x092a('0x12')];this[_0x092a('0x13')]=_0x3d324a[_0x092a('0x13')];this[_0x092a('0x14')]=_0x3d324a[_0x092a('0x14')];this[_0x092a('0x15')]=_0x3d324a[_0x092a('0x15')];this[_0x092a('0x16')]=_0x3d324a[_0x092a('0x16')];this[_0x092a('0x17')]=_0x3d324a[_0x092a('0x17')];this[_0x092a('0x18')]=_0x3d324a[_0x092a('0x18')];this['ListId']=_0x3d324a[_0x092a('0x19')];this[_0x092a('0x1a')]=_0x3d324a[_0x092a('0x1a')];this[_0x092a('0x1b')]=_0x3d324a['VoiceQueueId'];this['CampaignId']=_0x3d324a['CampaignId'];this[_0x092a('0x1c')]=_0x3d324a['id'];this[_0x092a('0x1d')]=_0x3d324a[_0x092a('0x6')][_0x092a('0x7')]||'';this['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x092a('0x1e')]=_0x3d324a[_0x092a('0x1e')];this[_0x092a('0x1f')]=_0x3d324a[_0x092a('0x1f')];this['callbackat']=_0x3d324a['callbackat'];this[_0x092a('0x20')]=_0x3d324a[_0x092a('0x20')];this[_0x092a('0x21')]='';this[_0x092a('0x22')]='';}Action[_0x092a('0x23')][_0x092a('0x24')]=function(){return util[_0x092a('0x25')]('\x22%s\x22\x20<%s>',this[_0x092a('0x5')],this[_0x092a('0x3')]['dialCutDigit']>0x0?this['number'][_0x092a('0x26')](this['voiceQueue'][_0x092a('0x27')]):this[_0x092a('0x9')]);};Action['prototype'][_0x092a('0x28')]=function(){return this['queue'];};module[_0x092a('0x29')]=Action;