Built motion from commit c116dc8b.|2.6.30
[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 _0xf384=['scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','substring','dialCutDigit','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','firstName','lastName','number','phone','active','type','dialQueueTimeout'];(function(_0x4c0b4e,_0x1dd4fa){var _0x828562=function(_0x229dc7){while(--_0x229dc7){_0x4c0b4e['push'](_0x4c0b4e['shift']());}};_0x828562(++_0x1dd4fa);}(_0xf384,0x17c));var _0x4f38=function(_0x4057a5,_0x16d807){_0x4057a5=_0x4057a5-0x0;var _0x27c3dd=_0xf384[_0x4057a5];return _0x27c3dd;};'use strict';var util=require(_0x4f38('0x0'));var _=require(_0x4f38('0x1'));var moment=require(_0x4f38('0x2'));function checkNameSurname(_0x1feb09,_0x17d9fc,_0x108329){var _0x3644d8='';if(!_[_0x4f38('0x3')](_0x17d9fc)&&_0x4f38('0x4')===typeof _0x17d9fc){_0x3644d8+=_0x17d9fc;}if(!_[_0x4f38('0x3')](_0x108329)&&_0x4f38('0x4')===typeof _0x108329){_0x3644d8+='\x20'+_0x108329;}if(_0x3644d8!==''){return _0x3644d8;}return _0x1feb09;}function Action(_0x4d85d0,_0x548bd7,_0x3649f0){this[_0x4f38('0x5')]=_0x4d85d0;this[_0x4f38('0x6')]=_0x3649f0||undefined;this[_0x4f38('0x7')]=checkNameSurname(_0x548bd7[_0x4f38('0x8')]['phone'],_0x548bd7['Contact'][_0x4f38('0x9')],_0x548bd7[_0x4f38('0x8')][_0x4f38('0xa')]);this[_0x4f38('0xb')]=_0x548bd7[_0x4f38('0xc')];this['queue']=_0x4d85d0[_0x4f38('0x7')];this[_0x4f38('0xd')]=_0x548bd7[_0x4f38('0xd')]||![];this[_0x4f38('0xe')]=_0x4d85d0['type'];this['dialQueueTimeout']=_0x4d85d0[_0x4f38('0xf')]||0x3;this['scheduledat']=_0x548bd7[_0x4f38('0x10')];this['countbusyretry']=_0x548bd7[_0x4f38('0x11')];this[_0x4f38('0x12')]=_0x548bd7[_0x4f38('0x12')];this['countnoanswerretry']=_0x548bd7[_0x4f38('0x13')];this[_0x4f38('0x14')]=_0x548bd7['countnosuchnumberretry'];this['countdropretry']=_0x548bd7[_0x4f38('0x15')];this[_0x4f38('0x16')]=_0x548bd7['countabandonedretry'];this[_0x4f38('0x17')]=_0x548bd7[_0x4f38('0x17')];this['countagentrejectretry']=_0x548bd7['countagentrejectretry'];this[_0x4f38('0x18')]=_0x548bd7[_0x4f38('0x18')];this[_0x4f38('0x19')]=_0x548bd7[_0x4f38('0x19')];this[_0x4f38('0x1a')]=_0x548bd7[_0x4f38('0x1a')];this[_0x4f38('0x1b')]=_0x548bd7[_0x4f38('0x1b')];this[_0x4f38('0x1c')]=_0x548bd7[_0x4f38('0x1c')];this[_0x4f38('0x1d')]=_0x548bd7['id'];this[_0x4f38('0x1e')]=_0x548bd7[_0x4f38('0x8')][_0x4f38('0x9')]||'';this[_0x4f38('0x1f')]=moment()[_0x4f38('0x20')](_0x4f38('0x21'));this[_0x4f38('0x22')]=_0x548bd7[_0x4f38('0x22')];this[_0x4f38('0x23')]=_0x548bd7[_0x4f38('0x23')];this[_0x4f38('0x24')]=_0x548bd7['callbackat'];this[_0x4f38('0x25')]=_0x548bd7[_0x4f38('0x25')];this['originatecalleridnum']='';this[_0x4f38('0x26')]='';}Action[_0x4f38('0x27')]['getCaller']=function(){return util[_0x4f38('0x20')]('\x22%s\x22\x20<%s>',this[_0x4f38('0x7')],this[_0x4f38('0x5')]['dialCutDigit']>0x0?this[_0x4f38('0xb')][_0x4f38('0x28')](this[_0x4f38('0x5')][_0x4f38('0x29')]):this[_0x4f38('0xb')]);};Action[_0x4f38('0x27')][_0x4f38('0x2a')]=function(){return this['queue'];};module[_0x4f38('0x2b')]=Action;