Built motion from commit (unavailable).|2.5.23
[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 _0x76ed=['catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1114db,_0x1d86df){var _0x15fdcd=function(_0x167143){while(--_0x167143){_0x1114db['push'](_0x1114db['shift']());}};_0x15fdcd(++_0x1d86df);}(_0x76ed,0x166));var _0xd76e=function(_0x9eae4f,_0x8e6916){_0x9eae4f=_0x9eae4f-0x0;var _0x393ec5=_0x76ed[_0x9eae4f];return _0x393ec5;};'use strict';var _=require(_0xd76e('0x0'));var util=require(_0xd76e('0x1'));var moment=require('moment');var BPromise=require(_0xd76e('0x2'));var rs=require(_0xd76e('0x3'));var fs=require('fs');var Redis=require(_0xd76e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd76e('0x5'));var logger=require(_0xd76e('0x6'))(_0xd76e('0x7'));var config=require(_0xd76e('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x551ba9,_0x51f22d,_0x45f753){return new BPromise(function(_0x3eb3cb,_0x3d0832){return client[_0xd76e('0x9')](_0x551ba9,_0x45f753)[_0xd76e('0xa')](function(_0x4ed43e){logger[_0xd76e('0xb')](_0xd76e('0xc'),_0x51f22d,_0xd76e('0xd'));logger[_0xd76e('0xe')](_0xd76e('0xf'),_0x51f22d,_0xd76e('0xd'),JSON[_0xd76e('0x10')](_0x4ed43e));if(_0x4ed43e[_0xd76e('0x11')]){if(_0x4ed43e[_0xd76e('0x11')][_0xd76e('0x12')]===0x1f4){logger[_0xd76e('0x11')](_0xd76e('0xc'),_0x51f22d,_0x4ed43e[_0xd76e('0x11')][_0xd76e('0x13')]);return _0x3d0832(_0x4ed43e['error'][_0xd76e('0x13')]);}logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x51f22d,_0x4ed43e['error'][_0xd76e('0x13')]);return _0x3eb3cb(_0x4ed43e[_0xd76e('0x11')][_0xd76e('0x13')]);}else{logger['info'](_0xd76e('0xc'),_0x51f22d,_0xd76e('0xd'));_0x3eb3cb(_0x4ed43e['result'][_0xd76e('0x13')]);}})[_0xd76e('0x14')](function(_0x27190a){logger[_0xd76e('0x11')](_0xd76e('0xc'),_0x51f22d,_0x27190a);_0x3d0832(_0x27190a);});});}