Built motion from commit 449495f6.|2.6.27
[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 _0x017e=['then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x427352,_0x1bce61){var _0x23e0e6=function(_0x2a42a9){while(--_0x2a42a9){_0x427352['push'](_0x427352['shift']());}};_0x23e0e6(++_0x1bce61);}(_0x017e,0xdd));var _0xe017=function(_0x10b7de,_0x51cf9d){_0x10b7de=_0x10b7de-0x0;var _0xd51c81=_0x017e[_0x10b7de];return _0xd51c81;};'use strict';var _=require(_0xe017('0x0'));var util=require(_0xe017('0x1'));var moment=require('moment');var BPromise=require(_0xe017('0x2'));var rs=require(_0xe017('0x3'));var fs=require('fs');var Redis=require(_0xe017('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe017('0x5'))(_0xe017('0x6'));var config=require(_0xe017('0x7'));var jayson=require(_0xe017('0x8'));var client=jayson[_0xe017('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x101d41,_0x50d26f,_0x2e0420){return new BPromise(function(_0x57b19c,_0x37ed9f){return client['request'](_0x101d41,_0x2e0420)[_0xe017('0xa')](function(_0x97a35a){logger[_0xe017('0xb')](_0xe017('0xc'),_0x50d26f,_0xe017('0xd'));logger[_0xe017('0xe')](_0xe017('0xf'),_0x50d26f,'request\x20sent',JSON[_0xe017('0x10')](_0x97a35a));if(_0x97a35a[_0xe017('0x11')]){if(_0x97a35a[_0xe017('0x11')][_0xe017('0x12')]===0x1f4){logger[_0xe017('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x50d26f,_0x97a35a[_0xe017('0x11')][_0xe017('0x13')]);return _0x37ed9f(_0x97a35a[_0xe017('0x11')][_0xe017('0x13')]);}logger['error'](_0xe017('0xc'),_0x50d26f,_0x97a35a[_0xe017('0x11')][_0xe017('0x13')]);return _0x57b19c(_0x97a35a[_0xe017('0x11')][_0xe017('0x13')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x50d26f,_0xe017('0xd'));_0x57b19c(_0x97a35a[_0xe017('0x14')][_0xe017('0x13')]);}})['catch'](function(_0x332810){logger[_0xe017('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x50d26f,_0x332810);_0x37ed9f(_0x332810);});});}