94fdc05374130f88611b58275b3ef83a8afe31d3
[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 _0xc03e=['catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x16938f,_0x35e57f){var _0x5c66e9=function(_0x5167d7){while(--_0x5167d7){_0x16938f['push'](_0x16938f['shift']());}};_0x5c66e9(++_0x35e57f);}(_0xc03e,0x15a));var _0xec03=function(_0x506d2f,_0x5ab76e){_0x506d2f=_0x506d2f-0x0;var _0x101255=_0xc03e[_0x506d2f];return _0x101255;};'use strict';var _=require(_0xec03('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xec03('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec03('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xec03('0x3'));var logger=require(_0xec03('0x4'))(_0xec03('0x5'));var config=require(_0xec03('0x6'));var jayson=require(_0xec03('0x7'));var client=jayson[_0xec03('0x8')][_0xec03('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcaaf03,_0x278f90,_0x529ebd){return new BPromise(function(_0x4205e9,_0xb0638e){return client[_0xec03('0xa')](_0xcaaf03,_0x529ebd)[_0xec03('0xb')](function(_0x4d7e09){logger[_0xec03('0xc')](_0xec03('0xd'),_0x278f90,_0xec03('0xe'));logger[_0xec03('0xf')](_0xec03('0x10'),_0x278f90,_0xec03('0xe'),JSON[_0xec03('0x11')](_0x4d7e09));if(_0x4d7e09[_0xec03('0x12')]){if(_0x4d7e09['error'][_0xec03('0x13')]===0x1f4){logger[_0xec03('0x12')](_0xec03('0xd'),_0x278f90,_0x4d7e09[_0xec03('0x12')][_0xec03('0x14')]);return _0xb0638e(_0x4d7e09[_0xec03('0x12')][_0xec03('0x14')]);}logger[_0xec03('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x278f90,_0x4d7e09['error']['message']);return _0x4205e9(_0x4d7e09[_0xec03('0x12')][_0xec03('0x14')]);}else{logger[_0xec03('0xc')](_0xec03('0xd'),_0x278f90,_0xec03('0xe'));_0x4205e9(_0x4d7e09[_0xec03('0x15')][_0xec03('0x14')]);}})[_0xec03('0x16')](function(_0x5c2f1a){logger[_0xec03('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x278f90,_0x5c2f1a);_0xb0638e(_0x5c2f1a);});});}