Built motion from commit 20b39a97.|2.6.29
[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 _0xb9f4=['callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','format','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','exports','util','lodash','isNil','string','voiceQueue','Contact','lastName','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','ContactFirstName','firstName','starttime','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x123390,_0xc6d719){var _0x830896=function(_0x355cfb){while(--_0x355cfb){_0x123390['push'](_0x123390['shift']());}};_0x830896(++_0xc6d719);}(_0xb9f4,0x133));var _0x4b9f=function(_0x5891f4,_0x251d8f){_0x5891f4=_0x5891f4-0x0;var _0x141ca1=_0xb9f4[_0x5891f4];return _0x141ca1;};'use strict';var util=require(_0x4b9f('0x0'));var _=require(_0x4b9f('0x1'));var moment=require('moment');function checkNameSurname(_0x165962,_0xf9cde5,_0x44fbf8){var _0x21025f='';if(!_[_0x4b9f('0x2')](_0xf9cde5)&&_0x4b9f('0x3')===typeof _0xf9cde5){_0x21025f+=_0xf9cde5;}if(!_[_0x4b9f('0x2')](_0x44fbf8)&&_0x4b9f('0x3')===typeof _0x44fbf8){_0x21025f+='\x20'+_0x44fbf8;}if(_0x21025f!==''){return _0x21025f;}return _0x165962;}function Action(_0x357de3,_0x456b85,_0x403236){this[_0x4b9f('0x4')]=_0x357de3;this['uniqueid']=_0x403236||undefined;this['name']=checkNameSurname(_0x456b85['Contact']['phone'],_0x456b85[_0x4b9f('0x5')]['firstName'],_0x456b85['Contact'][_0x4b9f('0x6')]);this['number']=_0x456b85[_0x4b9f('0x7')];this[_0x4b9f('0x8')]=_0x357de3['name'];this['active']=_0x456b85[_0x4b9f('0x9')]||![];this[_0x4b9f('0xa')]=_0x357de3[_0x4b9f('0xa')];this['dialQueueTimeout']=_0x357de3[_0x4b9f('0xb')]||0x3;this['scheduledat']=_0x456b85[_0x4b9f('0xc')];this[_0x4b9f('0xd')]=_0x456b85['countbusyretry'];this[_0x4b9f('0xe')]=_0x456b85[_0x4b9f('0xe')];this[_0x4b9f('0xf')]=_0x456b85[_0x4b9f('0xf')];this[_0x4b9f('0x10')]=_0x456b85[_0x4b9f('0x10')];this[_0x4b9f('0x11')]=_0x456b85[_0x4b9f('0x11')];this[_0x4b9f('0x12')]=_0x456b85['countabandonedretry'];this[_0x4b9f('0x13')]=_0x456b85[_0x4b9f('0x13')];this[_0x4b9f('0x14')]=_0x456b85[_0x4b9f('0x14')];this[_0x4b9f('0x15')]=_0x456b85['ContactId'];this[_0x4b9f('0x16')]=_0x456b85[_0x4b9f('0x16')];this[_0x4b9f('0x17')]=_0x456b85[_0x4b9f('0x17')];this[_0x4b9f('0x18')]=_0x456b85[_0x4b9f('0x18')];this['CampaignId']=_0x456b85['CampaignId'];this['idHopper']=_0x456b85['id'];this[_0x4b9f('0x19')]=_0x456b85[_0x4b9f('0x5')][_0x4b9f('0x1a')]||'';this[_0x4b9f('0x1b')]=moment()['format'](_0x4b9f('0x1c'));this[_0x4b9f('0x1d')]=_0x456b85[_0x4b9f('0x1d')];this[_0x4b9f('0x1e')]=_0x456b85['callbackuniqueid'];this[_0x4b9f('0x1f')]=_0x456b85['callbackat'];this[_0x4b9f('0x20')]=_0x456b85[_0x4b9f('0x20')];this[_0x4b9f('0x21')]='';this[_0x4b9f('0x22')]='';}Action[_0x4b9f('0x23')]['getCaller']=function(){return util[_0x4b9f('0x24')](_0x4b9f('0x25'),this['name'],this[_0x4b9f('0x4')][_0x4b9f('0x26')]>0x0?this[_0x4b9f('0x27')][_0x4b9f('0x28')](this[_0x4b9f('0x4')][_0x4b9f('0x26')]):this[_0x4b9f('0x27')]);};Action[_0x4b9f('0x23')]['getQueue']=function(){return this[_0x4b9f('0x8')];};module[_0x4b9f('0x29')]=Action;