Built motion from commit 39adb707.|2.6.14
[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 _0x73dd=['countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','exports','util','moment','isNil','string','voiceQueue','uniqueid','name','phone','Contact','firstName','lastName','queue','active','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x5e77db,_0x356d1c){var _0x34b675=function(_0x4914b5){while(--_0x4914b5){_0x5e77db['push'](_0x5e77db['shift']());}};_0x34b675(++_0x356d1c);}(_0x73dd,0x11f));var _0xd73d=function(_0x1b01f8,_0x19b91c){_0x1b01f8=_0x1b01f8-0x0;var _0x467926=_0x73dd[_0x1b01f8];return _0x467926;};'use strict';var util=require(_0xd73d('0x0'));var _=require('lodash');var moment=require(_0xd73d('0x1'));function checkNameSurname(_0x3d2e06,_0x487c07,_0x3de0ee){var _0x1a5cbb='';if(!_[_0xd73d('0x2')](_0x487c07)&&_0xd73d('0x3')===typeof _0x487c07){_0x1a5cbb+=_0x487c07;}if(!_[_0xd73d('0x2')](_0x3de0ee)&&_0xd73d('0x3')===typeof _0x3de0ee){_0x1a5cbb+='\x20'+_0x3de0ee;}if(_0x1a5cbb!==''){return _0x1a5cbb;}return _0x3d2e06;}function Action(_0x247069,_0x14bc54,_0x4a6e0a){this[_0xd73d('0x4')]=_0x247069;this[_0xd73d('0x5')]=_0x4a6e0a||undefined;this[_0xd73d('0x6')]=checkNameSurname(_0x14bc54['Contact'][_0xd73d('0x7')],_0x14bc54[_0xd73d('0x8')][_0xd73d('0x9')],_0x14bc54['Contact'][_0xd73d('0xa')]);this['number']=_0x14bc54['phone'];this[_0xd73d('0xb')]=_0x247069[_0xd73d('0x6')];this['active']=_0x14bc54[_0xd73d('0xc')]||![];this['type']=_0x247069['type'];this[_0xd73d('0xd')]=_0x247069['dialQueueTimeout']||0x3;this[_0xd73d('0xe')]=_0x14bc54[_0xd73d('0xe')];this['countbusyretry']=_0x14bc54[_0xd73d('0xf')];this['countcongestionretry']=_0x14bc54[_0xd73d('0x10')];this['countnoanswerretry']=_0x14bc54[_0xd73d('0x11')];this['countnosuchnumberretry']=_0x14bc54['countnosuchnumberretry'];this[_0xd73d('0x12')]=_0x14bc54[_0xd73d('0x12')];this[_0xd73d('0x13')]=_0x14bc54[_0xd73d('0x13')];this[_0xd73d('0x14')]=_0x14bc54['countmachineretry'];this[_0xd73d('0x15')]=_0x14bc54[_0xd73d('0x15')];this[_0xd73d('0x16')]=_0x14bc54[_0xd73d('0x16')];this[_0xd73d('0x17')]=_0x14bc54[_0xd73d('0x17')];this[_0xd73d('0x18')]=_0x14bc54[_0xd73d('0x18')];this[_0xd73d('0x19')]=_0x14bc54[_0xd73d('0x19')];this['CampaignId']=_0x14bc54[_0xd73d('0x1a')];this[_0xd73d('0x1b')]=_0x14bc54['id'];this[_0xd73d('0x1c')]=_0x14bc54['Contact'][_0xd73d('0x9')]||'';this[_0xd73d('0x1d')]=moment()['format'](_0xd73d('0x1e'));this['callback']=_0x14bc54[_0xd73d('0x1f')];this[_0xd73d('0x20')]=_0x14bc54[_0xd73d('0x20')];this[_0xd73d('0x21')]=_0x14bc54[_0xd73d('0x21')];this['recallme']=_0x14bc54[_0xd73d('0x22')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0xd73d('0x23')][_0xd73d('0x24')]=function(){return util[_0xd73d('0x25')](_0xd73d('0x26'),this['name'],this[_0xd73d('0x4')][_0xd73d('0x27')]>0x0?this[_0xd73d('0x28')][_0xd73d('0x29')](this[_0xd73d('0x4')][_0xd73d('0x27')]):this[_0xd73d('0x28')]);};Action[_0xd73d('0x23')][_0xd73d('0x2a')]=function(){return this[_0xd73d('0xb')];};module[_0xd73d('0x2b')]=Action;