Built motion from commit b5413ace.|2.6.9
[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 _0xb079=['stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x802997,_0x5534a2){var _0x35c641=function(_0x22c4f2){while(--_0x22c4f2){_0x802997['push'](_0x802997['shift']());}};_0x35c641(++_0x5534a2);}(_0xb079,0x1c9));var _0x9b07=function(_0x7820c1,_0x2454bb){_0x7820c1=_0x7820c1-0x0;var _0x4e3d09=_0xb079[_0x7820c1];return _0x4e3d09;};'use strict';var _=require('lodash');var util=require(_0x9b07('0x0'));var moment=require(_0x9b07('0x1'));var BPromise=require(_0x9b07('0x2'));var rs=require(_0x9b07('0x3'));var fs=require('fs');var Redis=require(_0x9b07('0x4'));var db=require(_0x9b07('0x5'))['db'];var utils=require(_0x9b07('0x6'));var logger=require(_0x9b07('0x7'))(_0x9b07('0x8'));var config=require(_0x9b07('0x9'));var jayson=require(_0x9b07('0xa'));var client=jayson['client'][_0x9b07('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2be1ef,_0x54d030,_0x17a4bc){return new BPromise(function(_0x5a0395,_0x525492){return client[_0x9b07('0xc')](_0x2be1ef,_0x17a4bc)[_0x9b07('0xd')](function(_0x26ef60){logger[_0x9b07('0xe')]('SmsTransferReport,\x20%s,\x20%s',_0x54d030,_0x9b07('0xf'));logger[_0x9b07('0x10')](_0x9b07('0x11'),_0x54d030,_0x9b07('0xf'),JSON[_0x9b07('0x12')](_0x26ef60));if(_0x26ef60[_0x9b07('0x13')]){if(_0x26ef60[_0x9b07('0x13')][_0x9b07('0x14')]===0x1f4){logger[_0x9b07('0x13')](_0x9b07('0x15'),_0x54d030,_0x26ef60[_0x9b07('0x13')][_0x9b07('0x16')]);return _0x525492(_0x26ef60[_0x9b07('0x13')]['message']);}logger['error'](_0x9b07('0x15'),_0x54d030,_0x26ef60[_0x9b07('0x13')][_0x9b07('0x16')]);return _0x5a0395(_0x26ef60[_0x9b07('0x13')][_0x9b07('0x16')]);}else{logger['info'](_0x9b07('0x15'),_0x54d030,_0x9b07('0xf'));_0x5a0395(_0x26ef60[_0x9b07('0x17')]['message']);}})[_0x9b07('0x18')](function(_0x1cddd5){logger[_0x9b07('0x13')](_0x9b07('0x15'),_0x54d030,_0x1cddd5);_0x525492(_0x1cddd5);});});}