Built motion from commit f25620e4.|2.6.30
[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 _0x2feb=['error','code','message','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x19a6b7,_0x44e5fe){var _0x4b1297=function(_0x1c7ea1){while(--_0x1c7ea1){_0x19a6b7['push'](_0x19a6b7['shift']());}};_0x4b1297(++_0x44e5fe);}(_0x2feb,0x10c));var _0xb2fe=function(_0x307d2b,_0x3796e0){_0x307d2b=_0x307d2b-0x0;var _0xe82587=_0x2feb[_0x307d2b];return _0xe82587;};'use strict';var _=require(_0xb2fe('0x0'));var util=require('util');var moment=require(_0xb2fe('0x1'));var BPromise=require(_0xb2fe('0x2'));var rs=require(_0xb2fe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb2fe('0x4'));var logger=require(_0xb2fe('0x5'))(_0xb2fe('0x6'));var config=require(_0xb2fe('0x7'));var jayson=require(_0xb2fe('0x8'));var client=jayson[_0xb2fe('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x221a4a,_0x415212,_0x23b747){return new BPromise(function(_0x320766,_0x1afd30){return client[_0xb2fe('0xa')](_0x221a4a,_0x23b747)[_0xb2fe('0xb')](function(_0x2d0260){logger[_0xb2fe('0xc')](_0xb2fe('0xd'),_0x415212,_0xb2fe('0xe'));logger[_0xb2fe('0xf')](_0xb2fe('0x10'),_0x415212,_0xb2fe('0xe'),JSON[_0xb2fe('0x11')](_0x2d0260));if(_0x2d0260[_0xb2fe('0x12')]){if(_0x2d0260[_0xb2fe('0x12')][_0xb2fe('0x13')]===0x1f4){logger[_0xb2fe('0x12')](_0xb2fe('0xd'),_0x415212,_0x2d0260[_0xb2fe('0x12')][_0xb2fe('0x14')]);return _0x1afd30(_0x2d0260['error'][_0xb2fe('0x14')]);}logger['error'](_0xb2fe('0xd'),_0x415212,_0x2d0260[_0xb2fe('0x12')][_0xb2fe('0x14')]);return _0x320766(_0x2d0260[_0xb2fe('0x12')][_0xb2fe('0x14')]);}else{logger[_0xb2fe('0xc')](_0xb2fe('0xd'),_0x415212,'request\x20sent');_0x320766(_0x2d0260['result'][_0xb2fe('0x14')]);}})[_0xb2fe('0x15')](function(_0x1aee80){logger[_0xb2fe('0x12')](_0xb2fe('0xd'),_0x415212,_0x1aee80);_0x1afd30(_0x1aee80);});});}