Built motion from commit (unavailable).|2.5.4
[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 _0xfcae=['UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x5c9b89,_0x3d7af1){var _0x51790a=function(_0x5900e2){while(--_0x5900e2){_0x5c9b89['push'](_0x5c9b89['shift']());}};_0x51790a(++_0x3d7af1);}(_0xfcae,0x141));var _0xefca=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xfcae[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0xefca('0x0'));var util=require(_0xefca('0x1'));var moment=require(_0xefca('0x2'));var BPromise=require(_0xefca('0x3'));var rs=require(_0xefca('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xefca('0x5'))['db'];var utils=require(_0xefca('0x6'));var logger=require(_0xefca('0x7'))(_0xefca('0x8'));var config=require('../../config/environment');var jayson=require(_0xefca('0x9'));var client=jayson[_0xefca('0xa')][_0xefca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e868d,_0x410f06,_0x1f6034){return new BPromise(function(_0x2ce88e,_0x5542fd){return client[_0xefca('0xc')](_0x4e868d,_0x1f6034)[_0xefca('0xd')](function(_0x1fcf8f){logger[_0xefca('0xe')](_0xefca('0xf'),_0x410f06,_0xefca('0x10'));logger['debug'](_0xefca('0x11'),_0x410f06,_0xefca('0x10'),JSON[_0xefca('0x12')](_0x1fcf8f));if(_0x1fcf8f[_0xefca('0x13')]){if(_0x1fcf8f['error'][_0xefca('0x14')]===0x1f4){logger[_0xefca('0x13')]('UserFaxQueue,\x20%s,\x20%s',_0x410f06,_0x1fcf8f[_0xefca('0x13')][_0xefca('0x15')]);return _0x5542fd(_0x1fcf8f['error']['message']);}logger[_0xefca('0x13')](_0xefca('0xf'),_0x410f06,_0x1fcf8f['error'][_0xefca('0x15')]);return _0x2ce88e(_0x1fcf8f[_0xefca('0x13')][_0xefca('0x15')]);}else{logger[_0xefca('0xe')](_0xefca('0xf'),_0x410f06,'request\x20sent');_0x2ce88e(_0x1fcf8f[_0xefca('0x16')][_0xefca('0x15')]);}})[_0xefca('0x17')](function(_0x15abaa){logger[_0xefca('0x13')](_0xefca('0xf'),_0x410f06,_0x15abaa);_0x5542fd(_0x15abaa);});});}