3e007e6e57bdb1490f0d4e70ef829fc955ffae53
[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 _0x884b=['info','SmsTransferReport,\x20%s,\x20%s','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x884b,0x195));var _0xb884=function(_0x128450,_0x5869ba){_0x128450=_0x128450-0x0;var _0x4d80ed=_0x884b[_0x128450];return _0x4d80ed;};'use strict';var _=require(_0xb884('0x0'));var util=require(_0xb884('0x1'));var moment=require('moment');var BPromise=require(_0xb884('0x2'));var rs=require(_0xb884('0x3'));var fs=require('fs');var Redis=require(_0xb884('0x4'));var db=require(_0xb884('0x5'))['db'];var utils=require(_0xb884('0x6'));var logger=require('../../config/logger')(_0xb884('0x7'));var config=require(_0xb884('0x8'));var jayson=require(_0xb884('0x9'));var client=jayson['client'][_0xb884('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30e058,_0x1692ed,_0x38351c){return new BPromise(function(_0x486a3a,_0x44fd39){return client[_0xb884('0xb')](_0x30e058,_0x38351c)[_0xb884('0xc')](function(_0x211b49){logger[_0xb884('0xd')](_0xb884('0xe'),_0x1692ed,'request\x20sent');logger['debug'](_0xb884('0xf'),_0x1692ed,_0xb884('0x10'),JSON[_0xb884('0x11')](_0x211b49));if(_0x211b49[_0xb884('0x12')]){if(_0x211b49['error']['code']===0x1f4){logger[_0xb884('0x12')](_0xb884('0xe'),_0x1692ed,_0x211b49[_0xb884('0x12')][_0xb884('0x13')]);return _0x44fd39(_0x211b49[_0xb884('0x12')][_0xb884('0x13')]);}logger[_0xb884('0x12')](_0xb884('0xe'),_0x1692ed,_0x211b49[_0xb884('0x12')][_0xb884('0x13')]);return _0x486a3a(_0x211b49[_0xb884('0x12')]['message']);}else{logger['info'](_0xb884('0xe'),_0x1692ed,_0xb884('0x10'));_0x486a3a(_0x211b49[_0xb884('0x14')][_0xb884('0x13')]);}})[_0xb884('0x15')](function(_0x473aea){logger[_0xb884('0x12')](_0xb884('0xe'),_0x1692ed,_0x473aea);_0x44fd39(_0x473aea);});});}