Built motion from commit 9d1906d1.|2.5.40
[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 _0x23ea=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','SmsTransferReport,\x20%s,\x20%s','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','lodash','util','moment','bluebird','randomstring'];(function(_0x451b25,_0x19488d){var _0x3695c8=function(_0x543679){while(--_0x543679){_0x451b25['push'](_0x451b25['shift']());}};_0x3695c8(++_0x19488d);}(_0x23ea,0xc3));var _0xa23e=function(_0x4cb9d5,_0x187d5a){_0x4cb9d5=_0x4cb9d5-0x0;var _0x444523=_0x23ea[_0x4cb9d5];return _0x444523;};'use strict';var _=require(_0xa23e('0x0'));var util=require(_0xa23e('0x1'));var moment=require(_0xa23e('0x2'));var BPromise=require(_0xa23e('0x3'));var rs=require(_0xa23e('0x4'));var fs=require('fs');var Redis=require(_0xa23e('0x5'));var db=require(_0xa23e('0x6'))['db'];var utils=require(_0xa23e('0x7'));var logger=require(_0xa23e('0x8'))(_0xa23e('0x9'));var config=require(_0xa23e('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa23e('0xb')][_0xa23e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5754df,_0x90bd9a,_0x28ac6c){return new BPromise(function(_0x1d2a99,_0x4e5680){return client['request'](_0x5754df,_0x28ac6c)[_0xa23e('0xd')](function(_0x138e45){logger[_0xa23e('0xe')](_0xa23e('0xf'),_0x90bd9a,'request\x20sent');logger['debug'](_0xa23e('0x10'),_0x90bd9a,_0xa23e('0x11'),JSON['stringify'](_0x138e45));if(_0x138e45[_0xa23e('0x12')]){if(_0x138e45[_0xa23e('0x12')]['code']===0x1f4){logger[_0xa23e('0x12')](_0xa23e('0xf'),_0x90bd9a,_0x138e45[_0xa23e('0x12')][_0xa23e('0x13')]);return _0x4e5680(_0x138e45['error'][_0xa23e('0x13')]);}logger[_0xa23e('0x12')](_0xa23e('0xf'),_0x90bd9a,_0x138e45['error'][_0xa23e('0x13')]);return _0x1d2a99(_0x138e45[_0xa23e('0x12')][_0xa23e('0x13')]);}else{logger[_0xa23e('0xe')](_0xa23e('0xf'),_0x90bd9a,_0xa23e('0x11'));_0x1d2a99(_0x138e45['result'][_0xa23e('0x13')]);}})['catch'](function(_0x371665){logger[_0xa23e('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x90bd9a,_0x371665);_0x4e5680(_0x371665);});});}