Built motion from commit b5996064.|2.6.21
[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 _0x1c57=['jayson/promise','http','info','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0x1c57,0xf5));var _0x71c5=function(_0x4a60d7,_0x358b8e){_0x4a60d7=_0x4a60d7-0x0;var _0x293c42=_0x1c57[_0x4a60d7];return _0x293c42;};'use strict';var _=require(_0x71c5('0x0'));var util=require('util');var moment=require(_0x71c5('0x1'));var BPromise=require(_0x71c5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x71c5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x71c5('0x4'));var logger=require(_0x71c5('0x5'))(_0x71c5('0x6'));var config=require('../../config/environment');var jayson=require(_0x71c5('0x7'));var client=jayson['client'][_0x71c5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d9d78,_0x52ed2a,_0x4b7338){return new BPromise(function(_0x4f4009,_0x13631c){return client['request'](_0x2d9d78,_0x4b7338)['then'](function(_0xa181e4){logger[_0x71c5('0x9')](_0x71c5('0xa'),_0x52ed2a,'request\x20sent');logger[_0x71c5('0xb')](_0x71c5('0xc'),_0x52ed2a,_0x71c5('0xd'),JSON[_0x71c5('0xe')](_0xa181e4));if(_0xa181e4[_0x71c5('0xf')]){if(_0xa181e4[_0x71c5('0xf')]['code']===0x1f4){logger[_0x71c5('0xf')](_0x71c5('0xa'),_0x52ed2a,_0xa181e4[_0x71c5('0xf')][_0x71c5('0x10')]);return _0x13631c(_0xa181e4['error'][_0x71c5('0x10')]);}logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x52ed2a,_0xa181e4[_0x71c5('0xf')][_0x71c5('0x10')]);return _0x4f4009(_0xa181e4[_0x71c5('0xf')]['message']);}else{logger[_0x71c5('0x9')]('TeamVoiceQueue,\x20%s,\x20%s',_0x52ed2a,_0x71c5('0xd'));_0x4f4009(_0xa181e4[_0x71c5('0x11')][_0x71c5('0x10')]);}})['catch'](function(_0x5a67b9){logger[_0x71c5('0xf')](_0x71c5('0xa'),_0x52ed2a,_0x5a67b9);_0x13631c(_0x5a67b9);});});}