Built motion from commit 5293bb2a.|2.6.30
[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 _0xfc6e=['jayson/promise','client','http','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment'];(function(_0x4fb0af,_0xe61f22){var _0x20b697=function(_0x21564a){while(--_0x21564a){_0x4fb0af['push'](_0x4fb0af['shift']());}};_0x20b697(++_0xe61f22);}(_0xfc6e,0x133));var _0xefc6=function(_0x56739b,_0x2d2cc9){_0x56739b=_0x56739b-0x0;var _0x1c752f=_0xfc6e[_0x56739b];return _0x1c752f;};'use strict';var _=require(_0xefc6('0x0'));var util=require(_0xefc6('0x1'));var moment=require(_0xefc6('0x2'));var BPromise=require(_0xefc6('0x3'));var rs=require(_0xefc6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xefc6('0x5'))(_0xefc6('0x6'));var config=require(_0xefc6('0x7'));var jayson=require(_0xefc6('0x8'));var client=jayson[_0xefc6('0x9')][_0xefc6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbfaf91,_0x49d07a,_0x43c628){return new BPromise(function(_0xfed80b,_0x27f298){return client['request'](_0xbfaf91,_0x43c628)['then'](function(_0x760b1f){logger[_0xefc6('0xb')](_0xefc6('0xc'),_0x49d07a,_0xefc6('0xd'));logger[_0xefc6('0xe')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x49d07a,_0xefc6('0xd'),JSON[_0xefc6('0xf')](_0x760b1f));if(_0x760b1f[_0xefc6('0x10')]){if(_0x760b1f[_0xefc6('0x10')][_0xefc6('0x11')]===0x1f4){logger[_0xefc6('0x10')](_0xefc6('0xc'),_0x49d07a,_0x760b1f[_0xefc6('0x10')]['message']);return _0x27f298(_0x760b1f[_0xefc6('0x10')]['message']);}logger[_0xefc6('0x10')](_0xefc6('0xc'),_0x49d07a,_0x760b1f['error'][_0xefc6('0x12')]);return _0xfed80b(_0x760b1f['error'][_0xefc6('0x12')]);}else{logger[_0xefc6('0xb')](_0xefc6('0xc'),_0x49d07a,_0xefc6('0xd'));_0xfed80b(_0x760b1f[_0xefc6('0x13')]['message']);}})[_0xefc6('0x14')](function(_0x36ba6a){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x49d07a,_0x36ba6a);_0x27f298(_0x36ba6a);});});}