Built motion from commit 52c8a02d.|2.6.29
[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 _0xa381=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x210d0a,_0x2270b8){var _0x1fdfbe=function(_0x57b89b){while(--_0x57b89b){_0x210d0a['push'](_0x210d0a['shift']());}};_0x1fdfbe(++_0x2270b8);}(_0xa381,0x79));var _0x1a38=function(_0x5e5a99,_0x279a17){_0x5e5a99=_0x5e5a99-0x0;var _0x37bbda=_0xa381[_0x5e5a99];return _0x37bbda;};'use strict';var _=require(_0x1a38('0x0'));var util=require(_0x1a38('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1a38('0x2'));var fs=require('fs');var Redis=require(_0x1a38('0x3'));var db=require(_0x1a38('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a38('0x5'))(_0x1a38('0x6'));var config=require(_0x1a38('0x7'));var jayson=require(_0x1a38('0x8'));var client=jayson['client'][_0x1a38('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x569e9f,_0x5c8ab1,_0x3d12f8){return new BPromise(function(_0x4df1db,_0x46e61d){return client[_0x1a38('0xa')](_0x569e9f,_0x3d12f8)[_0x1a38('0xb')](function(_0x4676ff){logger['info'](_0x1a38('0xc'),_0x5c8ab1,_0x1a38('0xd'));logger[_0x1a38('0xe')](_0x1a38('0xf'),_0x5c8ab1,_0x1a38('0xd'),JSON[_0x1a38('0x10')](_0x4676ff));if(_0x4676ff[_0x1a38('0x11')]){if(_0x4676ff[_0x1a38('0x11')][_0x1a38('0x12')]===0x1f4){logger[_0x1a38('0x11')](_0x1a38('0xc'),_0x5c8ab1,_0x4676ff[_0x1a38('0x11')][_0x1a38('0x13')]);return _0x46e61d(_0x4676ff[_0x1a38('0x11')][_0x1a38('0x13')]);}logger[_0x1a38('0x11')](_0x1a38('0xc'),_0x5c8ab1,_0x4676ff[_0x1a38('0x11')][_0x1a38('0x13')]);return _0x4df1db(_0x4676ff[_0x1a38('0x11')][_0x1a38('0x13')]);}else{logger[_0x1a38('0x14')](_0x1a38('0xc'),_0x5c8ab1,'request\x20sent');_0x4df1db(_0x4676ff['result'][_0x1a38('0x13')]);}})['catch'](function(_0x424d27){logger[_0x1a38('0x11')](_0x1a38('0xc'),_0x5c8ab1,_0x424d27);_0x46e61d(_0x424d27);});});}