Built motion from commit e0fa946e.|2.6.5
[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 _0xd82a=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x1f0d07,_0x407fce){var _0x2bc2ff=function(_0x421417){while(--_0x421417){_0x1f0d07['push'](_0x1f0d07['shift']());}};_0x2bc2ff(++_0x407fce);}(_0xd82a,0xbd));var _0xad82=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xd82a[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0xad82('0x0'));var util=require(_0xad82('0x1'));var moment=require(_0xad82('0x2'));var BPromise=require(_0xad82('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad82('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xad82('0x5'));var logger=require(_0xad82('0x6'))(_0xad82('0x7'));var config=require(_0xad82('0x8'));var jayson=require(_0xad82('0x9'));var client=jayson[_0xad82('0xa')][_0xad82('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45b835,_0x3cd50f,_0x2d37c8){return new BPromise(function(_0x49cc97,_0x304da5){return client[_0xad82('0xc')](_0x45b835,_0x2d37c8)[_0xad82('0xd')](function(_0x3e8aa4){logger[_0xad82('0xe')](_0xad82('0xf'),_0x3cd50f,_0xad82('0x10'));logger[_0xad82('0x11')](_0xad82('0x12'),_0x3cd50f,_0xad82('0x10'),JSON[_0xad82('0x13')](_0x3e8aa4));if(_0x3e8aa4[_0xad82('0x14')]){if(_0x3e8aa4[_0xad82('0x14')]['code']===0x1f4){logger[_0xad82('0x14')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3cd50f,_0x3e8aa4[_0xad82('0x14')]['message']);return _0x304da5(_0x3e8aa4[_0xad82('0x14')][_0xad82('0x15')]);}logger[_0xad82('0x14')](_0xad82('0xf'),_0x3cd50f,_0x3e8aa4[_0xad82('0x14')][_0xad82('0x15')]);return _0x49cc97(_0x3e8aa4['error'][_0xad82('0x15')]);}else{logger['info'](_0xad82('0xf'),_0x3cd50f,_0xad82('0x10'));_0x49cc97(_0x3e8aa4[_0xad82('0x16')][_0xad82('0x15')]);}})[_0xad82('0x17')](function(_0x298948){logger[_0xad82('0x14')](_0xad82('0xf'),_0x3cd50f,_0x298948);_0x304da5(_0x298948);});});}