Built motion from commit 25580385.|2.6.2
[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 _0x9e3f=['../../config/environment','jayson/promise','request','then','info','debug','request\x20sent','stringify','error','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9e3f,0x1f0));var _0xf9e3=function(_0x5c1a6b,_0x3f69d9){_0x5c1a6b=_0x5c1a6b-0x0;var _0x33a54a=_0x9e3f[_0x5c1a6b];return _0x33a54a;};'use strict';var _=require(_0xf9e3('0x0'));var util=require('util');var moment=require(_0xf9e3('0x1'));var BPromise=require(_0xf9e3('0x2'));var rs=require(_0xf9e3('0x3'));var fs=require('fs');var Redis=require(_0xf9e3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf9e3('0x5'));var logger=require(_0xf9e3('0x6'))(_0xf9e3('0x7'));var config=require(_0xf9e3('0x8'));var jayson=require(_0xf9e3('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2bcb44,_0x33718a,_0x1e7ef1){return new BPromise(function(_0x30073f,_0x58d2ba){return client[_0xf9e3('0xa')](_0x2bcb44,_0x1e7ef1)[_0xf9e3('0xb')](function(_0x3f7ccd){logger[_0xf9e3('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x33718a,'request\x20sent');logger[_0xf9e3('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x33718a,_0xf9e3('0xe'),JSON[_0xf9e3('0xf')](_0x3f7ccd));if(_0x3f7ccd[_0xf9e3('0x10')]){if(_0x3f7ccd[_0xf9e3('0x10')]['code']===0x1f4){logger[_0xf9e3('0x10')](_0xf9e3('0x11'),_0x33718a,_0x3f7ccd[_0xf9e3('0x10')]['message']);return _0x58d2ba(_0x3f7ccd[_0xf9e3('0x10')]['message']);}logger[_0xf9e3('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x33718a,_0x3f7ccd['error']['message']);return _0x30073f(_0x3f7ccd[_0xf9e3('0x10')][_0xf9e3('0x12')]);}else{logger[_0xf9e3('0xc')](_0xf9e3('0x11'),_0x33718a,_0xf9e3('0xe'));_0x30073f(_0x3f7ccd[_0xf9e3('0x13')][_0xf9e3('0x12')]);}})[_0xf9e3('0x14')](function(_0xceb067){logger[_0xf9e3('0x10')](_0xf9e3('0x11'),_0x33718a,_0xceb067);_0x58d2ba(_0xceb067);});});}