f00f588f54b77873c6def50c4652b738c8d9eb7c
[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 _0x53ae=['debug','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x503a0c,_0xbc78c5){var _0x3b2e83=function(_0x159994){while(--_0x159994){_0x503a0c['push'](_0x503a0c['shift']());}};_0x3b2e83(++_0xbc78c5);}(_0x53ae,0xd5));var _0xe53a=function(_0x123d89,_0x26ff12){_0x123d89=_0x123d89-0x0;var _0x5bb015=_0x53ae[_0x123d89];return _0x5bb015;};'use strict';var _=require(_0xe53a('0x0'));var util=require('util');var moment=require(_0xe53a('0x1'));var BPromise=require(_0xe53a('0x2'));var rs=require(_0xe53a('0x3'));var fs=require('fs');var Redis=require(_0xe53a('0x4'));var db=require(_0xe53a('0x5'))['db'];var utils=require(_0xe53a('0x6'));var logger=require(_0xe53a('0x7'))(_0xe53a('0x8'));var config=require(_0xe53a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe53a('0xa')][_0xe53a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8fc8f8,_0x2e03bd,_0x84fa60){return new BPromise(function(_0x2c985e,_0x1c934b){return client[_0xe53a('0xc')](_0x8fc8f8,_0x84fa60)[_0xe53a('0xd')](function(_0x1e9a29){logger[_0xe53a('0xe')](_0xe53a('0xf'),_0x2e03bd,_0xe53a('0x10'));logger[_0xe53a('0x11')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x2e03bd,_0xe53a('0x10'),JSON[_0xe53a('0x12')](_0x1e9a29));if(_0x1e9a29[_0xe53a('0x13')]){if(_0x1e9a29['error'][_0xe53a('0x14')]===0x1f4){logger[_0xe53a('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0x2e03bd,_0x1e9a29[_0xe53a('0x13')][_0xe53a('0x15')]);return _0x1c934b(_0x1e9a29[_0xe53a('0x13')][_0xe53a('0x15')]);}logger[_0xe53a('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0x2e03bd,_0x1e9a29[_0xe53a('0x13')]['message']);return _0x2c985e(_0x1e9a29[_0xe53a('0x13')][_0xe53a('0x15')]);}else{logger[_0xe53a('0xe')]('SmsTransferReport,\x20%s,\x20%s',_0x2e03bd,'request\x20sent');_0x2c985e(_0x1e9a29['result'][_0xe53a('0x15')]);}})[_0xe53a('0x16')](function(_0x4f8248){logger[_0xe53a('0x13')](_0xe53a('0xf'),_0x2e03bd,_0x4f8248);_0x1c934b(_0x4f8248);});});}