eba773d4a0cad27ba5bdd52cf561b24b67cffb59
[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 _0x15cb=['request\x20sent','stringify','error','code','message','info','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','SmsTransferReport,\x20%s,\x20%s'];(function(_0x193e41,_0x4dd14a){var _0x196000=function(_0x2f2c67){while(--_0x2f2c67){_0x193e41['push'](_0x193e41['shift']());}};_0x196000(++_0x4dd14a);}(_0x15cb,0x16f));var _0xb15c=function(_0x46e324,_0x20625f){_0x46e324=_0x46e324-0x0;var _0x6ef733=_0x15cb[_0x46e324];return _0x6ef733;};'use strict';var _=require('lodash');var util=require(_0xb15c('0x0'));var moment=require('moment');var BPromise=require(_0xb15c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb15c('0x2'));var db=require(_0xb15c('0x3'))['db'];var utils=require(_0xb15c('0x4'));var logger=require(_0xb15c('0x5'))('rpc');var config=require(_0xb15c('0x6'));var jayson=require(_0xb15c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x161c9c,_0x2c18ad,_0x1c75a8){return new BPromise(function(_0x3ad071,_0x157a90){return client[_0xb15c('0x8')](_0x161c9c,_0x1c75a8)[_0xb15c('0x9')](function(_0x12ebcd){logger['info'](_0xb15c('0xa'),_0x2c18ad,'request\x20sent');logger['debug']('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x2c18ad,_0xb15c('0xb'),JSON[_0xb15c('0xc')](_0x12ebcd));if(_0x12ebcd[_0xb15c('0xd')]){if(_0x12ebcd[_0xb15c('0xd')][_0xb15c('0xe')]===0x1f4){logger[_0xb15c('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x2c18ad,_0x12ebcd['error'][_0xb15c('0xf')]);return _0x157a90(_0x12ebcd['error'][_0xb15c('0xf')]);}logger[_0xb15c('0xd')](_0xb15c('0xa'),_0x2c18ad,_0x12ebcd[_0xb15c('0xd')][_0xb15c('0xf')]);return _0x3ad071(_0x12ebcd[_0xb15c('0xd')][_0xb15c('0xf')]);}else{logger[_0xb15c('0x10')](_0xb15c('0xa'),_0x2c18ad,_0xb15c('0xb'));_0x3ad071(_0x12ebcd['result'][_0xb15c('0xf')]);}})[_0xb15c('0x11')](function(_0x5d0d92){logger[_0xb15c('0xd')](_0xb15c('0xa'),_0x2c18ad,_0x5d0d92);_0x157a90(_0x5d0d92);});});}