Built motion from commit 3e059bc2.|2.5.32
[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 _0x08fb=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x08fb,0x193));var _0xb08f=function(_0x277b57,_0x329b28){_0x277b57=_0x277b57-0x0;var _0x504855=_0x08fb[_0x277b57];return _0x504855;};'use strict';var _=require(_0xb08f('0x0'));var util=require(_0xb08f('0x1'));var moment=require(_0xb08f('0x2'));var BPromise=require(_0xb08f('0x3'));var rs=require(_0xb08f('0x4'));var fs=require('fs');var Redis=require(_0xb08f('0x5'));var db=require(_0xb08f('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb08f('0x7'));var client=jayson['client'][_0xb08f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34ac16,_0xe7c94c,_0x8d4497){return new BPromise(function(_0x3af748,_0x4135db){return client[_0xb08f('0x9')](_0x34ac16,_0x8d4497)[_0xb08f('0xa')](function(_0x5527b9){logger[_0xb08f('0xb')](_0xb08f('0xc'),_0xe7c94c,_0xb08f('0xd'));logger[_0xb08f('0xe')](_0xb08f('0xf'),_0xe7c94c,'request\x20sent',JSON[_0xb08f('0x10')](_0x5527b9));if(_0x5527b9[_0xb08f('0x11')]){if(_0x5527b9[_0xb08f('0x11')][_0xb08f('0x12')]===0x1f4){logger[_0xb08f('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0xe7c94c,_0x5527b9[_0xb08f('0x11')]['message']);return _0x4135db(_0x5527b9[_0xb08f('0x11')][_0xb08f('0x13')]);}logger['error'](_0xb08f('0xc'),_0xe7c94c,_0x5527b9[_0xb08f('0x11')]['message']);return _0x3af748(_0x5527b9[_0xb08f('0x11')]['message']);}else{logger[_0xb08f('0xb')](_0xb08f('0xc'),_0xe7c94c,_0xb08f('0xd'));_0x3af748(_0x5527b9['result']['message']);}})[_0xb08f('0x14')](function(_0x4303ab){logger[_0xb08f('0x11')](_0xb08f('0xc'),_0xe7c94c,_0x4303ab);_0x4135db(_0x4303ab);});});}