Built motion from commit da24aabd.|2.6.20
[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 _0x3f2c=['voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ListId','CampaignId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','queue','util','lodash','moment','isNil','string'];(function(_0x576bbd,_0x43608d){var _0x435579=function(_0x196f03){while(--_0x196f03){_0x576bbd['push'](_0x576bbd['shift']());}};_0x435579(++_0x43608d);}(_0x3f2c,0x175));var _0xc3f2=function(_0x222802,_0x22e197){_0x222802=_0x222802-0x0;var _0x26c770=_0x3f2c[_0x222802];return _0x26c770;};'use strict';var util=require(_0xc3f2('0x0'));var _=require(_0xc3f2('0x1'));var moment=require(_0xc3f2('0x2'));function checkNameSurname(_0x4cb6a9,_0x35a783,_0x1dd42e){var _0x3835b4='';if(!_[_0xc3f2('0x3')](_0x35a783)&&_0xc3f2('0x4')===typeof _0x35a783){_0x3835b4+=_0x35a783;}if(!_[_0xc3f2('0x3')](_0x1dd42e)&&_0xc3f2('0x4')===typeof _0x1dd42e){_0x3835b4+='\x20'+_0x1dd42e;}if(_0x3835b4!==''){return _0x3835b4;}return _0x4cb6a9;}function Action(_0x1abadd,_0x32379f,_0x2d53e3){this[_0xc3f2('0x5')]=_0x1abadd;this[_0xc3f2('0x6')]=_0x2d53e3||undefined;this[_0xc3f2('0x7')]=checkNameSurname(_0x32379f[_0xc3f2('0x8')][_0xc3f2('0x9')],_0x32379f[_0xc3f2('0x8')][_0xc3f2('0xa')],_0x32379f[_0xc3f2('0x8')][_0xc3f2('0xb')]);this[_0xc3f2('0xc')]=_0x32379f[_0xc3f2('0x9')];this['queue']=_0x1abadd[_0xc3f2('0x7')];this[_0xc3f2('0xd')]=_0x32379f[_0xc3f2('0xd')]||![];this[_0xc3f2('0xe')]=_0x1abadd['type'];this[_0xc3f2('0xf')]=_0x1abadd[_0xc3f2('0xf')]||0x3;this[_0xc3f2('0x10')]=_0x32379f[_0xc3f2('0x10')];this[_0xc3f2('0x11')]=_0x32379f[_0xc3f2('0x11')];this[_0xc3f2('0x12')]=_0x32379f[_0xc3f2('0x12')];this['countnoanswerretry']=_0x32379f[_0xc3f2('0x13')];this[_0xc3f2('0x14')]=_0x32379f[_0xc3f2('0x14')];this[_0xc3f2('0x15')]=_0x32379f[_0xc3f2('0x15')];this['countabandonedretry']=_0x32379f[_0xc3f2('0x16')];this[_0xc3f2('0x17')]=_0x32379f['countmachineretry'];this[_0xc3f2('0x18')]=_0x32379f[_0xc3f2('0x18')];this['ContactId']=_0x32379f['ContactId'];this[_0xc3f2('0x19')]=_0x32379f[_0xc3f2('0x19')];this['UserId']=_0x32379f['UserId'];this['VoiceQueueId']=_0x32379f['VoiceQueueId'];this['CampaignId']=_0x32379f[_0xc3f2('0x1a')];this[_0xc3f2('0x1b')]=_0x32379f['id'];this['ContactFirstName']=_0x32379f['Contact'][_0xc3f2('0xa')]||'';this[_0xc3f2('0x1c')]=moment()[_0xc3f2('0x1d')](_0xc3f2('0x1e'));this[_0xc3f2('0x1f')]=_0x32379f['callback'];this[_0xc3f2('0x20')]=_0x32379f[_0xc3f2('0x20')];this[_0xc3f2('0x21')]=_0x32379f['callbackat'];this[_0xc3f2('0x22')]=_0x32379f[_0xc3f2('0x22')];this['originatecalleridnum']='';this[_0xc3f2('0x23')]='';}Action[_0xc3f2('0x24')][_0xc3f2('0x25')]=function(){return util[_0xc3f2('0x1d')](_0xc3f2('0x26'),this['name'],this[_0xc3f2('0x5')][_0xc3f2('0x27')]>0x0?this[_0xc3f2('0xc')][_0xc3f2('0x28')](this[_0xc3f2('0x5')][_0xc3f2('0x27')]):this[_0xc3f2('0xc')]);};Action['prototype']['getQueue']=function(){return this[_0xc3f2('0x29')];};module['exports']=Action;