e2fbfbda6884f15549eda536eac05bceca6665ae
[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 _0xf50b=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x1a1388,_0x39b561){var _0x54d57b=function(_0x562ac2){while(--_0x562ac2){_0x1a1388['push'](_0x1a1388['shift']());}};_0x54d57b(++_0x39b561);}(_0xf50b,0xc8));var _0xbf50=function(_0x28f94d,_0x42eb7d){_0x28f94d=_0x28f94d-0x0;var _0x42faa8=_0xf50b[_0x28f94d];return _0x42faa8;};'use strict';var _=require(_0xbf50('0x0'));var util=require(_0xbf50('0x1'));var moment=require('moment');var BPromise=require(_0xbf50('0x2'));var rs=require(_0xbf50('0x3'));var fs=require('fs');var Redis=require(_0xbf50('0x4'));var db=require(_0xbf50('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf50('0x6'))('rpc');var config=require(_0xbf50('0x7'));var jayson=require(_0xbf50('0x8'));var client=jayson[_0xbf50('0x9')][_0xbf50('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3dd305,_0x3378ff,_0xce290){return new BPromise(function(_0x497c4c,_0x160dc7){return client[_0xbf50('0xb')](_0x3dd305,_0xce290)[_0xbf50('0xc')](function(_0x4eb908){logger['info'](_0xbf50('0xd'),_0x3378ff,_0xbf50('0xe'));logger[_0xbf50('0xf')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x3378ff,_0xbf50('0xe'),JSON[_0xbf50('0x10')](_0x4eb908));if(_0x4eb908[_0xbf50('0x11')]){if(_0x4eb908[_0xbf50('0x11')][_0xbf50('0x12')]===0x1f4){logger[_0xbf50('0x11')](_0xbf50('0xd'),_0x3378ff,_0x4eb908['error'][_0xbf50('0x13')]);return _0x160dc7(_0x4eb908[_0xbf50('0x11')][_0xbf50('0x13')]);}logger[_0xbf50('0x11')](_0xbf50('0xd'),_0x3378ff,_0x4eb908['error']['message']);return _0x497c4c(_0x4eb908['error'][_0xbf50('0x13')]);}else{logger['info'](_0xbf50('0xd'),_0x3378ff,_0xbf50('0xe'));_0x497c4c(_0x4eb908[_0xbf50('0x14')]['message']);}})[_0xbf50('0x15')](function(_0x5be8ae){logger[_0xbf50('0x11')](_0xbf50('0xd'),_0x3378ff,_0x5be8ae);_0x160dc7(_0x5be8ae);});});}