Built motion from commit (unavailable).|2.4.17
[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 _0xface=['http','request','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','lodash','util','moment','randomstring','ioredis','../../config/logger','jayson/promise','client'];(function(_0x211126,_0x346f42){var _0x28b957=function(_0x298726){while(--_0x298726){_0x211126['push'](_0x211126['shift']());}};_0x28b957(++_0x346f42);}(_0xface,0x12a));var _0xefac=function(_0x4099be,_0x2faca7){_0x4099be=_0x4099be-0x0;var _0x181d62=_0xface[_0x4099be];return _0x181d62;};'use strict';var _=require(_0xefac('0x0'));var util=require(_0xefac('0x1'));var moment=require(_0xefac('0x2'));var BPromise=require('bluebird');var rs=require(_0xefac('0x3'));var fs=require('fs');var Redis=require(_0xefac('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xefac('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xefac('0x6'));var client=jayson[_0xefac('0x7')][_0xefac('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ffffa,_0x468aaf,_0x395df1){return new BPromise(function(_0x7a6405,_0x18fcc6){return client[_0xefac('0x9')](_0x5ffffa,_0x395df1)['then'](function(_0x2a9e90){logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x468aaf,'request\x20sent');logger['debug'](_0xefac('0xa'),_0x468aaf,_0xefac('0xb'),JSON[_0xefac('0xc')](_0x2a9e90));if(_0x2a9e90['error']){if(_0x2a9e90[_0xefac('0xd')][_0xefac('0xe')]===0x1f4){logger[_0xefac('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x468aaf,_0x2a9e90[_0xefac('0xd')]['message']);return _0x18fcc6(_0x2a9e90[_0xefac('0xd')]['message']);}logger[_0xefac('0xd')](_0xefac('0xf'),_0x468aaf,_0x2a9e90[_0xefac('0xd')]['message']);return _0x7a6405(_0x2a9e90['error'][_0xefac('0x10')]);}else{logger['info'](_0xefac('0xf'),_0x468aaf,_0xefac('0xb'));_0x7a6405(_0x2a9e90['result'][_0xefac('0x10')]);}})['catch'](function(_0x5699c8){logger[_0xefac('0xd')](_0xefac('0xf'),_0x468aaf,_0x5699c8);_0x18fcc6(_0x5699c8);});});}