Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / api / teamVoiceQueue / teamVoiceQueue.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 _0xaf09=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x5c4165,_0x264905){var _0x521e50=function(_0x10cb11){while(--_0x10cb11){_0x5c4165['push'](_0x5c4165['shift']());}};_0x521e50(++_0x264905);}(_0xaf09,0x10d));var _0x9af0=function(_0x1cbcf1,_0x3f9fd9){_0x1cbcf1=_0x1cbcf1-0x0;var _0x3a06f0=_0xaf09[_0x1cbcf1];return _0x3a06f0;};'use strict';var _=require(_0x9af0('0x0'));var util=require(_0x9af0('0x1'));var moment=require(_0x9af0('0x2'));var BPromise=require(_0x9af0('0x3'));var rs=require(_0x9af0('0x4'));var fs=require('fs');var Redis=require(_0x9af0('0x5'));var db=require(_0x9af0('0x6'))['db'];var utils=require(_0x9af0('0x7'));var logger=require(_0x9af0('0x8'))('rpc');var config=require(_0x9af0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9af0('0xa')][_0x9af0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52162e,_0xf7e92,_0x556d1a){return new BPromise(function(_0x51663a,_0xad63de){return client[_0x9af0('0xc')](_0x52162e,_0x556d1a)[_0x9af0('0xd')](function(_0x220f3c){logger[_0x9af0('0xe')](_0x9af0('0xf'),_0xf7e92,_0x9af0('0x10'));logger[_0x9af0('0x11')](_0x9af0('0x12'),_0xf7e92,_0x9af0('0x10'),JSON['stringify'](_0x220f3c));if(_0x220f3c['error']){if(_0x220f3c[_0x9af0('0x13')][_0x9af0('0x14')]===0x1f4){logger[_0x9af0('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0xf7e92,_0x220f3c[_0x9af0('0x13')][_0x9af0('0x15')]);return _0xad63de(_0x220f3c[_0x9af0('0x13')]['message']);}logger['error'](_0x9af0('0xf'),_0xf7e92,_0x220f3c[_0x9af0('0x13')][_0x9af0('0x15')]);return _0x51663a(_0x220f3c['error'][_0x9af0('0x15')]);}else{logger[_0x9af0('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0xf7e92,'request\x20sent');_0x51663a(_0x220f3c[_0x9af0('0x16')][_0x9af0('0x15')]);}})[_0x9af0('0x17')](function(_0x40ad66){logger[_0x9af0('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0xf7e92,_0x40ad66);_0xad63de(_0x40ad66);});});}