Built motion from commit (unavailable).|2.5.21
[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 _0xc747=['http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','rpc','jayson/promise','client'];(function(_0x28b1fb,_0x326f90){var _0x38afbc=function(_0xefbf4a){while(--_0xefbf4a){_0x28b1fb['push'](_0x28b1fb['shift']());}};_0x38afbc(++_0x326f90);}(_0xc747,0x174));var _0x7c74=function(_0x6f1f57,_0x6510a4){_0x6f1f57=_0x6f1f57-0x0;var _0x51dcf9=_0xc747[_0x6f1f57];return _0x51dcf9;};'use strict';var _=require(_0x7c74('0x0'));var util=require(_0x7c74('0x1'));var moment=require(_0x7c74('0x2'));var BPromise=require(_0x7c74('0x3'));var rs=require(_0x7c74('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7c74('0x5'));var config=require('../../config/environment');var jayson=require(_0x7c74('0x6'));var client=jayson[_0x7c74('0x7')][_0x7c74('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42fe03,_0x160d14,_0x27872a){return new BPromise(function(_0x223ff7,_0x257286){return client[_0x7c74('0x9')](_0x42fe03,_0x27872a)['then'](function(_0xad5099){logger[_0x7c74('0xa')](_0x7c74('0xb'),_0x160d14,_0x7c74('0xc'));logger[_0x7c74('0xd')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x160d14,_0x7c74('0xc'),JSON[_0x7c74('0xe')](_0xad5099));if(_0xad5099[_0x7c74('0xf')]){if(_0xad5099[_0x7c74('0xf')][_0x7c74('0x10')]===0x1f4){logger[_0x7c74('0xf')](_0x7c74('0xb'),_0x160d14,_0xad5099['error']['message']);return _0x257286(_0xad5099['error'][_0x7c74('0x11')]);}logger[_0x7c74('0xf')](_0x7c74('0xb'),_0x160d14,_0xad5099[_0x7c74('0xf')]['message']);return _0x223ff7(_0xad5099['error'][_0x7c74('0x11')]);}else{logger[_0x7c74('0xa')](_0x7c74('0xb'),_0x160d14,_0x7c74('0xc'));_0x223ff7(_0xad5099[_0x7c74('0x12')]['message']);}})['catch'](function(_0x14274f){logger[_0x7c74('0xf')](_0x7c74('0xb'),_0x160d14,_0x14274f);_0x257286(_0x14274f);});});}