Built motion from commit (unavailable).|2.4.18
[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 _0xaf30=['catch','util','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','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xaf30,0xd0));var _0x0af3=function(_0x5ad0d7,_0x2645f8){_0x5ad0d7=_0x5ad0d7-0x0;var _0xd83bd=_0xaf30[_0x5ad0d7];return _0xd83bd;};'use strict';var _=require('lodash');var util=require(_0x0af3('0x0'));var moment=require('moment');var BPromise=require(_0x0af3('0x1'));var rs=require(_0x0af3('0x2'));var fs=require('fs');var Redis=require(_0x0af3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0af3('0x4'));var logger=require(_0x0af3('0x5'))(_0x0af3('0x6'));var config=require(_0x0af3('0x7'));var jayson=require(_0x0af3('0x8'));var client=jayson[_0x0af3('0x9')][_0x0af3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x191b25,_0x76a8fe,_0x17e062){return new BPromise(function(_0x3cb01a,_0x2c6e50){return client[_0x0af3('0xb')](_0x191b25,_0x17e062)[_0x0af3('0xc')](function(_0x1fcd0f){logger[_0x0af3('0xd')](_0x0af3('0xe'),_0x76a8fe,_0x0af3('0xf'));logger[_0x0af3('0x10')](_0x0af3('0x11'),_0x76a8fe,'request\x20sent',JSON['stringify'](_0x1fcd0f));if(_0x1fcd0f['error']){if(_0x1fcd0f[_0x0af3('0x12')][_0x0af3('0x13')]===0x1f4){logger[_0x0af3('0x12')](_0x0af3('0xe'),_0x76a8fe,_0x1fcd0f[_0x0af3('0x12')]['message']);return _0x2c6e50(_0x1fcd0f[_0x0af3('0x12')][_0x0af3('0x14')]);}logger[_0x0af3('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x76a8fe,_0x1fcd0f['error'][_0x0af3('0x14')]);return _0x3cb01a(_0x1fcd0f[_0x0af3('0x12')][_0x0af3('0x14')]);}else{logger['info'](_0x0af3('0xe'),_0x76a8fe,_0x0af3('0xf'));_0x3cb01a(_0x1fcd0f[_0x0af3('0x15')][_0x0af3('0x14')]);}})[_0x0af3('0x16')](function(_0x2043c3){logger[_0x0af3('0x12')](_0x0af3('0xe'),_0x76a8fe,_0x2043c3);_0x2c6e50(_0x2043c3);});});}