Built motion from commit 1ea47bf4.|2.6.34
[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 _0x1b74=['\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','queue','exports','lodash','moment','string','voiceQueue','uniqueid','name','Contact','phone','firstName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller'];(function(_0xf78723,_0x488321){var _0x18e59c=function(_0x3eacb6){while(--_0x3eacb6){_0xf78723['push'](_0xf78723['shift']());}};_0x18e59c(++_0x488321);}(_0x1b74,0xbe));var _0x41b7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1b74[_0x20a584];return _0x4b41a8;};'use strict';var util=require('util');var _=require(_0x41b7('0x0'));var moment=require(_0x41b7('0x1'));function checkNameSurname(_0x2b48e6,_0x1e41fe,_0xe3bdb6){var _0x2e54da='';if(!_['isNil'](_0x1e41fe)&&_0x41b7('0x2')===typeof _0x1e41fe){_0x2e54da+=_0x1e41fe;}if(!_['isNil'](_0xe3bdb6)&&'string'===typeof _0xe3bdb6){_0x2e54da+='\x20'+_0xe3bdb6;}if(_0x2e54da!==''){return _0x2e54da;}return _0x2b48e6;}function Action(_0x4b0ca0,_0x565e15,_0xb6a97f){this[_0x41b7('0x3')]=_0x4b0ca0;this[_0x41b7('0x4')]=_0xb6a97f||undefined;this[_0x41b7('0x5')]=checkNameSurname(_0x565e15[_0x41b7('0x6')][_0x41b7('0x7')],_0x565e15[_0x41b7('0x6')][_0x41b7('0x8')],_0x565e15[_0x41b7('0x6')]['lastName']);this[_0x41b7('0x9')]=_0x565e15['phone'];this['queue']=_0x4b0ca0['name'];this['active']=_0x565e15[_0x41b7('0xa')]||![];this[_0x41b7('0xb')]=_0x4b0ca0[_0x41b7('0xb')];this['dialQueueTimeout']=_0x4b0ca0[_0x41b7('0xc')]||0x3;this[_0x41b7('0xd')]=_0x565e15[_0x41b7('0xd')];this[_0x41b7('0xe')]=_0x565e15['countbusyretry'];this[_0x41b7('0xf')]=_0x565e15['countcongestionretry'];this[_0x41b7('0x10')]=_0x565e15[_0x41b7('0x10')];this[_0x41b7('0x11')]=_0x565e15[_0x41b7('0x11')];this[_0x41b7('0x12')]=_0x565e15['countdropretry'];this['countabandonedretry']=_0x565e15[_0x41b7('0x13')];this[_0x41b7('0x14')]=_0x565e15[_0x41b7('0x14')];this['countagentrejectretry']=_0x565e15[_0x41b7('0x15')];this[_0x41b7('0x16')]=_0x565e15['ContactId'];this[_0x41b7('0x17')]=_0x565e15[_0x41b7('0x17')];this[_0x41b7('0x18')]=_0x565e15[_0x41b7('0x18')];this[_0x41b7('0x19')]=_0x565e15[_0x41b7('0x19')];this[_0x41b7('0x1a')]=_0x565e15[_0x41b7('0x1a')];this[_0x41b7('0x1b')]=_0x565e15['id'];this[_0x41b7('0x1c')]=_0x565e15['Contact']['firstName']||'';this[_0x41b7('0x1d')]=moment()[_0x41b7('0x1e')](_0x41b7('0x1f'));this['callback']=_0x565e15[_0x41b7('0x20')];this[_0x41b7('0x21')]=_0x565e15[_0x41b7('0x21')];this[_0x41b7('0x22')]=_0x565e15[_0x41b7('0x22')];this[_0x41b7('0x23')]=_0x565e15[_0x41b7('0x23')];this[_0x41b7('0x24')]='';this[_0x41b7('0x25')]='';}Action[_0x41b7('0x26')][_0x41b7('0x27')]=function(){return util[_0x41b7('0x1e')](_0x41b7('0x28'),this[_0x41b7('0x5')],this[_0x41b7('0x3')][_0x41b7('0x29')]>0x0?this[_0x41b7('0x9')][_0x41b7('0x2a')](this['voiceQueue'][_0x41b7('0x29')]):this['number']);};Action[_0x41b7('0x26')][_0x41b7('0x2b')]=function(){return this[_0x41b7('0x2c')];};module[_0x41b7('0x2d')]=Action;