Built motion from commit eddce310.|2.6.12
[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 _0xac92=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment'];(function(_0x572717,_0x33ef1f){var _0x46ac6e=function(_0x4a144c){while(--_0x4a144c){_0x572717['push'](_0x572717['shift']());}};_0x46ac6e(++_0x33ef1f);}(_0xac92,0x7b));var _0x2ac9=function(_0xd9f8be,_0x34b8a9){_0xd9f8be=_0xd9f8be-0x0;var _0x496027=_0xac92[_0xd9f8be];return _0x496027;};'use strict';var _=require(_0x2ac9('0x0'));var util=require(_0x2ac9('0x1'));var moment=require(_0x2ac9('0x2'));var BPromise=require(_0x2ac9('0x3'));var rs=require(_0x2ac9('0x4'));var fs=require('fs');var Redis=require(_0x2ac9('0x5'));var db=require(_0x2ac9('0x6'))['db'];var utils=require(_0x2ac9('0x7'));var logger=require('../../config/logger')(_0x2ac9('0x8'));var config=require(_0x2ac9('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x14108f,_0x2246d9,_0x177a22){return new BPromise(function(_0x24edb4,_0x26f9c8){return client[_0x2ac9('0xa')](_0x14108f,_0x177a22)[_0x2ac9('0xb')](function(_0x4dfc91){logger[_0x2ac9('0xc')](_0x2ac9('0xd'),_0x2246d9,_0x2ac9('0xe'));logger[_0x2ac9('0xf')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x2246d9,'request\x20sent',JSON[_0x2ac9('0x10')](_0x4dfc91));if(_0x4dfc91['error']){if(_0x4dfc91[_0x2ac9('0x11')][_0x2ac9('0x12')]===0x1f4){logger[_0x2ac9('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2246d9,_0x4dfc91[_0x2ac9('0x11')][_0x2ac9('0x13')]);return _0x26f9c8(_0x4dfc91[_0x2ac9('0x11')]['message']);}logger[_0x2ac9('0x11')](_0x2ac9('0xd'),_0x2246d9,_0x4dfc91[_0x2ac9('0x11')][_0x2ac9('0x13')]);return _0x24edb4(_0x4dfc91[_0x2ac9('0x11')]['message']);}else{logger[_0x2ac9('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2246d9,_0x2ac9('0xe'));_0x24edb4(_0x4dfc91[_0x2ac9('0x14')][_0x2ac9('0x13')]);}})['catch'](function(_0x22d971){logger[_0x2ac9('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2246d9,_0x22d971);_0x26f9c8(_0x22d971);});});}