Built motion from commit bab6f49e.|2.6.17
[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 _0x975f=['client','http','request','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x41edc3,_0x3f0162){var _0x59c75e=function(_0x3007a3){while(--_0x3007a3){_0x41edc3['push'](_0x41edc3['shift']());}};_0x59c75e(++_0x3f0162);}(_0x975f,0x109));var _0xf975=function(_0x51beba,_0x202d19){_0x51beba=_0x51beba-0x0;var _0x167ee0=_0x975f[_0x51beba];return _0x167ee0;};'use strict';var _=require(_0xf975('0x0'));var util=require(_0xf975('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf975('0x2'));var fs=require('fs');var Redis=require(_0xf975('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf975('0x4'));var logger=require(_0xf975('0x5'))(_0xf975('0x6'));var config=require(_0xf975('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf975('0x8')][_0xf975('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36f6cf,_0x2018ea,_0x51a37c){return new BPromise(function(_0x194d30,_0x43cf7a){return client[_0xf975('0xa')](_0x36f6cf,_0x51a37c)['then'](function(_0x2e2ab1){logger[_0xf975('0xb')]('SmsTransferReport,\x20%s,\x20%s',_0x2018ea,_0xf975('0xc'));logger[_0xf975('0xd')](_0xf975('0xe'),_0x2018ea,_0xf975('0xc'),JSON[_0xf975('0xf')](_0x2e2ab1));if(_0x2e2ab1[_0xf975('0x10')]){if(_0x2e2ab1[_0xf975('0x10')]['code']===0x1f4){logger[_0xf975('0x10')](_0xf975('0x11'),_0x2018ea,_0x2e2ab1['error'][_0xf975('0x12')]);return _0x43cf7a(_0x2e2ab1[_0xf975('0x10')][_0xf975('0x12')]);}logger[_0xf975('0x10')](_0xf975('0x11'),_0x2018ea,_0x2e2ab1[_0xf975('0x10')][_0xf975('0x12')]);return _0x194d30(_0x2e2ab1['error'][_0xf975('0x12')]);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x2018ea,_0xf975('0xc'));_0x194d30(_0x2e2ab1[_0xf975('0x13')][_0xf975('0x12')]);}})[_0xf975('0x14')](function(_0x300312){logger[_0xf975('0x10')](_0xf975('0x11'),_0x2018ea,_0x300312);_0x43cf7a(_0x300312);});});}