Built motion from commit (unavailable).|2.5.22
[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 _0x8910=['stringify','error','code','message','info','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2fb6cf,_0x2a3ed1){var _0x487e2b=function(_0x10265e){while(--_0x10265e){_0x2fb6cf['push'](_0x2fb6cf['shift']());}};_0x487e2b(++_0x2a3ed1);}(_0x8910,0x13a));var _0x0891=function(_0x246227,_0x12bfcb){_0x246227=_0x246227-0x0;var _0x37bd4a=_0x8910[_0x246227];return _0x37bd4a;};'use strict';var _=require(_0x0891('0x0'));var util=require(_0x0891('0x1'));var moment=require(_0x0891('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0891('0x3'));var db=require(_0x0891('0x4'))['db'];var utils=require(_0x0891('0x5'));var logger=require('../../config/logger')(_0x0891('0x6'));var config=require(_0x0891('0x7'));var jayson=require(_0x0891('0x8'));var client=jayson[_0x0891('0x9')][_0x0891('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41aeba,_0x3b2a4d,_0x717093){return new BPromise(function(_0x8235dc,_0x2ceee4){return client[_0x0891('0xb')](_0x41aeba,_0x717093)[_0x0891('0xc')](function(_0x196622){logger['info'](_0x0891('0xd'),_0x3b2a4d,_0x0891('0xe'));logger[_0x0891('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x3b2a4d,_0x0891('0xe'),JSON[_0x0891('0x10')](_0x196622));if(_0x196622[_0x0891('0x11')]){if(_0x196622[_0x0891('0x11')][_0x0891('0x12')]===0x1f4){logger[_0x0891('0x11')](_0x0891('0xd'),_0x3b2a4d,_0x196622[_0x0891('0x11')][_0x0891('0x13')]);return _0x2ceee4(_0x196622[_0x0891('0x11')][_0x0891('0x13')]);}logger[_0x0891('0x11')](_0x0891('0xd'),_0x3b2a4d,_0x196622['error'][_0x0891('0x13')]);return _0x8235dc(_0x196622[_0x0891('0x11')][_0x0891('0x13')]);}else{logger[_0x0891('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x3b2a4d,_0x0891('0xe'));_0x8235dc(_0x196622[_0x0891('0x15')][_0x0891('0x13')]);}})['catch'](function(_0x1ddcd9){logger['error'](_0x0891('0xd'),_0x3b2a4d,_0x1ddcd9);_0x2ceee4(_0x1ddcd9);});});}