Built motion from commit 4ca75f1b.|2.6.28
[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 _0x30df=['../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x30df,0x101));var _0xf30d=function(_0x5dd756,_0x15f305){_0x5dd756=_0x5dd756-0x0;var _0x47ab55=_0x30df[_0x5dd756];return _0x47ab55;};'use strict';var _=require(_0xf30d('0x0'));var util=require('util');var moment=require(_0xf30d('0x1'));var BPromise=require(_0xf30d('0x2'));var rs=require(_0xf30d('0x3'));var fs=require('fs');var Redis=require(_0xf30d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf30d('0x5'));var logger=require(_0xf30d('0x6'))('rpc');var config=require(_0xf30d('0x7'));var jayson=require(_0xf30d('0x8'));var client=jayson[_0xf30d('0x9')][_0xf30d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22d9eb,_0x433417,_0x29451a){return new BPromise(function(_0x1298b9,_0x1578c2){return client[_0xf30d('0xb')](_0x22d9eb,_0x29451a)[_0xf30d('0xc')](function(_0x566de5){logger[_0xf30d('0xd')](_0xf30d('0xe'),_0x433417,'request\x20sent');logger[_0xf30d('0xf')](_0xf30d('0x10'),_0x433417,_0xf30d('0x11'),JSON[_0xf30d('0x12')](_0x566de5));if(_0x566de5[_0xf30d('0x13')]){if(_0x566de5[_0xf30d('0x13')][_0xf30d('0x14')]===0x1f4){logger[_0xf30d('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0x433417,_0x566de5[_0xf30d('0x13')][_0xf30d('0x15')]);return _0x1578c2(_0x566de5[_0xf30d('0x13')][_0xf30d('0x15')]);}logger[_0xf30d('0x13')](_0xf30d('0xe'),_0x433417,_0x566de5[_0xf30d('0x13')][_0xf30d('0x15')]);return _0x1298b9(_0x566de5[_0xf30d('0x13')][_0xf30d('0x15')]);}else{logger[_0xf30d('0xd')](_0xf30d('0xe'),_0x433417,_0xf30d('0x11'));_0x1298b9(_0x566de5[_0xf30d('0x16')][_0xf30d('0x15')]);}})[_0xf30d('0x17')](function(_0x3d7300){logger[_0xf30d('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0x433417,_0x3d7300);_0x1578c2(_0x3d7300);});});}