Built motion from commit b5996064.|2.6.21
[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 _0x65e4=['type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','substring','dialCutDigit','getQueue','queue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','Contact','phone','firstName','lastName','number','name','active'];(function(_0x3dae40,_0x5ac8fb){var _0x4a3858=function(_0x346163){while(--_0x346163){_0x3dae40['push'](_0x3dae40['shift']());}};_0x4a3858(++_0x5ac8fb);}(_0x65e4,0x82));var _0x465e=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x65e4[_0x4b369d];return _0x571a98;};'use strict';var util=require(_0x465e('0x0'));var _=require(_0x465e('0x1'));var moment=require(_0x465e('0x2'));function checkNameSurname(_0x3ff920,_0x2ad6ab,_0x471256){var _0x52dafe='';if(!_[_0x465e('0x3')](_0x2ad6ab)&&'string'===typeof _0x2ad6ab){_0x52dafe+=_0x2ad6ab;}if(!_['isNil'](_0x471256)&&_0x465e('0x4')===typeof _0x471256){_0x52dafe+='\x20'+_0x471256;}if(_0x52dafe!==''){return _0x52dafe;}return _0x3ff920;}function Action(_0x4ca094,_0x3ffd58,_0x220ae5){this[_0x465e('0x5')]=_0x4ca094;this[_0x465e('0x6')]=_0x220ae5||undefined;this['name']=checkNameSurname(_0x3ffd58[_0x465e('0x7')][_0x465e('0x8')],_0x3ffd58[_0x465e('0x7')][_0x465e('0x9')],_0x3ffd58[_0x465e('0x7')][_0x465e('0xa')]);this[_0x465e('0xb')]=_0x3ffd58['phone'];this['queue']=_0x4ca094[_0x465e('0xc')];this[_0x465e('0xd')]=_0x3ffd58[_0x465e('0xd')]||![];this['type']=_0x4ca094[_0x465e('0xe')];this[_0x465e('0xf')]=_0x4ca094[_0x465e('0xf')]||0x3;this[_0x465e('0x10')]=_0x3ffd58[_0x465e('0x10')];this[_0x465e('0x11')]=_0x3ffd58[_0x465e('0x11')];this[_0x465e('0x12')]=_0x3ffd58[_0x465e('0x12')];this[_0x465e('0x13')]=_0x3ffd58[_0x465e('0x13')];this[_0x465e('0x14')]=_0x3ffd58['countnosuchnumberretry'];this[_0x465e('0x15')]=_0x3ffd58[_0x465e('0x15')];this[_0x465e('0x16')]=_0x3ffd58[_0x465e('0x16')];this[_0x465e('0x17')]=_0x3ffd58[_0x465e('0x17')];this[_0x465e('0x18')]=_0x3ffd58[_0x465e('0x18')];this[_0x465e('0x19')]=_0x3ffd58[_0x465e('0x19')];this[_0x465e('0x1a')]=_0x3ffd58[_0x465e('0x1a')];this[_0x465e('0x1b')]=_0x3ffd58[_0x465e('0x1b')];this[_0x465e('0x1c')]=_0x3ffd58[_0x465e('0x1c')];this[_0x465e('0x1d')]=_0x3ffd58[_0x465e('0x1d')];this[_0x465e('0x1e')]=_0x3ffd58['id'];this[_0x465e('0x1f')]=_0x3ffd58['Contact'][_0x465e('0x9')]||'';this[_0x465e('0x20')]=moment()[_0x465e('0x21')](_0x465e('0x22'));this['callback']=_0x3ffd58['callback'];this[_0x465e('0x23')]=_0x3ffd58[_0x465e('0x23')];this[_0x465e('0x24')]=_0x3ffd58[_0x465e('0x24')];this[_0x465e('0x25')]=_0x3ffd58[_0x465e('0x25')];this[_0x465e('0x26')]='';this[_0x465e('0x27')]='';}Action[_0x465e('0x28')][_0x465e('0x29')]=function(){return util['format'](_0x465e('0x2a'),this['name'],this['voiceQueue']['dialCutDigit']>0x0?this['number'][_0x465e('0x2b')](this[_0x465e('0x5')][_0x465e('0x2c')]):this[_0x465e('0xb')]);};Action[_0x465e('0x28')][_0x465e('0x2d')]=function(){return this[_0x465e('0x2e')];};module[_0x465e('0x2f')]=Action;