Built motion from commit (unavailable).|2.5.21
[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 _0x7899=['result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1d83a0,_0x123f18){var _0x2612e2=function(_0x430e2d){while(--_0x430e2d){_0x1d83a0['push'](_0x1d83a0['shift']());}};_0x2612e2(++_0x123f18);}(_0x7899,0x167));var _0x9789=function(_0x4e697a,_0x56a14b){_0x4e697a=_0x4e697a-0x0;var _0x88850c=_0x7899[_0x4e697a];return _0x88850c;};'use strict';var _=require('lodash');var util=require(_0x9789('0x0'));var moment=require('moment');var BPromise=require(_0x9789('0x1'));var rs=require(_0x9789('0x2'));var fs=require('fs');var Redis=require(_0x9789('0x3'));var db=require(_0x9789('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9789('0x5'))(_0x9789('0x6'));var config=require(_0x9789('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x427c33,_0xffd728,_0x3bfb00){return new BPromise(function(_0x44360e,_0xc79e51){return client[_0x9789('0x8')](_0x427c33,_0x3bfb00)[_0x9789('0x9')](function(_0x4a7a97){logger[_0x9789('0xa')](_0x9789('0xb'),_0xffd728,_0x9789('0xc'));logger[_0x9789('0xd')](_0x9789('0xe'),_0xffd728,_0x9789('0xc'),JSON[_0x9789('0xf')](_0x4a7a97));if(_0x4a7a97['error']){if(_0x4a7a97[_0x9789('0x10')][_0x9789('0x11')]===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0xffd728,_0x4a7a97[_0x9789('0x10')][_0x9789('0x12')]);return _0xc79e51(_0x4a7a97['error']['message']);}logger[_0x9789('0x10')](_0x9789('0xb'),_0xffd728,_0x4a7a97[_0x9789('0x10')][_0x9789('0x12')]);return _0x44360e(_0x4a7a97[_0x9789('0x10')][_0x9789('0x12')]);}else{logger[_0x9789('0xa')](_0x9789('0xb'),_0xffd728,_0x9789('0xc'));_0x44360e(_0x4a7a97[_0x9789('0x13')][_0x9789('0x12')]);}})[_0x9789('0x14')](function(_0x7ae10c){logger[_0x9789('0x10')](_0x9789('0xb'),_0xffd728,_0x7ae10c);_0xc79e51(_0x7ae10c);});});}