Built motion from commit (unavailable).|2.5.26
[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 _0xa3f3=['debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x34ed02,_0x3eddbb){var _0xa80fcd=function(_0x1ea952){while(--_0x1ea952){_0x34ed02['push'](_0x34ed02['shift']());}};_0xa80fcd(++_0x3eddbb);}(_0xa3f3,0x98));var _0x3a3f=function(_0x56e466,_0x1464f5){_0x56e466=_0x56e466-0x0;var _0x57c0a9=_0xa3f3[_0x56e466];return _0x57c0a9;};'use strict';var _=require('lodash');var util=require(_0x3a3f('0x0'));var moment=require(_0x3a3f('0x1'));var BPromise=require('bluebird');var rs=require(_0x3a3f('0x2'));var fs=require('fs');var Redis=require(_0x3a3f('0x3'));var db=require(_0x3a3f('0x4'))['db'];var utils=require(_0x3a3f('0x5'));var logger=require(_0x3a3f('0x6'))(_0x3a3f('0x7'));var config=require(_0x3a3f('0x8'));var jayson=require(_0x3a3f('0x9'));var client=jayson[_0x3a3f('0xa')][_0x3a3f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49aaa5,_0x23cd07,_0x281525){return new BPromise(function(_0x3a629e,_0x563a68){return client[_0x3a3f('0xc')](_0x49aaa5,_0x281525)[_0x3a3f('0xd')](function(_0x304c9b){logger[_0x3a3f('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x23cd07,_0x3a3f('0xf'));logger[_0x3a3f('0x10')](_0x3a3f('0x11'),_0x23cd07,_0x3a3f('0xf'),JSON[_0x3a3f('0x12')](_0x304c9b));if(_0x304c9b['error']){if(_0x304c9b[_0x3a3f('0x13')][_0x3a3f('0x14')]===0x1f4){logger['error'](_0x3a3f('0x15'),_0x23cd07,_0x304c9b[_0x3a3f('0x13')][_0x3a3f('0x16')]);return _0x563a68(_0x304c9b['error'][_0x3a3f('0x16')]);}logger[_0x3a3f('0x13')](_0x3a3f('0x15'),_0x23cd07,_0x304c9b['error']['message']);return _0x3a629e(_0x304c9b['error'][_0x3a3f('0x16')]);}else{logger[_0x3a3f('0xe')](_0x3a3f('0x15'),_0x23cd07,_0x3a3f('0xf'));_0x3a629e(_0x304c9b['result']['message']);}})[_0x3a3f('0x17')](function(_0x54aef9){logger[_0x3a3f('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x23cd07,_0x54aef9);_0x563a68(_0x54aef9);});});}