Built motion from commit 3e059bc2.|2.5.32
[motion2.git] / server / api / userFaxQueue / userFaxQueue.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 _0x2a82=['UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x19fd8f,_0x4bcccb){var _0x1bf8ad=function(_0x6ed706){while(--_0x6ed706){_0x19fd8f['push'](_0x19fd8f['shift']());}};_0x1bf8ad(++_0x4bcccb);}(_0x2a82,0xd5));var _0x22a8=function(_0x34cef7,_0x52293f){_0x34cef7=_0x34cef7-0x0;var _0x8f7873=_0x2a82[_0x34cef7];return _0x8f7873;};'use strict';var _=require(_0x22a8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x22a8('0x1'));var rs=require(_0x22a8('0x2'));var fs=require('fs');var Redis=require(_0x22a8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x22a8('0x4'));var logger=require(_0x22a8('0x5'))(_0x22a8('0x6'));var config=require(_0x22a8('0x7'));var jayson=require(_0x22a8('0x8'));var client=jayson[_0x22a8('0x9')][_0x22a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x188840,_0x9bd44e,_0x4706b1){return new BPromise(function(_0x3147c9,_0xdcbec3){return client[_0x22a8('0xb')](_0x188840,_0x4706b1)[_0x22a8('0xc')](function(_0x33dd33){logger[_0x22a8('0xd')](_0x22a8('0xe'),_0x9bd44e,_0x22a8('0xf'));logger[_0x22a8('0x10')](_0x22a8('0x11'),_0x9bd44e,_0x22a8('0xf'),JSON[_0x22a8('0x12')](_0x33dd33));if(_0x33dd33[_0x22a8('0x13')]){if(_0x33dd33[_0x22a8('0x13')]['code']===0x1f4){logger[_0x22a8('0x13')](_0x22a8('0xe'),_0x9bd44e,_0x33dd33['error'][_0x22a8('0x14')]);return _0xdcbec3(_0x33dd33[_0x22a8('0x13')][_0x22a8('0x14')]);}logger[_0x22a8('0x13')](_0x22a8('0xe'),_0x9bd44e,_0x33dd33[_0x22a8('0x13')][_0x22a8('0x14')]);return _0x3147c9(_0x33dd33[_0x22a8('0x13')]['message']);}else{logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x9bd44e,_0x22a8('0xf'));_0x3147c9(_0x33dd33[_0x22a8('0x15')][_0x22a8('0x14')]);}})[_0x22a8('0x16')](function(_0x2c51ce){logger[_0x22a8('0x13')](_0x22a8('0xe'),_0x9bd44e,_0x2c51ce);_0xdcbec3(_0x2c51ce);});});}