Built motion from commit 3e059bc2.|2.5.32
[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 _0x891b=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','moment'];(function(_0x5e7f24,_0x102f04){var _0x1a8d22=function(_0x456149){while(--_0x456149){_0x5e7f24['push'](_0x5e7f24['shift']());}};_0x1a8d22(++_0x102f04);}(_0x891b,0xc5));var _0xb891=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x891b[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb891('0x0'));var BPromise=require(_0xb891('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb891('0x2'));var db=require(_0xb891('0x3'))['db'];var utils=require(_0xb891('0x4'));var logger=require(_0xb891('0x5'))('rpc');var config=require(_0xb891('0x6'));var jayson=require(_0xb891('0x7'));var client=jayson['client'][_0xb891('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4eda97,_0x47ecc2,_0x5521f0){return new BPromise(function(_0x134dc0,_0x367478){return client[_0xb891('0x9')](_0x4eda97,_0x5521f0)[_0xb891('0xa')](function(_0x1ab1d6){logger[_0xb891('0xb')](_0xb891('0xc'),_0x47ecc2,'request\x20sent');logger[_0xb891('0xd')](_0xb891('0xe'),_0x47ecc2,_0xb891('0xf'),JSON[_0xb891('0x10')](_0x1ab1d6));if(_0x1ab1d6[_0xb891('0x11')]){if(_0x1ab1d6[_0xb891('0x11')][_0xb891('0x12')]===0x1f4){logger[_0xb891('0x11')](_0xb891('0xc'),_0x47ecc2,_0x1ab1d6[_0xb891('0x11')][_0xb891('0x13')]);return _0x367478(_0x1ab1d6['error'][_0xb891('0x13')]);}logger[_0xb891('0x11')](_0xb891('0xc'),_0x47ecc2,_0x1ab1d6['error'][_0xb891('0x13')]);return _0x134dc0(_0x1ab1d6[_0xb891('0x11')]['message']);}else{logger[_0xb891('0xb')]('SmsTransferReport,\x20%s,\x20%s',_0x47ecc2,_0xb891('0xf'));_0x134dc0(_0x1ab1d6[_0xb891('0x14')][_0xb891('0x13')]);}})[_0xb891('0x15')](function(_0x1fd866){logger[_0xb891('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x47ecc2,_0x1fd866);_0x367478(_0x1fd866);});});}