Built motion from commit 14588770.|2.5.38
[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 _0xc3a8=['result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','SmsTransferReport,\x20%s,\x20%s'];(function(_0x20bce8,_0x4c9684){var _0xb9a2b3=function(_0x4a1dd3){while(--_0x4a1dd3){_0x20bce8['push'](_0x20bce8['shift']());}};_0xb9a2b3(++_0x4c9684);}(_0xc3a8,0xe8));var _0x8c3a=function(_0x1261c2,_0x3ef819){_0x1261c2=_0x1261c2-0x0;var _0x3aabd2=_0xc3a8[_0x1261c2];return _0x3aabd2;};'use strict';var _=require(_0x8c3a('0x0'));var util=require(_0x8c3a('0x1'));var moment=require(_0x8c3a('0x2'));var BPromise=require('bluebird');var rs=require(_0x8c3a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c3a('0x4'))['db'];var utils=require(_0x8c3a('0x5'));var logger=require(_0x8c3a('0x6'))(_0x8c3a('0x7'));var config=require('../../config/environment');var jayson=require(_0x8c3a('0x8'));var client=jayson[_0x8c3a('0x9')][_0x8c3a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x170999,_0x2fae6f,_0x37047e){return new BPromise(function(_0x58a9b0,_0x174e6c){return client[_0x8c3a('0xb')](_0x170999,_0x37047e)[_0x8c3a('0xc')](function(_0x1593a7){logger[_0x8c3a('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x2fae6f,_0x8c3a('0xe'));logger[_0x8c3a('0xf')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x2fae6f,_0x8c3a('0xe'),JSON[_0x8c3a('0x10')](_0x1593a7));if(_0x1593a7[_0x8c3a('0x11')]){if(_0x1593a7[_0x8c3a('0x11')][_0x8c3a('0x12')]===0x1f4){logger[_0x8c3a('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x2fae6f,_0x1593a7[_0x8c3a('0x11')]['message']);return _0x174e6c(_0x1593a7['error'][_0x8c3a('0x13')]);}logger[_0x8c3a('0x11')](_0x8c3a('0x14'),_0x2fae6f,_0x1593a7[_0x8c3a('0x11')][_0x8c3a('0x13')]);return _0x58a9b0(_0x1593a7[_0x8c3a('0x11')][_0x8c3a('0x13')]);}else{logger[_0x8c3a('0xd')](_0x8c3a('0x14'),_0x2fae6f,'request\x20sent');_0x58a9b0(_0x1593a7[_0x8c3a('0x15')][_0x8c3a('0x13')]);}})[_0x8c3a('0x16')](function(_0x1ee355){logger[_0x8c3a('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x2fae6f,_0x1ee355);_0x174e6c(_0x1ee355);});});}