Built motion from commit (unavailable).|2.5.6
[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 _0x5cf1=['chat','ChatWebsiteId','account','AccountId','upperFirst','channel','InteractionId','Message','create','then','info','[%s][MESSAGE]\x20%s','body','catch','error','stop','stringify','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact'];(function(_0x424329,_0x1a3e61){var _0x324625=function(_0x3e2ce2){while(--_0x3e2ce2){_0x424329['push'](_0x424329['shift']());}};_0x324625(++_0x1a3e61);}(_0x5cf1,0x199));var _0x15cf=function(_0xb8acf0,_0x10998d){_0xb8acf0=_0xb8acf0-0x0;var _0xf96b2f=_0x5cf1[_0xb8acf0];return _0xf96b2f;};'use strict';var _=require(_0x15cf('0x0'));var utils=require(_0x15cf('0x1'));var logger=require(_0x15cf('0x2'))('routing');var rpc={'chatMessage':require(_0x15cf('0x3')),'openchannelMessage':require(_0x15cf('0x4')),'mailMessage':require(_0x15cf('0x5')),'smsMessage':require(_0x15cf('0x6')),'faxMessage':require(_0x15cf('0x7')),'whatsappMessage':require(_0x15cf('0x8'))};exports['consequence']=function(_0x47dedd,_0x3cd104){return function(_0x485063){try{var _0x198b23={'body':utils[_0x15cf('0x9')](_0x3cd104[0x0],this),'ContactId':this[_0x15cf('0xa')]['id']};if(this['channel']===_0x15cf('0xb')){_0x198b23[_0x15cf('0xc')]=this[_0x15cf('0xd')]['id'];}else{_0x198b23[_['upperFirst'](this['channel'])+_0x15cf('0xe')]=this[_0x15cf('0xd')]['id'];}_0x198b23[_[_0x15cf('0xf')](this[_0x15cf('0x10')])+_0x15cf('0x11')]=this['interaction']['id'];if(rpc[this[_0x15cf('0x10')]+_0x15cf('0x12')]){return rpc[this[_0x15cf('0x10')]+_0x15cf('0x12')][_0x15cf('0x13')](_0x198b23)[_0x15cf('0x14')](function(_0x45a442){logger[_0x15cf('0x15')](_0x15cf('0x16'),_0x47dedd,_0x198b23[_0x15cf('0x17')]);_0x485063['next']();})[_0x15cf('0x18')](function(_0x5f230d){logger[_0x15cf('0x19')](_0x15cf('0x16'),_0x47dedd,JSON['stringify'](_0x5f230d));_0x485063[_0x15cf('0x1a')]();});}}catch(_0x25994b){logger[_0x15cf('0x19')](_0x15cf('0x16'),_0x47dedd,JSON[_0x15cf('0x1b')](_0x25994b));_0x485063[_0x15cf('0x1a')]();}};};