Built motion from commit b5413ace.|2.6.9
[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 _0x735e=['Contact','firstName','lastName','number','queue','active','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','phone'];(function(_0x2e233e,_0x2a9bef){var _0x5b506b=function(_0x21fd45){while(--_0x21fd45){_0x2e233e['push'](_0x2e233e['shift']());}};_0x5b506b(++_0x2a9bef);}(_0x735e,0x18c));var _0xe735=function(_0x1399d6,_0x2c1661){_0x1399d6=_0x1399d6-0x0;var _0x4a9db4=_0x735e[_0x1399d6];return _0x4a9db4;};'use strict';var util=require(_0xe735('0x0'));var _=require(_0xe735('0x1'));var moment=require(_0xe735('0x2'));function checkNameSurname(_0x1dab04,_0x1079ed,_0x1c4f98){var _0x4cd8b1='';if(!_[_0xe735('0x3')](_0x1079ed)&&_0xe735('0x4')===typeof _0x1079ed){_0x4cd8b1+=_0x1079ed;}if(!_['isNil'](_0x1c4f98)&&'string'===typeof _0x1c4f98){_0x4cd8b1+='\x20'+_0x1c4f98;}if(_0x4cd8b1!==''){return _0x4cd8b1;}return _0x1dab04;}function Action(_0x245b41,_0x14dc89,_0x594c80){this[_0xe735('0x5')]=_0x245b41;this[_0xe735('0x6')]=_0x594c80||undefined;this[_0xe735('0x7')]=checkNameSurname(_0x14dc89['Contact'][_0xe735('0x8')],_0x14dc89[_0xe735('0x9')][_0xe735('0xa')],_0x14dc89[_0xe735('0x9')][_0xe735('0xb')]);this[_0xe735('0xc')]=_0x14dc89[_0xe735('0x8')];this[_0xe735('0xd')]=_0x245b41['name'];this[_0xe735('0xe')]=_0x14dc89['active']||![];this['type']=_0x245b41['type'];this[_0xe735('0xf')]=_0x245b41[_0xe735('0xf')]||0x3;this[_0xe735('0x10')]=_0x14dc89[_0xe735('0x10')];this[_0xe735('0x11')]=_0x14dc89['countbusyretry'];this['countcongestionretry']=_0x14dc89[_0xe735('0x12')];this[_0xe735('0x13')]=_0x14dc89[_0xe735('0x13')];this[_0xe735('0x14')]=_0x14dc89[_0xe735('0x14')];this[_0xe735('0x15')]=_0x14dc89[_0xe735('0x15')];this[_0xe735('0x16')]=_0x14dc89[_0xe735('0x16')];this[_0xe735('0x17')]=_0x14dc89[_0xe735('0x17')];this['countagentrejectretry']=_0x14dc89[_0xe735('0x18')];this[_0xe735('0x19')]=_0x14dc89[_0xe735('0x19')];this['ListId']=_0x14dc89[_0xe735('0x1a')];this['UserId']=_0x14dc89[_0xe735('0x1b')];this['VoiceQueueId']=_0x14dc89[_0xe735('0x1c')];this[_0xe735('0x1d')]=_0x14dc89[_0xe735('0x1d')];this[_0xe735('0x1e')]=_0x14dc89['id'];this[_0xe735('0x1f')]=_0x14dc89[_0xe735('0x9')][_0xe735('0xa')]||'';this[_0xe735('0x20')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xe735('0x21')]=_0x14dc89[_0xe735('0x21')];this[_0xe735('0x22')]=_0x14dc89[_0xe735('0x22')];this[_0xe735('0x23')]=_0x14dc89[_0xe735('0x23')];this[_0xe735('0x24')]=_0x14dc89[_0xe735('0x24')];this[_0xe735('0x25')]='';this['originatecalleridname']='';}Action[_0xe735('0x26')][_0xe735('0x27')]=function(){return util[_0xe735('0x28')](_0xe735('0x29'),this['name'],this['voiceQueue'][_0xe735('0x2a')]>0x0?this['number'][_0xe735('0x2b')](this[_0xe735('0x5')]['dialCutDigit']):this[_0xe735('0xc')]);};Action[_0xe735('0x26')][_0xe735('0x2c')]=function(){return this[_0xe735('0xd')];};module['exports']=Action;