Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / chatProactiveAction / chatProactiveAction.rpc.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 _0xa432=['client','request','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3a6144,_0xb18290){var _0xc8fad4=function(_0x3a19d2){while(--_0x3a19d2){_0x3a6144['push'](_0x3a6144['shift']());}};_0xc8fad4(++_0xb18290);}(_0xa432,0x125));var _0x2a43=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xa432[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x2a43('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2a43('0x1'));var fs=require('fs');var Redis=require(_0x2a43('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2a43('0x3'));var logger=require(_0x2a43('0x4'))(_0x2a43('0x5'));var config=require(_0x2a43('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2a43('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48d040,_0x176050,_0x180d56){return new BPromise(function(_0x564ed5,_0x2a1af1){return client[_0x2a43('0x8')](_0x48d040,_0x180d56)['then'](function(_0x1e672d){logger['info'](_0x2a43('0x9'),_0x176050,_0x2a43('0xa'));logger[_0x2a43('0xb')](_0x2a43('0xc'),_0x176050,'request\x20sent',JSON[_0x2a43('0xd')](_0x1e672d));if(_0x1e672d['error']){if(_0x1e672d[_0x2a43('0xe')][_0x2a43('0xf')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x176050,_0x1e672d[_0x2a43('0xe')]['message']);return _0x2a1af1(_0x1e672d[_0x2a43('0xe')]['message']);}logger[_0x2a43('0xe')](_0x2a43('0x9'),_0x176050,_0x1e672d[_0x2a43('0xe')]['message']);return _0x564ed5(_0x1e672d[_0x2a43('0xe')][_0x2a43('0x10')]);}else{logger[_0x2a43('0x11')](_0x2a43('0x9'),_0x176050,_0x2a43('0xa'));_0x564ed5(_0x1e672d[_0x2a43('0x12')][_0x2a43('0x10')]);}})[_0x2a43('0x13')](function(_0x35c939){logger[_0x2a43('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x176050,_0x35c939);_0x2a1af1(_0x35c939);});});}