Built motion from commit (unavailable).|2.5.28
[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 _0xff06=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util'];(function(_0x1889a6,_0x2f9ad2){var _0x15883d=function(_0x55ceea){while(--_0x55ceea){_0x1889a6['push'](_0x1889a6['shift']());}};_0x15883d(++_0x2f9ad2);}(_0xff06,0x1ae));var _0x6ff0=function(_0x4a1412,_0x2b6ee8){_0x4a1412=_0x4a1412-0x0;var _0x2cc456=_0xff06[_0x4a1412];return _0x2cc456;};'use strict';var _=require(_0x6ff0('0x0'));var util=require(_0x6ff0('0x1'));var moment=require(_0x6ff0('0x2'));var BPromise=require(_0x6ff0('0x3'));var rs=require(_0x6ff0('0x4'));var fs=require('fs');var Redis=require(_0x6ff0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ff0('0x6'));var logger=require(_0x6ff0('0x7'))(_0x6ff0('0x8'));var config=require(_0x6ff0('0x9'));var jayson=require(_0x6ff0('0xa'));var client=jayson[_0x6ff0('0xb')][_0x6ff0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xbc7cfd,_0x5334b4,_0x4933b0){return new BPromise(function(_0x3db9bc,_0x560398){return client[_0x6ff0('0xd')](_0xbc7cfd,_0x4933b0)['then'](function(_0x9290c2){logger[_0x6ff0('0xe')](_0x6ff0('0xf'),_0x5334b4,_0x6ff0('0x10'));logger[_0x6ff0('0x11')](_0x6ff0('0x12'),_0x5334b4,'request\x20sent',JSON[_0x6ff0('0x13')](_0x9290c2));if(_0x9290c2[_0x6ff0('0x14')]){if(_0x9290c2[_0x6ff0('0x14')][_0x6ff0('0x15')]===0x1f4){logger[_0x6ff0('0x14')](_0x6ff0('0xf'),_0x5334b4,_0x9290c2['error'][_0x6ff0('0x16')]);return _0x560398(_0x9290c2[_0x6ff0('0x14')][_0x6ff0('0x16')]);}logger[_0x6ff0('0x14')](_0x6ff0('0xf'),_0x5334b4,_0x9290c2[_0x6ff0('0x14')][_0x6ff0('0x16')]);return _0x3db9bc(_0x9290c2[_0x6ff0('0x14')][_0x6ff0('0x16')]);}else{logger[_0x6ff0('0xe')](_0x6ff0('0xf'),_0x5334b4,'request\x20sent');_0x3db9bc(_0x9290c2['result']['message']);}})[_0x6ff0('0x17')](function(_0x5bf192){logger['error'](_0x6ff0('0xf'),_0x5334b4,_0x5bf192);_0x560398(_0x5bf192);});});}