Built motion from commit 00bf23f6.|2.6.16
[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 _0x3737=['UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','name','substring','dialCutDigit','getQueue','exports','lodash','moment','isNil','string','voiceQueue','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x3737,0xea));var _0x7373=function(_0x29b802,_0x42e3ae){_0x29b802=_0x29b802-0x0;var _0x4b91af=_0x3737[_0x29b802];return _0x4b91af;};'use strict';var util=require('util');var _=require(_0x7373('0x0'));var moment=require(_0x7373('0x1'));function checkNameSurname(_0x33ec2b,_0x4251ce,_0x3b35c5){var _0x321d82='';if(!_[_0x7373('0x2')](_0x4251ce)&&_0x7373('0x3')===typeof _0x4251ce){_0x321d82+=_0x4251ce;}if(!_[_0x7373('0x2')](_0x3b35c5)&&_0x7373('0x3')===typeof _0x3b35c5){_0x321d82+='\x20'+_0x3b35c5;}if(_0x321d82!==''){return _0x321d82;}return _0x33ec2b;}function Action(_0x310270,_0x31f9b6,_0x553657){this[_0x7373('0x4')]=_0x310270;this['uniqueid']=_0x553657||undefined;this['name']=checkNameSurname(_0x31f9b6[_0x7373('0x5')][_0x7373('0x6')],_0x31f9b6[_0x7373('0x5')][_0x7373('0x7')],_0x31f9b6[_0x7373('0x5')][_0x7373('0x8')]);this[_0x7373('0x9')]=_0x31f9b6[_0x7373('0x6')];this[_0x7373('0xa')]=_0x310270['name'];this[_0x7373('0xb')]=_0x31f9b6[_0x7373('0xb')]||![];this[_0x7373('0xc')]=_0x310270[_0x7373('0xc')];this[_0x7373('0xd')]=_0x310270['dialQueueTimeout']||0x3;this['scheduledat']=_0x31f9b6['scheduledat'];this['countbusyretry']=_0x31f9b6[_0x7373('0xe')];this[_0x7373('0xf')]=_0x31f9b6['countcongestionretry'];this['countnoanswerretry']=_0x31f9b6[_0x7373('0x10')];this[_0x7373('0x11')]=_0x31f9b6[_0x7373('0x11')];this[_0x7373('0x12')]=_0x31f9b6[_0x7373('0x12')];this['countabandonedretry']=_0x31f9b6[_0x7373('0x13')];this[_0x7373('0x14')]=_0x31f9b6[_0x7373('0x14')];this[_0x7373('0x15')]=_0x31f9b6['countagentrejectretry'];this['ContactId']=_0x31f9b6[_0x7373('0x16')];this[_0x7373('0x17')]=_0x31f9b6[_0x7373('0x17')];this['UserId']=_0x31f9b6[_0x7373('0x18')];this['VoiceQueueId']=_0x31f9b6[_0x7373('0x19')];this[_0x7373('0x1a')]=_0x31f9b6[_0x7373('0x1a')];this[_0x7373('0x1b')]=_0x31f9b6['id'];this[_0x7373('0x1c')]=_0x31f9b6['Contact'][_0x7373('0x7')]||'';this['starttime']=moment()[_0x7373('0x1d')](_0x7373('0x1e'));this['callback']=_0x31f9b6['callback'];this[_0x7373('0x1f')]=_0x31f9b6[_0x7373('0x1f')];this[_0x7373('0x20')]=_0x31f9b6[_0x7373('0x20')];this[_0x7373('0x21')]=_0x31f9b6[_0x7373('0x21')];this[_0x7373('0x22')]='';this[_0x7373('0x23')]='';}Action[_0x7373('0x24')]['getCaller']=function(){return util[_0x7373('0x1d')](_0x7373('0x25'),this[_0x7373('0x26')],this[_0x7373('0x4')]['dialCutDigit']>0x0?this[_0x7373('0x9')][_0x7373('0x27')](this[_0x7373('0x4')][_0x7373('0x28')]):this[_0x7373('0x9')]);};Action[_0x7373('0x24')][_0x7373('0x29')]=function(){return this[_0x7373('0xa')];};module[_0x7373('0x2a')]=Action;