65005838e7e6ecca69fc5699c30197c3a1c2d7f4
[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 _0x19da=['error','message','info','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0x19da,0x9f));var _0xa19d=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x19da[_0x255d5b];return _0x3e141a;};'use strict';var _=require('lodash');var util=require(_0xa19d('0x0'));var moment=require('moment');var BPromise=require(_0xa19d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa19d('0x2'));var db=require(_0xa19d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa19d('0x4'))(_0xa19d('0x5'));var config=require('../../config/environment');var jayson=require(_0xa19d('0x6'));var client=jayson[_0xa19d('0x7')][_0xa19d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x14dc68,_0x32da37,_0x4b4627){return new BPromise(function(_0x197c4e,_0x4e6638){return client[_0xa19d('0x9')](_0x14dc68,_0x4b4627)[_0xa19d('0xa')](function(_0x538dea){logger['info'](_0xa19d('0xb'),_0x32da37,_0xa19d('0xc'));logger[_0xa19d('0xd')](_0xa19d('0xe'),_0x32da37,_0xa19d('0xc'),JSON[_0xa19d('0xf')](_0x538dea));if(_0x538dea['error']){if(_0x538dea['error'][_0xa19d('0x10')]===0x1f4){logger[_0xa19d('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x32da37,_0x538dea['error'][_0xa19d('0x12')]);return _0x4e6638(_0x538dea[_0xa19d('0x11')]['message']);}logger[_0xa19d('0x11')](_0xa19d('0xb'),_0x32da37,_0x538dea[_0xa19d('0x11')]['message']);return _0x197c4e(_0x538dea[_0xa19d('0x11')]['message']);}else{logger[_0xa19d('0x13')](_0xa19d('0xb'),_0x32da37,_0xa19d('0xc'));_0x197c4e(_0x538dea[_0xa19d('0x14')][_0xa19d('0x12')]);}})[_0xa19d('0x15')](function(_0x2f2774){logger[_0xa19d('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x32da37,_0x2f2774);_0x4e6638(_0x2f2774);});});}