Built motion from commit 4fa9d4a7.|2.6.31
[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 _0xf492=['rpc','jayson/promise','client','http','request','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xc266d6,_0x15fc8c){var _0x2ab82c=function(_0x1990bb){while(--_0x1990bb){_0xc266d6['push'](_0xc266d6['shift']());}};_0x2ab82c(++_0x15fc8c);}(_0xf492,0x67));var _0x2f49=function(_0x2ab41b,_0x37d2a2){_0x2ab41b=_0x2ab41b-0x0;var _0x454524=_0xf492[_0x2ab41b];return _0x454524;};'use strict';var _=require(_0x2f49('0x0'));var util=require(_0x2f49('0x1'));var moment=require(_0x2f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x2f49('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f49('0x4'))['db'];var utils=require(_0x2f49('0x5'));var logger=require(_0x2f49('0x6'))(_0x2f49('0x7'));var config=require('../../config/environment');var jayson=require(_0x2f49('0x8'));var client=jayson[_0x2f49('0x9')][_0x2f49('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10f9a3,_0x1f9ca6,_0x141b7a){return new BPromise(function(_0x21da80,_0x35dc80){return client[_0x2f49('0xb')](_0x10f9a3,_0x141b7a)[_0x2f49('0xc')](function(_0x107659){logger['info'](_0x2f49('0xd'),_0x1f9ca6,_0x2f49('0xe'));logger['debug'](_0x2f49('0xf'),_0x1f9ca6,'request\x20sent',JSON['stringify'](_0x107659));if(_0x107659[_0x2f49('0x10')]){if(_0x107659[_0x2f49('0x10')][_0x2f49('0x11')]===0x1f4){logger[_0x2f49('0x10')](_0x2f49('0xd'),_0x1f9ca6,_0x107659['error'][_0x2f49('0x12')]);return _0x35dc80(_0x107659[_0x2f49('0x10')][_0x2f49('0x12')]);}logger[_0x2f49('0x10')](_0x2f49('0xd'),_0x1f9ca6,_0x107659[_0x2f49('0x10')][_0x2f49('0x12')]);return _0x21da80(_0x107659[_0x2f49('0x10')][_0x2f49('0x12')]);}else{logger[_0x2f49('0x13')](_0x2f49('0xd'),_0x1f9ca6,'request\x20sent');_0x21da80(_0x107659[_0x2f49('0x14')][_0x2f49('0x12')]);}})[_0x2f49('0x15')](function(_0x36db4f){logger['error'](_0x2f49('0xd'),_0x1f9ca6,_0x36db4f);_0x35dc80(_0x36db4f);});});}