Built motion from commit 2b9af5da.|2.6.26
[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 _0x6cb1=['message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x35d775,_0x25431e){var _0x59384d=function(_0x1a0c15){while(--_0x1a0c15){_0x35d775['push'](_0x35d775['shift']());}};_0x59384d(++_0x25431e);}(_0x6cb1,0x10b));var _0x16cb=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x6cb1[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x16cb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x16cb('0x1'));var fs=require('fs');var Redis=require(_0x16cb('0x2'));var db=require(_0x16cb('0x3'))['db'];var utils=require(_0x16cb('0x4'));var logger=require(_0x16cb('0x5'))(_0x16cb('0x6'));var config=require(_0x16cb('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x16cb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x22c5f3,_0x5ad43b,_0x4ca20f){return new BPromise(function(_0x10432b,_0xc49ede){return client[_0x16cb('0x9')](_0x22c5f3,_0x4ca20f)[_0x16cb('0xa')](function(_0x4591d1){logger[_0x16cb('0xb')](_0x16cb('0xc'),_0x5ad43b,'request\x20sent');logger[_0x16cb('0xd')](_0x16cb('0xe'),_0x5ad43b,_0x16cb('0xf'),JSON[_0x16cb('0x10')](_0x4591d1));if(_0x4591d1['error']){if(_0x4591d1[_0x16cb('0x11')][_0x16cb('0x12')]===0x1f4){logger[_0x16cb('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x5ad43b,_0x4591d1[_0x16cb('0x11')][_0x16cb('0x13')]);return _0xc49ede(_0x4591d1[_0x16cb('0x11')][_0x16cb('0x13')]);}logger[_0x16cb('0x11')](_0x16cb('0xc'),_0x5ad43b,_0x4591d1[_0x16cb('0x11')]['message']);return _0x10432b(_0x4591d1[_0x16cb('0x11')][_0x16cb('0x13')]);}else{logger[_0x16cb('0xb')](_0x16cb('0xc'),_0x5ad43b,_0x16cb('0xf'));_0x10432b(_0x4591d1[_0x16cb('0x14')]['message']);}})[_0x16cb('0x15')](function(_0x4e48c3){logger[_0x16cb('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x5ad43b,_0x4e48c3);_0xc49ede(_0x4e48c3);});});}