Built motion from commit (unavailable).|2.5.29
[motion2.git] / server / services / routing / server / applications / message.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 _0xf436=['routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','getMustacheRender','contact','chat','ChatWebsiteId','account','upperFirst','AccountId','channel','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','stringify','stop','lodash','./utils','../../../../config/logger'];(function(_0x3dcbdf,_0x10b9a6){var _0x5eb579=function(_0xdeacc5){while(--_0xdeacc5){_0x3dcbdf['push'](_0x3dcbdf['shift']());}};_0x5eb579(++_0x10b9a6);}(_0xf436,0xba));var _0x6f43=function(_0x5690ea,_0x5ae260){_0x5690ea=_0x5690ea-0x0;var _0x5f4c50=_0xf436[_0x5690ea];return _0x5f4c50;};'use strict';var _=require(_0x6f43('0x0'));var utils=require(_0x6f43('0x1'));var logger=require(_0x6f43('0x2'))(_0x6f43('0x3'));var rpc={'chatMessage':require(_0x6f43('0x4')),'openchannelMessage':require(_0x6f43('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x6f43('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x1da98a,_0x47555c){return function(_0x2c23ad){try{var _0x3b2362={'body':utils[_0x6f43('0x7')](_0x47555c[0x0],this),'ContactId':this[_0x6f43('0x8')]['id']};if(this['channel']===_0x6f43('0x9')){_0x3b2362[_0x6f43('0xa')]=this[_0x6f43('0xb')]['id'];}else{_0x3b2362[_[_0x6f43('0xc')](this['channel'])+_0x6f43('0xd')]=this[_0x6f43('0xb')]['id'];}_0x3b2362[_[_0x6f43('0xc')](this[_0x6f43('0xe')])+_0x6f43('0xf')]=this[_0x6f43('0x10')]['id'];if(rpc[this['channel']+_0x6f43('0x11')]){return rpc[this[_0x6f43('0xe')]+_0x6f43('0x11')][_0x6f43('0x12')](_0x3b2362)[_0x6f43('0x13')](function(_0x69f17d){logger[_0x6f43('0x14')](_0x6f43('0x15'),_0x1da98a,_0x3b2362[_0x6f43('0x16')]);_0x2c23ad[_0x6f43('0x17')]();})[_0x6f43('0x18')](function(_0x1e1b4e){logger['error'](_0x6f43('0x15'),_0x1da98a,JSON[_0x6f43('0x19')](_0x1e1b4e));_0x2c23ad['stop']();});}}catch(_0x2f6f88){logger['error'](_0x6f43('0x15'),_0x1da98a,JSON[_0x6f43('0x19')](_0x2f6f88));_0x2c23ad[_0x6f43('0x1a')]();}};};