dc1bf18a8d1b6c552f86b32f8821c8605cabe74b
[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 _0x972c=['../../config/environment','jayson/promise','http','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','moment','bluebird','ioredis','../../mysqldb','rpc'];(function(_0x67f7cf,_0x3d5e30){var _0x2d5472=function(_0x51939c){while(--_0x51939c){_0x67f7cf['push'](_0x67f7cf['shift']());}};_0x2d5472(++_0x3d5e30);}(_0x972c,0xf2));var _0xc972=function(_0x581249,_0x483f03){_0x581249=_0x581249-0x0;var _0x284bae=_0x972c[_0x581249];return _0x284bae;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc972('0x0'));var BPromise=require(_0xc972('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc972('0x2'));var db=require(_0xc972('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc972('0x4'));var config=require(_0xc972('0x5'));var jayson=require(_0xc972('0x6'));var client=jayson['client'][_0xc972('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4cff66,_0x1c1a16,_0xd8cd25){return new BPromise(function(_0x304d08,_0x5ef7c4){return client['request'](_0x4cff66,_0xd8cd25)['then'](function(_0xa1400f){logger['info'](_0xc972('0x8'),_0x1c1a16,_0xc972('0x9'));logger[_0xc972('0xa')](_0xc972('0xb'),_0x1c1a16,_0xc972('0x9'),JSON[_0xc972('0xc')](_0xa1400f));if(_0xa1400f[_0xc972('0xd')]){if(_0xa1400f['error'][_0xc972('0xe')]===0x1f4){logger[_0xc972('0xd')](_0xc972('0x8'),_0x1c1a16,_0xa1400f['error'][_0xc972('0xf')]);return _0x5ef7c4(_0xa1400f[_0xc972('0xd')][_0xc972('0xf')]);}logger['error'](_0xc972('0x8'),_0x1c1a16,_0xa1400f[_0xc972('0xd')][_0xc972('0xf')]);return _0x304d08(_0xa1400f[_0xc972('0xd')]['message']);}else{logger[_0xc972('0x10')](_0xc972('0x8'),_0x1c1a16,_0xc972('0x9'));_0x304d08(_0xa1400f[_0xc972('0x11')][_0xc972('0xf')]);}})[_0xc972('0x12')](function(_0x1e3389){logger[_0xc972('0xd')](_0xc972('0x8'),_0x1c1a16,_0x1e3389);_0x5ef7c4(_0x1e3389);});});}