Built motion from commit 2b9af5da.|2.6.26
[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 _0xc03e=['catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0xc03e,0x15a));var _0xec03=function(_0x2cb58b,_0x5a879d){_0x2cb58b=_0x2cb58b-0x0;var _0xe9dd9c=_0xc03e[_0x2cb58b];return _0xe9dd9c;};'use strict';var _=require(_0xec03('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xec03('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec03('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xec03('0x3'));var logger=require(_0xec03('0x4'))(_0xec03('0x5'));var config=require(_0xec03('0x6'));var jayson=require(_0xec03('0x7'));var client=jayson[_0xec03('0x8')][_0xec03('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcaaf03,_0x278f90,_0x529ebd){return new BPromise(function(_0x4205e9,_0xb0638e){return client[_0xec03('0xa')](_0xcaaf03,_0x529ebd)[_0xec03('0xb')](function(_0x4d7e09){logger[_0xec03('0xc')](_0xec03('0xd'),_0x278f90,_0xec03('0xe'));logger[_0xec03('0xf')](_0xec03('0x10'),_0x278f90,_0xec03('0xe'),JSON[_0xec03('0x11')](_0x4d7e09));if(_0x4d7e09[_0xec03('0x12')]){if(_0x4d7e09['error'][_0xec03('0x13')]===0x1f4){logger[_0xec03('0x12')](_0xec03('0xd'),_0x278f90,_0x4d7e09[_0xec03('0x12')][_0xec03('0x14')]);return _0xb0638e(_0x4d7e09[_0xec03('0x12')][_0xec03('0x14')]);}logger[_0xec03('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x278f90,_0x4d7e09['error']['message']);return _0x4205e9(_0x4d7e09[_0xec03('0x12')][_0xec03('0x14')]);}else{logger[_0xec03('0xc')](_0xec03('0xd'),_0x278f90,_0xec03('0xe'));_0x4205e9(_0x4d7e09[_0xec03('0x15')][_0xec03('0x14')]);}})[_0xec03('0x16')](function(_0x5c2f1a){logger[_0xec03('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x278f90,_0x5c2f1a);_0xb0638e(_0x5c2f1a);});});}