Built motion from commit (unavailable).|2.5.16
[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 _0x68a1=['UserFaxQueue,\x20%s,\x20%s,\x20%s','error','UserFaxQueue,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x68a1,0x17f));var _0x168a=function(_0x54dcae,_0x26f19f){_0x54dcae=_0x54dcae-0x0;var _0x4168f3=_0x68a1[_0x54dcae];return _0x4168f3;};'use strict';var _=require(_0x168a('0x0'));var util=require('util');var moment=require(_0x168a('0x1'));var BPromise=require(_0x168a('0x2'));var rs=require(_0x168a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x168a('0x4'));var logger=require(_0x168a('0x5'))(_0x168a('0x6'));var config=require(_0x168a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x168a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d59cb,_0x8d004e,_0x4b3f4b){return new BPromise(function(_0x33c041,_0x4a031f){return client[_0x168a('0x9')](_0x4d59cb,_0x4b3f4b)['then'](function(_0x24929e){logger[_0x168a('0xa')]('UserFaxQueue,\x20%s,\x20%s',_0x8d004e,_0x168a('0xb'));logger[_0x168a('0xc')](_0x168a('0xd'),_0x8d004e,'request\x20sent',JSON['stringify'](_0x24929e));if(_0x24929e['error']){if(_0x24929e['error']['code']===0x1f4){logger[_0x168a('0xe')](_0x168a('0xf'),_0x8d004e,_0x24929e[_0x168a('0xe')]['message']);return _0x4a031f(_0x24929e[_0x168a('0xe')]['message']);}logger[_0x168a('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x8d004e,_0x24929e[_0x168a('0xe')][_0x168a('0x10')]);return _0x33c041(_0x24929e[_0x168a('0xe')][_0x168a('0x10')]);}else{logger[_0x168a('0xa')](_0x168a('0xf'),_0x8d004e,'request\x20sent');_0x33c041(_0x24929e[_0x168a('0x11')]['message']);}})['catch'](function(_0xc929a1){logger['error'](_0x168a('0xf'),_0x8d004e,_0xc929a1);_0x4a031f(_0xc929a1);});});}