9140440dbf85e28fea4c46581aecc48ada0fffdb
[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 _0xd648=['SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0xd648,0x149));var _0x8d64=function(_0x535617,_0x4ab728){_0x535617=_0x535617-0x0;var _0x4bf3c5=_0xd648[_0x535617];return _0x4bf3c5;};'use strict';var _=require(_0x8d64('0x0'));var util=require(_0x8d64('0x1'));var moment=require('moment');var BPromise=require(_0x8d64('0x2'));var rs=require(_0x8d64('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d64('0x4'))['db'];var utils=require(_0x8d64('0x5'));var logger=require(_0x8d64('0x6'))(_0x8d64('0x7'));var config=require(_0x8d64('0x8'));var jayson=require(_0x8d64('0x9'));var client=jayson['client'][_0x8d64('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x178548,_0x1604a6,_0x242370){return new BPromise(function(_0x535c52,_0xe54dcd){return client[_0x8d64('0xb')](_0x178548,_0x242370)[_0x8d64('0xc')](function(_0x1ab523){logger[_0x8d64('0xd')](_0x8d64('0xe'),_0x1604a6,_0x8d64('0xf'));logger['debug'](_0x8d64('0x10'),_0x1604a6,'request\x20sent',JSON[_0x8d64('0x11')](_0x1ab523));if(_0x1ab523[_0x8d64('0x12')]){if(_0x1ab523[_0x8d64('0x12')][_0x8d64('0x13')]===0x1f4){logger[_0x8d64('0x12')](_0x8d64('0xe'),_0x1604a6,_0x1ab523[_0x8d64('0x12')]['message']);return _0xe54dcd(_0x1ab523['error'][_0x8d64('0x14')]);}logger[_0x8d64('0x12')](_0x8d64('0xe'),_0x1604a6,_0x1ab523[_0x8d64('0x12')]['message']);return _0x535c52(_0x1ab523[_0x8d64('0x12')][_0x8d64('0x14')]);}else{logger[_0x8d64('0xd')](_0x8d64('0xe'),_0x1604a6,_0x8d64('0xf'));_0x535c52(_0x1ab523[_0x8d64('0x15')]['message']);}})[_0x8d64('0x16')](function(_0x185cca){logger[_0x8d64('0x12')](_0x8d64('0xe'),_0x1604a6,_0x185cca);_0xe54dcd(_0x185cca);});});}