Built motion from commit 1fa89557.|2.6.10
[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 _0xae24=['request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','SmsTransferReport,\x20%s,\x20%s','message','catch','lodash','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','info'];(function(_0x59c695,_0x3a0566){var _0x22acba=function(_0x2c8337){while(--_0x2c8337){_0x59c695['push'](_0x59c695['shift']());}};_0x22acba(++_0x3a0566);}(_0xae24,0x182));var _0x4ae2=function(_0x283cf2,_0x5d685f){_0x283cf2=_0x283cf2-0x0;var _0x1bcbfe=_0xae24[_0x283cf2];return _0x1bcbfe;};'use strict';var _=require(_0x4ae2('0x0'));var util=require('util');var moment=require(_0x4ae2('0x1'));var BPromise=require('bluebird');var rs=require(_0x4ae2('0x2'));var fs=require('fs');var Redis=require(_0x4ae2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ae2('0x4'))('rpc');var config=require(_0x4ae2('0x5'));var jayson=require(_0x4ae2('0x6'));var client=jayson[_0x4ae2('0x7')][_0x4ae2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x428054,_0x307247,_0x4f2e84){return new BPromise(function(_0x5f589a,_0x41cdf1){return client['request'](_0x428054,_0x4f2e84)['then'](function(_0xb5587a){logger[_0x4ae2('0x9')]('SmsTransferReport,\x20%s,\x20%s',_0x307247,_0x4ae2('0xa'));logger[_0x4ae2('0xb')](_0x4ae2('0xc'),_0x307247,_0x4ae2('0xa'),JSON['stringify'](_0xb5587a));if(_0xb5587a[_0x4ae2('0xd')]){if(_0xb5587a[_0x4ae2('0xd')][_0x4ae2('0xe')]===0x1f4){logger['error'](_0x4ae2('0xf'),_0x307247,_0xb5587a[_0x4ae2('0xd')][_0x4ae2('0x10')]);return _0x41cdf1(_0xb5587a[_0x4ae2('0xd')][_0x4ae2('0x10')]);}logger[_0x4ae2('0xd')](_0x4ae2('0xf'),_0x307247,_0xb5587a[_0x4ae2('0xd')][_0x4ae2('0x10')]);return _0x5f589a(_0xb5587a['error']['message']);}else{logger['info'](_0x4ae2('0xf'),_0x307247,_0x4ae2('0xa'));_0x5f589a(_0xb5587a['result'][_0x4ae2('0x10')]);}})[_0x4ae2('0x11')](function(_0x1fde63){logger[_0x4ae2('0xd')](_0x4ae2('0xf'),_0x307247,_0x1fde63);_0x41cdf1(_0x1fde63);});});}