Built motion from commit (unavailable).|2.5.22
[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 _0xfa94=['../../config/logger','rpc','../../config/environment','client','http','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2d994d,_0x168a27){var _0xd54be4=function(_0x1db925){while(--_0x1db925){_0x2d994d['push'](_0x2d994d['shift']());}};_0xd54be4(++_0x168a27);}(_0xfa94,0x124));var _0x4fa9=function(_0x17a32f,_0x5a51a){_0x17a32f=_0x17a32f-0x0;var _0x15a293=_0xfa94[_0x17a32f];return _0x15a293;};'use strict';var _=require(_0x4fa9('0x0'));var util=require(_0x4fa9('0x1'));var moment=require(_0x4fa9('0x2'));var BPromise=require(_0x4fa9('0x3'));var rs=require(_0x4fa9('0x4'));var fs=require('fs');var Redis=require(_0x4fa9('0x5'));var db=require(_0x4fa9('0x6'))['db'];var utils=require(_0x4fa9('0x7'));var logger=require(_0x4fa9('0x8'))(_0x4fa9('0x9'));var config=require(_0x4fa9('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x4fa9('0xb')][_0x4fa9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18aeb2,_0x499565,_0x12dcef){return new BPromise(function(_0x3dd3a9,_0x2cdfef){return client['request'](_0x18aeb2,_0x12dcef)[_0x4fa9('0xd')](function(_0x26ea7b){logger[_0x4fa9('0xe')](_0x4fa9('0xf'),_0x499565,_0x4fa9('0x10'));logger['debug']('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x499565,_0x4fa9('0x10'),JSON[_0x4fa9('0x11')](_0x26ea7b));if(_0x26ea7b[_0x4fa9('0x12')]){if(_0x26ea7b[_0x4fa9('0x12')]['code']===0x1f4){logger[_0x4fa9('0x12')](_0x4fa9('0xf'),_0x499565,_0x26ea7b[_0x4fa9('0x12')][_0x4fa9('0x13')]);return _0x2cdfef(_0x26ea7b['error']['message']);}logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x499565,_0x26ea7b[_0x4fa9('0x12')][_0x4fa9('0x13')]);return _0x3dd3a9(_0x26ea7b['error']['message']);}else{logger[_0x4fa9('0xe')](_0x4fa9('0xf'),_0x499565,_0x4fa9('0x10'));_0x3dd3a9(_0x26ea7b['result'][_0x4fa9('0x13')]);}})['catch'](function(_0x40ed61){logger[_0x4fa9('0x12')](_0x4fa9('0xf'),_0x499565,_0x40ed61);_0x2cdfef(_0x40ed61);});});}