Built motion from commit (unavailable).|2.5.9
[motion2.git] / server / api / userChatQueue / userChatQueue.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 _0xd4ef=['error','message','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x49fc3b,_0x41e454){var _0x3f4cf1=function(_0x531a9e){while(--_0x531a9e){_0x49fc3b['push'](_0x49fc3b['shift']());}};_0x3f4cf1(++_0x41e454);}(_0xd4ef,0x88));var _0xfd4e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4ef[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfd4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfd4e('0x1'));var fs=require('fs');var Redis=require(_0xfd4e('0x2'));var db=require(_0xfd4e('0x3'))['db'];var utils=require(_0xfd4e('0x4'));var logger=require(_0xfd4e('0x5'))(_0xfd4e('0x6'));var config=require(_0xfd4e('0x7'));var jayson=require(_0xfd4e('0x8'));var client=jayson[_0xfd4e('0x9')][_0xfd4e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc64b67,_0x2cf590,_0x1d86fb){return new BPromise(function(_0x40426f,_0x789617){return client[_0xfd4e('0xb')](_0xc64b67,_0x1d86fb)[_0xfd4e('0xc')](function(_0x20ea9b){logger[_0xfd4e('0xd')](_0xfd4e('0xe'),_0x2cf590,_0xfd4e('0xf'));logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x2cf590,_0xfd4e('0xf'),JSON['stringify'](_0x20ea9b));if(_0x20ea9b['error']){if(_0x20ea9b[_0xfd4e('0x10')]['code']===0x1f4){logger[_0xfd4e('0x10')](_0xfd4e('0xe'),_0x2cf590,_0x20ea9b['error'][_0xfd4e('0x11')]);return _0x789617(_0x20ea9b[_0xfd4e('0x10')][_0xfd4e('0x11')]);}logger[_0xfd4e('0x10')](_0xfd4e('0xe'),_0x2cf590,_0x20ea9b['error'][_0xfd4e('0x11')]);return _0x40426f(_0x20ea9b[_0xfd4e('0x10')][_0xfd4e('0x11')]);}else{logger[_0xfd4e('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x2cf590,_0xfd4e('0xf'));_0x40426f(_0x20ea9b[_0xfd4e('0x12')][_0xfd4e('0x11')]);}})['catch'](function(_0x3e2459){logger[_0xfd4e('0x10')](_0xfd4e('0xe'),_0x2cf590,_0x3e2459);_0x789617(_0x3e2459);});});}