Built motion from commit e02f907f.|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 _0x1c86=['countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','util','moment','isNil','string','voiceQueue','name','Contact','phone','number','active','type','dialQueueTimeout','scheduledat','countbusyretry'];(function(_0x3a948e,_0x5a2108){var _0x2a8291=function(_0x5e9310){while(--_0x5e9310){_0x3a948e['push'](_0x3a948e['shift']());}};_0x2a8291(++_0x5a2108);}(_0x1c86,0x67));var _0x61c8=function(_0x1ccc3f,_0x547108){_0x1ccc3f=_0x1ccc3f-0x0;var _0x29f78a=_0x1c86[_0x1ccc3f];return _0x29f78a;};'use strict';var util=require(_0x61c8('0x0'));var _=require('lodash');var moment=require(_0x61c8('0x1'));function checkNameSurname(_0x58bb41,_0x2b4546,_0xf8e971){var _0x2ec297='';if(!_[_0x61c8('0x2')](_0x2b4546)&&_0x61c8('0x3')===typeof _0x2b4546){_0x2ec297+=_0x2b4546;}if(!_[_0x61c8('0x2')](_0xf8e971)&&'string'===typeof _0xf8e971){_0x2ec297+='\x20'+_0xf8e971;}if(_0x2ec297!==''){return _0x2ec297;}return _0x58bb41;}function Action(_0x453e8f,_0x25d363,_0x2ac098){this[_0x61c8('0x4')]=_0x453e8f;this['uniqueid']=_0x2ac098||undefined;this[_0x61c8('0x5')]=checkNameSurname(_0x25d363[_0x61c8('0x6')][_0x61c8('0x7')],_0x25d363[_0x61c8('0x6')]['firstName'],_0x25d363[_0x61c8('0x6')]['lastName']);this[_0x61c8('0x8')]=_0x25d363[_0x61c8('0x7')];this['queue']=_0x453e8f[_0x61c8('0x5')];this[_0x61c8('0x9')]=_0x25d363[_0x61c8('0x9')]||![];this[_0x61c8('0xa')]=_0x453e8f[_0x61c8('0xa')];this[_0x61c8('0xb')]=_0x453e8f[_0x61c8('0xb')]||0x3;this['scheduledat']=_0x25d363[_0x61c8('0xc')];this[_0x61c8('0xd')]=_0x25d363['countbusyretry'];this['countcongestionretry']=_0x25d363[_0x61c8('0xe')];this['countnoanswerretry']=_0x25d363[_0x61c8('0xf')];this['countnosuchnumberretry']=_0x25d363['countnosuchnumberretry'];this[_0x61c8('0x10')]=_0x25d363[_0x61c8('0x10')];this['countabandonedretry']=_0x25d363[_0x61c8('0x11')];this[_0x61c8('0x12')]=_0x25d363['countmachineretry'];this['countagentrejectretry']=_0x25d363['countagentrejectretry'];this[_0x61c8('0x13')]=_0x25d363[_0x61c8('0x13')];this[_0x61c8('0x14')]=_0x25d363['ListId'];this[_0x61c8('0x15')]=_0x25d363['UserId'];this[_0x61c8('0x16')]=_0x25d363['VoiceQueueId'];this[_0x61c8('0x17')]=_0x25d363[_0x61c8('0x17')];this[_0x61c8('0x18')]=_0x25d363['id'];this[_0x61c8('0x19')]=_0x25d363[_0x61c8('0x6')]['firstName']||'';this[_0x61c8('0x1a')]=moment()[_0x61c8('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x25d363[_0x61c8('0x1c')];this[_0x61c8('0x1d')]=_0x25d363[_0x61c8('0x1d')];this[_0x61c8('0x1e')]=_0x25d363[_0x61c8('0x1e')];this[_0x61c8('0x1f')]=_0x25d363['recallme'];this['originatecalleridnum']='';this[_0x61c8('0x20')]='';}Action[_0x61c8('0x21')]['getCaller']=function(){return util[_0x61c8('0x1b')](_0x61c8('0x22'),this['name'],this['voiceQueue'][_0x61c8('0x23')]>0x0?this[_0x61c8('0x8')][_0x61c8('0x24')](this['voiceQueue'][_0x61c8('0x23')]):this[_0x61c8('0x8')]);};Action[_0x61c8('0x21')][_0x61c8('0x25')]=function(){return this['queue'];};module[_0x61c8('0x26')]=Action;