Built motion from commit bab6f49e.|2.6.17
[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 _0x95cd=['isNil','string','voiceQueue','name','phone','Contact','firstName','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','recallme','originatecalleridnum','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','prototype','exports','util','moment'];(function(_0x47a17c,_0x41af77){var _0x3f4e88=function(_0x321a01){while(--_0x321a01){_0x47a17c['push'](_0x47a17c['shift']());}};_0x3f4e88(++_0x41af77);}(_0x95cd,0x96));var _0xd95c=function(_0x4f4906,_0x5a2cd1){_0x4f4906=_0x4f4906-0x0;var _0x506466=_0x95cd[_0x4f4906];return _0x506466;};'use strict';var util=require(_0xd95c('0x0'));var _=require('lodash');var moment=require(_0xd95c('0x1'));function checkNameSurname(_0x1eef91,_0x42c3a1,_0x228177){var _0x64daa5='';if(!_[_0xd95c('0x2')](_0x42c3a1)&&'string'===typeof _0x42c3a1){_0x64daa5+=_0x42c3a1;}if(!_[_0xd95c('0x2')](_0x228177)&&_0xd95c('0x3')===typeof _0x228177){_0x64daa5+='\x20'+_0x228177;}if(_0x64daa5!==''){return _0x64daa5;}return _0x1eef91;}function Action(_0x4f3acc,_0x2ed80b,_0x37ef80){this[_0xd95c('0x4')]=_0x4f3acc;this['uniqueid']=_0x37ef80||undefined;this[_0xd95c('0x5')]=checkNameSurname(_0x2ed80b['Contact'][_0xd95c('0x6')],_0x2ed80b[_0xd95c('0x7')][_0xd95c('0x8')],_0x2ed80b[_0xd95c('0x7')][_0xd95c('0x9')]);this['number']=_0x2ed80b[_0xd95c('0x6')];this[_0xd95c('0xa')]=_0x4f3acc[_0xd95c('0x5')];this[_0xd95c('0xb')]=_0x2ed80b['active']||![];this[_0xd95c('0xc')]=_0x4f3acc[_0xd95c('0xc')];this[_0xd95c('0xd')]=_0x4f3acc['dialQueueTimeout']||0x3;this[_0xd95c('0xe')]=_0x2ed80b['scheduledat'];this[_0xd95c('0xf')]=_0x2ed80b[_0xd95c('0xf')];this['countcongestionretry']=_0x2ed80b['countcongestionretry'];this[_0xd95c('0x10')]=_0x2ed80b[_0xd95c('0x10')];this['countnosuchnumberretry']=_0x2ed80b['countnosuchnumberretry'];this[_0xd95c('0x11')]=_0x2ed80b[_0xd95c('0x11')];this[_0xd95c('0x12')]=_0x2ed80b['countabandonedretry'];this[_0xd95c('0x13')]=_0x2ed80b['countmachineretry'];this[_0xd95c('0x14')]=_0x2ed80b['countagentrejectretry'];this[_0xd95c('0x15')]=_0x2ed80b['ContactId'];this[_0xd95c('0x16')]=_0x2ed80b[_0xd95c('0x16')];this[_0xd95c('0x17')]=_0x2ed80b[_0xd95c('0x17')];this[_0xd95c('0x18')]=_0x2ed80b['VoiceQueueId'];this[_0xd95c('0x19')]=_0x2ed80b[_0xd95c('0x19')];this['idHopper']=_0x2ed80b['id'];this['ContactFirstName']=_0x2ed80b[_0xd95c('0x7')][_0xd95c('0x8')]||'';this['starttime']=moment()[_0xd95c('0x1a')](_0xd95c('0x1b'));this[_0xd95c('0x1c')]=_0x2ed80b[_0xd95c('0x1c')];this[_0xd95c('0x1d')]=_0x2ed80b['callbackuniqueid'];this['callbackat']=_0x2ed80b['callbackat'];this[_0xd95c('0x1e')]=_0x2ed80b[_0xd95c('0x1e')];this[_0xd95c('0x1f')]='';this['originatecalleridname']='';}Action['prototype'][_0xd95c('0x20')]=function(){return util[_0xd95c('0x1a')](_0xd95c('0x21'),this[_0xd95c('0x5')],this[_0xd95c('0x4')][_0xd95c('0x22')]>0x0?this[_0xd95c('0x23')]['substring'](this[_0xd95c('0x4')]['dialCutDigit']):this[_0xd95c('0x23')]);};Action[_0xd95c('0x24')]['getQueue']=function(){return this[_0xd95c('0xa')];};module[_0xd95c('0x25')]=Action;