5245277ba210bd423ca6784618e17e0d02c25e5d
[motion2.git] / server / services / ami / dialer / 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 _0x3350=['util','lodash','moment','isNil','string','voiceQueue','name','Contact','phone','firstName','lastName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','callback','callbackuniqueid','callbackat','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','queue'];(function(_0x576ec6,_0x14d7c4){var _0x273398=function(_0x2410d0){while(--_0x2410d0){_0x576ec6['push'](_0x576ec6['shift']());}};_0x273398(++_0x14d7c4);}(_0x3350,0x18c));var _0x0335=function(_0x21ccca,_0x1cc697){_0x21ccca=_0x21ccca-0x0;var _0x5c6049=_0x3350[_0x21ccca];return _0x5c6049;};'use strict';var util=require(_0x0335('0x0'));var _=require(_0x0335('0x1'));var moment=require(_0x0335('0x2'));function checkNameSurname(_0x5a4e79,_0x129491,_0x20e0e6){var _0x838751='';if(!_[_0x0335('0x3')](_0x129491)&&_0x0335('0x4')===typeof _0x129491){_0x838751+=_0x129491;}if(!_['isNil'](_0x20e0e6)&&'string'===typeof _0x20e0e6){_0x838751+='\x20'+_0x20e0e6;}if(_0x838751!==''){return _0x838751;}return _0x5a4e79;}function Action(_0x2c00d8,_0x2864ef,_0x5acc74){this[_0x0335('0x5')]=_0x2c00d8;this['uniqueid']=_0x5acc74||undefined;this[_0x0335('0x6')]=checkNameSurname(_0x2864ef[_0x0335('0x7')][_0x0335('0x8')],_0x2864ef['Contact'][_0x0335('0x9')],_0x2864ef[_0x0335('0x7')][_0x0335('0xa')]);this[_0x0335('0xb')]=_0x2864ef[_0x0335('0x7')][_0x0335('0x8')];this['queue']=_0x2c00d8[_0x0335('0x6')];this[_0x0335('0xc')]=_0x2864ef[_0x0335('0xc')]||![];this[_0x0335('0xd')]=_0x2c00d8[_0x0335('0xd')];this[_0x0335('0xe')]=_0x2c00d8[_0x0335('0xe')]||0x3;this['scheduledat']=_0x2864ef[_0x0335('0xf')];this['countbusyretry']=_0x2864ef[_0x0335('0x10')];this['countcongestionretry']=_0x2864ef[_0x0335('0x11')];this[_0x0335('0x12')]=_0x2864ef['countnoanswerretry'];this[_0x0335('0x13')]=_0x2864ef[_0x0335('0x13')];this[_0x0335('0x14')]=_0x2864ef[_0x0335('0x14')];this['countabandonedretry']=_0x2864ef[_0x0335('0x15')];this[_0x0335('0x16')]=_0x2864ef[_0x0335('0x16')];this[_0x0335('0x17')]=_0x2864ef[_0x0335('0x17')];this[_0x0335('0x18')]=_0x2864ef[_0x0335('0x18')];this['ListId']=_0x2864ef[_0x0335('0x19')];this[_0x0335('0x1a')]=_0x2864ef[_0x0335('0x1a')];this['VoiceQueueId']=_0x2864ef[_0x0335('0x1b')];this['CampaignId']=_0x2864ef[_0x0335('0x1c')];this[_0x0335('0x1d')]=_0x2864ef['id'];this[_0x0335('0x1e')]=_0x2864ef[_0x0335('0x7')][_0x0335('0x9')]||'';this[_0x0335('0x1f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0335('0x20')]=_0x2864ef[_0x0335('0x20')];this['callbackuniqueid']=_0x2864ef[_0x0335('0x21')];this['callbackat']=_0x2864ef[_0x0335('0x22')];this['recallme']=_0x2864ef['recallme'];this[_0x0335('0x23')]='';this[_0x0335('0x24')]='';}Action[_0x0335('0x25')][_0x0335('0x26')]=function(){return util['format'](_0x0335('0x27'),this[_0x0335('0x6')],this[_0x0335('0x5')][_0x0335('0x28')]>0x0?this[_0x0335('0xb')][_0x0335('0x29')](this['voiceQueue']['dialCutDigit']):this[_0x0335('0xb')]);};Action[_0x0335('0x25')][_0x0335('0x2a')]=function(){return this[_0x0335('0x2b')];};module['exports']=Action;