Built motion from commit (unavailable).|2.5.22
[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 _0xe671=['request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','SmsTransferReport,\x20%s,\x20%s'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe671,0x1eb));var _0x1e67=function(_0x301905,_0x4d5d93){_0x301905=_0x301905-0x0;var _0x4aefdc=_0xe671[_0x301905];return _0x4aefdc;};'use strict';var _=require(_0x1e67('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1e67('0x1'));var rs=require(_0x1e67('0x2'));var fs=require('fs');var Redis=require(_0x1e67('0x3'));var db=require(_0x1e67('0x4'))['db'];var utils=require(_0x1e67('0x5'));var logger=require('../../config/logger')(_0x1e67('0x6'));var config=require('../../config/environment');var jayson=require(_0x1e67('0x7'));var client=jayson[_0x1e67('0x8')][_0x1e67('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17c0be,_0x30b3c8,_0x437bca){return new BPromise(function(_0x390422,_0x16fc28){return client['request'](_0x17c0be,_0x437bca)[_0x1e67('0xa')](function(_0x32c4f9){logger[_0x1e67('0xb')](_0x1e67('0xc'),_0x30b3c8,_0x1e67('0xd'));logger[_0x1e67('0xe')](_0x1e67('0xf'),_0x30b3c8,_0x1e67('0xd'),JSON[_0x1e67('0x10')](_0x32c4f9));if(_0x32c4f9['error']){if(_0x32c4f9[_0x1e67('0x11')]['code']===0x1f4){logger[_0x1e67('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x30b3c8,_0x32c4f9[_0x1e67('0x11')][_0x1e67('0x12')]);return _0x16fc28(_0x32c4f9['error'][_0x1e67('0x12')]);}logger[_0x1e67('0x11')](_0x1e67('0xc'),_0x30b3c8,_0x32c4f9['error'][_0x1e67('0x12')]);return _0x390422(_0x32c4f9[_0x1e67('0x11')]['message']);}else{logger['info'](_0x1e67('0xc'),_0x30b3c8,'request\x20sent');_0x390422(_0x32c4f9[_0x1e67('0x13')][_0x1e67('0x12')]);}})[_0x1e67('0x14')](function(_0xa30267){logger['error'](_0x1e67('0xc'),_0x30b3c8,_0xa30267);_0x16fc28(_0xa30267);});});}