ea37364cc92a66add11a96f20615677b071aec63
[motion2.git] / server / services / ami / preview / 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 _0x2f63=['prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','isNil','string','uniqueid','queue','name','campaigntype','dialAnswer','membername','Agent','channelAgent','format','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','callback','callbackat','recallme','ContactId','ListId','originatecalleridnum','originatecalleridname'];(function(_0x436aec,_0x3c5db2){var _0x108009=function(_0xb00f20){while(--_0xb00f20){_0x436aec['push'](_0x436aec['shift']());}};_0x108009(++_0x3c5db2);}(_0x2f63,0xf5));var _0x32f6=function(_0x16ed87,_0x1be1a2){_0x16ed87=_0x16ed87-0x0;var _0xc1a1d8=_0x2f63[_0x16ed87];return _0xc1a1d8;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x3c1eb5,_0x52bf9f,_0x46a270){var _0xdb5f46='';if(!_[_0x32f6('0x0')](_0x52bf9f)&&_0x32f6('0x1')===typeof _0x52bf9f){_0xdb5f46+=_0x52bf9f;}if(!_['isNil'](_0x46a270)&&'string'===typeof _0x46a270){_0xdb5f46+='\x20'+_0x46a270;}if(_0xdb5f46!==''){return _0xdb5f46;}return _0x3c1eb5;}function Action(_0x1e0ce9,_0x525c4e,_0x1c9389,_0x490590,_0x4a1923){this[_0x32f6('0x2')]=_0x1c9389||undefined;this['idContact']=_0x1e0ce9['id'];this[_0x32f6('0x3')]=_0x525c4e[_0x32f6('0x4')];this['type']=_0x525c4e['type'];this[_0x32f6('0x5')]=_0x32f6('0x3');this[_0x32f6('0x6')]=![];this[_0x32f6('0x7')]=_[_0x32f6('0x0')](_0x1e0ce9['Agent'])?undefined:_0x1e0ce9[_0x32f6('0x8')][_0x32f6('0x4')];this[_0x32f6('0x9')]=this[_0x32f6('0x7')]?util[_0x32f6('0xa')]('SIP/%s',this[_0x32f6('0x7')]):_0x490590||undefined;this[_0x32f6('0xb')]=checkNameSurname(_0x1e0ce9[_0x32f6('0xc')][_0x32f6('0xd')],_0x1e0ce9[_0x32f6('0xc')][_0x32f6('0xe')],_0x1e0ce9[_0x32f6('0xc')][_0x32f6('0xf')]);this[_0x32f6('0x10')]=_0x1e0ce9[_0x32f6('0x10')]||![];this[_0x32f6('0x11')]=_0x1e0ce9[_0x32f6('0xc')]['phone'];this[_0x32f6('0x12')]=_0x1e0ce9[_0x32f6('0x12')];this[_0x32f6('0x13')]=_0x1e0ce9[_0x32f6('0x13')]||0x0;this[_0x32f6('0x14')]=_0x1e0ce9[_0x32f6('0x14')]||0x0;this[_0x32f6('0x15')]=_0x1e0ce9[_0x32f6('0x15')]||0x0;this[_0x32f6('0x16')]=(_0x1e0ce9[_0x32f6('0x13')]||0x0)+(_0x1e0ce9[_0x32f6('0x14')]||0x0)+(_0x1e0ce9[_0x32f6('0x15')]||0x0)+(_0x1e0ce9[_0x32f6('0x17')]||0x0)+(_0x1e0ce9['countdropretry']||0x0)+(_0x1e0ce9['countabandonedretry']||0x0)+(_0x1e0ce9[_0x32f6('0x18')]||0x0)+(_0x1e0ce9[_0x32f6('0x19')]||0x0);this[_0x32f6('0x17')]=_0x1e0ce9[_0x32f6('0x17')]||0x0;this[_0x32f6('0x1a')]=_0x1e0ce9['countdropretry']||0x0;this[_0x32f6('0x1b')]=_0x1e0ce9[_0x32f6('0x1b')]||0x0;this['countmachineretry']=_0x1e0ce9['countmachineretry']||0x0;this[_0x32f6('0x19')]=_0x1e0ce9['countagentrejectretry']||0x0;this['callback']=_0x1e0ce9[_0x32f6('0x1c')];this['callbackuniqueid']=_0x1e0ce9['callbackuniqueid'];this[_0x32f6('0x1d')]=_0x1e0ce9[_0x32f6('0x1d')];this[_0x32f6('0x1e')]=_0x1e0ce9['recallme'];this[_0x32f6('0x1f')]=_0x1e0ce9[_0x32f6('0x1f')];this[_0x32f6('0x20')]=_0x1e0ce9[_0x32f6('0x20')];this['UserId']=_[_0x32f6('0x0')](_0x1e0ce9[_0x32f6('0x8')])?_0x1e0ce9['UserId']:_0x1e0ce9[_0x32f6('0x8')]['id'];this['VoiceQueueId']=_0x1e0ce9['VoiceQueueId'];this[_0x32f6('0x21')]='';this[_0x32f6('0x22')]='';}Action[_0x32f6('0x23')][_0x32f6('0x24')]=function(){return util[_0x32f6('0xa')](_0x32f6('0x25'),this[_0x32f6('0xb')],this[_0x32f6('0x26')]);};module[_0x32f6('0x27')]=Action;