Built motion from commit eddce310.|2.6.12
[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 _0x1b69=['message','info','result','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2804d7,_0x2d8d6c){var _0x4a84e7=function(_0x3a03e9){while(--_0x3a03e9){_0x2804d7['push'](_0x2804d7['shift']());}};_0x4a84e7(++_0x2d8d6c);}(_0x1b69,0x190));var _0x91b6=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x1b69[_0x1694f5];return _0x5b4321;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x91b6('0x0'));var rs=require(_0x91b6('0x1'));var fs=require('fs');var Redis=require(_0x91b6('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x91b6('0x3'));var logger=require(_0x91b6('0x4'))(_0x91b6('0x5'));var config=require(_0x91b6('0x6'));var jayson=require(_0x91b6('0x7'));var client=jayson[_0x91b6('0x8')][_0x91b6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x407d3e,_0x169a4a,_0x455203){return new BPromise(function(_0xabc083,_0x1ef7ff){return client[_0x91b6('0xa')](_0x407d3e,_0x455203)[_0x91b6('0xb')](function(_0x564e34){logger['info'](_0x91b6('0xc'),_0x169a4a,_0x91b6('0xd'));logger[_0x91b6('0xe')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x169a4a,_0x91b6('0xd'),JSON[_0x91b6('0xf')](_0x564e34));if(_0x564e34[_0x91b6('0x10')]){if(_0x564e34[_0x91b6('0x10')][_0x91b6('0x11')]===0x1f4){logger[_0x91b6('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x169a4a,_0x564e34[_0x91b6('0x10')]['message']);return _0x1ef7ff(_0x564e34[_0x91b6('0x10')][_0x91b6('0x12')]);}logger[_0x91b6('0x10')](_0x91b6('0xc'),_0x169a4a,_0x564e34['error'][_0x91b6('0x12')]);return _0xabc083(_0x564e34[_0x91b6('0x10')][_0x91b6('0x12')]);}else{logger[_0x91b6('0x13')](_0x91b6('0xc'),_0x169a4a,'request\x20sent');_0xabc083(_0x564e34[_0x91b6('0x14')][_0x91b6('0x12')]);}})[_0x91b6('0x15')](function(_0x15791c){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x169a4a,_0x15791c);_0x1ef7ff(_0x15791c);});});}