b2dfc62ebf85505568aa59ae2c66998577abbef7
[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 _0x7f65=['debug','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent'];(function(_0x5c5604,_0x58cb5e){var _0xf036e8=function(_0x1c01a4){while(--_0x1c01a4){_0x5c5604['push'](_0x5c5604['shift']());}};_0xf036e8(++_0x58cb5e);}(_0x7f65,0xed));var _0x57f6=function(_0x54948e,_0xf4d899){_0x54948e=_0x54948e-0x0;var _0x4098c4=_0x7f65[_0x54948e];return _0x4098c4;};'use strict';var _=require('lodash');var util=require(_0x57f6('0x0'));var moment=require('moment');var BPromise=require(_0x57f6('0x1'));var rs=require(_0x57f6('0x2'));var fs=require('fs');var Redis=require(_0x57f6('0x3'));var db=require(_0x57f6('0x4'))['db'];var utils=require(_0x57f6('0x5'));var logger=require(_0x57f6('0x6'))(_0x57f6('0x7'));var config=require(_0x57f6('0x8'));var jayson=require(_0x57f6('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5582ff,_0x2494ea,_0x598714){return new BPromise(function(_0x8b987c,_0x1f8cef){return client[_0x57f6('0xa')](_0x5582ff,_0x598714)[_0x57f6('0xb')](function(_0x6fb6b7){logger[_0x57f6('0xc')](_0x57f6('0xd'),_0x2494ea,_0x57f6('0xe'));logger[_0x57f6('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2494ea,_0x57f6('0xe'),JSON[_0x57f6('0x10')](_0x6fb6b7));if(_0x6fb6b7[_0x57f6('0x11')]){if(_0x6fb6b7['error']['code']===0x1f4){logger[_0x57f6('0x11')](_0x57f6('0xd'),_0x2494ea,_0x6fb6b7[_0x57f6('0x11')]['message']);return _0x1f8cef(_0x6fb6b7[_0x57f6('0x11')]['message']);}logger[_0x57f6('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x2494ea,_0x6fb6b7[_0x57f6('0x11')]['message']);return _0x8b987c(_0x6fb6b7[_0x57f6('0x11')][_0x57f6('0x12')]);}else{logger[_0x57f6('0xc')](_0x57f6('0xd'),_0x2494ea,_0x57f6('0xe'));_0x8b987c(_0x6fb6b7[_0x57f6('0x13')][_0x57f6('0x12')]);}})[_0x57f6('0x14')](function(_0xd9c150){logger[_0x57f6('0x11')](_0x57f6('0xd'),_0x2494ea,_0xd9c150);_0x1f8cef(_0xd9c150);});});}