07f94e4d2cdf2adf915d8b95f7dc431546c871af
[motion2.git] / server / api / smsTransferReport / smsTransferReport.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 _0x5292=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3d987b,_0x50f1bd){var _0x3d8eba=function(_0x565437){while(--_0x565437){_0x3d987b['push'](_0x3d987b['shift']());}};_0x3d8eba(++_0x50f1bd);}(_0x5292,0xf7));var _0x2529=function(_0x113cf9,_0x358825){_0x113cf9=_0x113cf9-0x0;var _0x5842ad=_0x5292[_0x113cf9];return _0x5842ad;};'use strict';var _=require(_0x2529('0x0'));var util=require(_0x2529('0x1'));var moment=require('moment');var BPromise=require(_0x2529('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2529('0x3'));var db=require(_0x2529('0x4'))['db'];var utils=require(_0x2529('0x5'));var logger=require(_0x2529('0x6'))('rpc');var config=require(_0x2529('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x407277,_0x43cbef,_0x5bb8a1){return new BPromise(function(_0x5c3355,_0x395ba9){return client[_0x2529('0x8')](_0x407277,_0x5bb8a1)['then'](function(_0xa234ac){logger[_0x2529('0x9')](_0x2529('0xa'),_0x43cbef,_0x2529('0xb'));logger[_0x2529('0xc')](_0x2529('0xd'),_0x43cbef,_0x2529('0xb'),JSON[_0x2529('0xe')](_0xa234ac));if(_0xa234ac['error']){if(_0xa234ac[_0x2529('0xf')][_0x2529('0x10')]===0x1f4){logger['error'](_0x2529('0xa'),_0x43cbef,_0xa234ac[_0x2529('0xf')][_0x2529('0x11')]);return _0x395ba9(_0xa234ac[_0x2529('0xf')][_0x2529('0x11')]);}logger[_0x2529('0xf')](_0x2529('0xa'),_0x43cbef,_0xa234ac['error'][_0x2529('0x11')]);return _0x5c3355(_0xa234ac[_0x2529('0xf')][_0x2529('0x11')]);}else{logger[_0x2529('0x9')](_0x2529('0xa'),_0x43cbef,_0x2529('0xb'));_0x5c3355(_0xa234ac[_0x2529('0x12')][_0x2529('0x11')]);}})['catch'](function(_0x163bf4){logger['error'](_0x2529('0xa'),_0x43cbef,_0x163bf4);_0x395ba9(_0x163bf4);});});}