Built motion from commit (unavailable).|2.3.95
[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 _0xa447=['../../mysqldb','rpc','../../config/environment','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x5b79ca,_0x50d700){var _0x5c4f90=function(_0x44b3cc){while(--_0x44b3cc){_0x5b79ca['push'](_0x5b79ca['shift']());}};_0x5c4f90(++_0x50d700);}(_0xa447,0x164));var _0x7a44=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0xa447[_0x220f3f];return _0x1f170e;};'use strict';var _=require(_0x7a44('0x0'));var util=require(_0x7a44('0x1'));var moment=require(_0x7a44('0x2'));var BPromise=require(_0x7a44('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a44('0x4'));var db=require(_0x7a44('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7a44('0x6'));var config=require(_0x7a44('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x380213,_0x4dd18f,_0x509b1b){return new BPromise(function(_0x249bf0,_0x5dcc04){return client['request'](_0x380213,_0x509b1b)[_0x7a44('0x8')](function(_0x271801){logger[_0x7a44('0x9')](_0x7a44('0xa'),_0x4dd18f,_0x7a44('0xb'));logger[_0x7a44('0xc')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x4dd18f,_0x7a44('0xb'),JSON[_0x7a44('0xd')](_0x271801));if(_0x271801['error']){if(_0x271801[_0x7a44('0xe')][_0x7a44('0xf')]===0x1f4){logger['error'](_0x7a44('0xa'),_0x4dd18f,_0x271801['error']['message']);return _0x5dcc04(_0x271801[_0x7a44('0xe')]['message']);}logger[_0x7a44('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x4dd18f,_0x271801[_0x7a44('0xe')][_0x7a44('0x10')]);return _0x249bf0(_0x271801['error'][_0x7a44('0x10')]);}else{logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x4dd18f,'request\x20sent');_0x249bf0(_0x271801[_0x7a44('0x11')]['message']);}})[_0x7a44('0x12')](function(_0x1f0ed0){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x4dd18f,_0x1f0ed0);_0x5dcc04(_0x1f0ed0);});});}