Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / api / userVoiceQueue / userVoiceQueue.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 _0xa330=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserVoiceQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','util','moment','bluebird'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa330,0xc5));var _0x0a33=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xa330[_0x2070da];return _0x4f9fe1;};'use strict';var _=require('lodash');var util=require(_0x0a33('0x0'));var moment=require(_0x0a33('0x1'));var BPromise=require(_0x0a33('0x2'));var rs=require(_0x0a33('0x3'));var fs=require('fs');var Redis=require(_0x0a33('0x4'));var db=require(_0x0a33('0x5'))['db'];var utils=require(_0x0a33('0x6'));var logger=require(_0x0a33('0x7'))(_0x0a33('0x8'));var config=require(_0x0a33('0x9'));var jayson=require(_0x0a33('0xa'));var client=jayson[_0x0a33('0xb')][_0x0a33('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14ee1f,_0x538270,_0x268af3){return new BPromise(function(_0x13417f,_0x724fdd){return client[_0x0a33('0xd')](_0x14ee1f,_0x268af3)[_0x0a33('0xe')](function(_0x4279c7){logger[_0x0a33('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x538270,'request\x20sent');logger[_0x0a33('0x10')](_0x0a33('0x11'),_0x538270,'request\x20sent',JSON[_0x0a33('0x12')](_0x4279c7));if(_0x4279c7[_0x0a33('0x13')]){if(_0x4279c7['error']['code']===0x1f4){logger[_0x0a33('0x13')](_0x0a33('0x14'),_0x538270,_0x4279c7['error'][_0x0a33('0x15')]);return _0x724fdd(_0x4279c7[_0x0a33('0x13')][_0x0a33('0x15')]);}logger[_0x0a33('0x13')](_0x0a33('0x14'),_0x538270,_0x4279c7[_0x0a33('0x13')]['message']);return _0x13417f(_0x4279c7['error']['message']);}else{logger[_0x0a33('0xf')](_0x0a33('0x14'),_0x538270,_0x0a33('0x16'));_0x13417f(_0x4279c7[_0x0a33('0x17')][_0x0a33('0x15')]);}})[_0x0a33('0x18')](function(_0x504144){logger[_0x0a33('0x13')](_0x0a33('0x14'),_0x538270,_0x504144);_0x724fdd(_0x504144);});});}