Built motion from commit 953226e6.|2.6.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 _0x4a8c=['info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then'];(function(_0x2f4406,_0x363dc2){var _0x21036d=function(_0x1ad01a){while(--_0x1ad01a){_0x2f4406['push'](_0x2f4406['shift']());}};_0x21036d(++_0x363dc2);}(_0x4a8c,0x12f));var _0xc4a8=function(_0x5d9522,_0x4abfde){_0x5d9522=_0x5d9522-0x0;var _0x60d7ee=_0x4a8c[_0x5d9522];return _0x60d7ee;};'use strict';var _=require(_0xc4a8('0x0'));var util=require(_0xc4a8('0x1'));var moment=require(_0xc4a8('0x2'));var BPromise=require('bluebird');var rs=require(_0xc4a8('0x3'));var fs=require('fs');var Redis=require(_0xc4a8('0x4'));var db=require(_0xc4a8('0x5'))['db'];var utils=require(_0xc4a8('0x6'));var logger=require(_0xc4a8('0x7'))(_0xc4a8('0x8'));var config=require(_0xc4a8('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c7d2f,_0x1d7343,_0x2cbcb9){return new BPromise(function(_0x3e93a9,_0x5f1197){return client[_0xc4a8('0xa')](_0x2c7d2f,_0x2cbcb9)[_0xc4a8('0xb')](function(_0x1053c3){logger[_0xc4a8('0xc')](_0xc4a8('0xd'),_0x1d7343,_0xc4a8('0xe'));logger[_0xc4a8('0xf')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x1d7343,_0xc4a8('0xe'),JSON[_0xc4a8('0x10')](_0x1053c3));if(_0x1053c3[_0xc4a8('0x11')]){if(_0x1053c3[_0xc4a8('0x11')]['code']===0x1f4){logger[_0xc4a8('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1d7343,_0x1053c3[_0xc4a8('0x11')][_0xc4a8('0x12')]);return _0x5f1197(_0x1053c3['error'][_0xc4a8('0x12')]);}logger['error'](_0xc4a8('0xd'),_0x1d7343,_0x1053c3[_0xc4a8('0x11')][_0xc4a8('0x12')]);return _0x3e93a9(_0x1053c3[_0xc4a8('0x11')]['message']);}else{logger[_0xc4a8('0xc')](_0xc4a8('0xd'),_0x1d7343,_0xc4a8('0xe'));_0x3e93a9(_0x1053c3[_0xc4a8('0x13')][_0xc4a8('0x12')]);}})[_0xc4a8('0x14')](function(_0x177afa){logger[_0xc4a8('0x11')](_0xc4a8('0xd'),_0x1d7343,_0x177afa);_0x5f1197(_0x177afa);});});}