Built motion from commit (unavailable).|2.5.16
[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 _0x037a=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x561b3e,_0x263244){var _0x45bcfe=function(_0x2cd6d5){while(--_0x2cd6d5){_0x561b3e['push'](_0x561b3e['shift']());}};_0x45bcfe(++_0x263244);}(_0x037a,0xdc));var _0xa037=function(_0x5aa0e1,_0xb4aa57){_0x5aa0e1=_0x5aa0e1-0x0;var _0x4b3e04=_0x037a[_0x5aa0e1];return _0x4b3e04;};'use strict';var _=require('lodash');var util=require(_0xa037('0x0'));var moment=require(_0xa037('0x1'));var BPromise=require(_0xa037('0x2'));var rs=require(_0xa037('0x3'));var fs=require('fs');var Redis=require(_0xa037('0x4'));var db=require(_0xa037('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa037('0x6'))('rpc');var config=require(_0xa037('0x7'));var jayson=require(_0xa037('0x8'));var client=jayson[_0xa037('0x9')][_0xa037('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12a1dc,_0xd1fa5,_0x38476c){return new BPromise(function(_0x16ad46,_0x430fe4){return client['request'](_0x12a1dc,_0x38476c)[_0xa037('0xb')](function(_0x49e81c){logger[_0xa037('0xc')](_0xa037('0xd'),_0xd1fa5,_0xa037('0xe'));logger[_0xa037('0xf')](_0xa037('0x10'),_0xd1fa5,_0xa037('0xe'),JSON[_0xa037('0x11')](_0x49e81c));if(_0x49e81c[_0xa037('0x12')]){if(_0x49e81c[_0xa037('0x12')]['code']===0x1f4){logger[_0xa037('0x12')](_0xa037('0xd'),_0xd1fa5,_0x49e81c[_0xa037('0x12')][_0xa037('0x13')]);return _0x430fe4(_0x49e81c[_0xa037('0x12')][_0xa037('0x13')]);}logger[_0xa037('0x12')](_0xa037('0xd'),_0xd1fa5,_0x49e81c['error'][_0xa037('0x13')]);return _0x16ad46(_0x49e81c['error'][_0xa037('0x13')]);}else{logger[_0xa037('0xc')](_0xa037('0xd'),_0xd1fa5,'request\x20sent');_0x16ad46(_0x49e81c[_0xa037('0x14')]['message']);}})[_0xa037('0x15')](function(_0x5ef72b){logger[_0xa037('0x12')](_0xa037('0xd'),_0xd1fa5,_0x5ef72b);_0x430fe4(_0x5ef72b);});});}