Built motion from commit (unavailable).|2.5.29
[motion2.git] / server / api / userOpenchannelQueue / userOpenchannelQueue.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 _0x3a39=['util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','request\x20sent','catch'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x3a39,0x18f));var _0x93a3=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x3a39[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x93a3('0x0'));var moment=require(_0x93a3('0x1'));var BPromise=require(_0x93a3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x93a3('0x3'));var logger=require(_0x93a3('0x4'))(_0x93a3('0x5'));var config=require(_0x93a3('0x6'));var jayson=require(_0x93a3('0x7'));var client=jayson['client'][_0x93a3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33ba5b,_0x588257,_0x3721d0){return new BPromise(function(_0x43fa73,_0x2cf3f7){return client[_0x93a3('0x9')](_0x33ba5b,_0x3721d0)[_0x93a3('0xa')](function(_0x30741d){logger[_0x93a3('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x588257,'request\x20sent');logger[_0x93a3('0xc')](_0x93a3('0xd'),_0x588257,'request\x20sent',JSON[_0x93a3('0xe')](_0x30741d));if(_0x30741d[_0x93a3('0xf')]){if(_0x30741d[_0x93a3('0xf')][_0x93a3('0x10')]===0x1f4){logger['error'](_0x93a3('0x11'),_0x588257,_0x30741d['error'][_0x93a3('0x12')]);return _0x2cf3f7(_0x30741d[_0x93a3('0xf')][_0x93a3('0x12')]);}logger[_0x93a3('0xf')](_0x93a3('0x11'),_0x588257,_0x30741d[_0x93a3('0xf')][_0x93a3('0x12')]);return _0x43fa73(_0x30741d[_0x93a3('0xf')][_0x93a3('0x12')]);}else{logger[_0x93a3('0xb')](_0x93a3('0x11'),_0x588257,_0x93a3('0x13'));_0x43fa73(_0x30741d['result'][_0x93a3('0x12')]);}})[_0x93a3('0x14')](function(_0x243614){logger['error'](_0x93a3('0x11'),_0x588257,_0x243614);_0x2cf3f7(_0x243614);});});}