e01b15666a7c52f8edbc4595042d75be05c73619
[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 _0xac4f=['SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info'];(function(_0x1473e1,_0x50942d){var _0x3a6fcb=function(_0x33fa5f){while(--_0x33fa5f){_0x1473e1['push'](_0x1473e1['shift']());}};_0x3a6fcb(++_0x50942d);}(_0xac4f,0x122));var _0xfac4=function(_0x34d993,_0x3c7017){_0x34d993=_0x34d993-0x0;var _0x4728c7=_0xac4f[_0x34d993];return _0x4728c7;};'use strict';var _=require(_0xfac4('0x0'));var util=require('util');var moment=require(_0xfac4('0x1'));var BPromise=require('bluebird');var rs=require(_0xfac4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfac4('0x3'));var logger=require(_0xfac4('0x4'))('rpc');var config=require(_0xfac4('0x5'));var jayson=require(_0xfac4('0x6'));var client=jayson[_0xfac4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x342b8c,_0x8599e2,_0xdd64ea){return new BPromise(function(_0x2ad59f,_0x2e7774){return client[_0xfac4('0x8')](_0x342b8c,_0xdd64ea)['then'](function(_0x6c46e8){logger[_0xfac4('0x9')](_0xfac4('0xa'),_0x8599e2,_0xfac4('0xb'));logger[_0xfac4('0xc')](_0xfac4('0xd'),_0x8599e2,_0xfac4('0xb'),JSON[_0xfac4('0xe')](_0x6c46e8));if(_0x6c46e8[_0xfac4('0xf')]){if(_0x6c46e8[_0xfac4('0xf')][_0xfac4('0x10')]===0x1f4){logger[_0xfac4('0xf')]('SmsTransferReport,\x20%s,\x20%s',_0x8599e2,_0x6c46e8[_0xfac4('0xf')]['message']);return _0x2e7774(_0x6c46e8[_0xfac4('0xf')][_0xfac4('0x11')]);}logger[_0xfac4('0xf')](_0xfac4('0xa'),_0x8599e2,_0x6c46e8[_0xfac4('0xf')][_0xfac4('0x11')]);return _0x2ad59f(_0x6c46e8[_0xfac4('0xf')][_0xfac4('0x11')]);}else{logger['info'](_0xfac4('0xa'),_0x8599e2,_0xfac4('0xb'));_0x2ad59f(_0x6c46e8[_0xfac4('0x12')][_0xfac4('0x11')]);}})[_0xfac4('0x13')](function(_0x3ce345){logger[_0xfac4('0xf')](_0xfac4('0xa'),_0x8599e2,_0x3ce345);_0x2e7774(_0x3ce345);});});}