447dd8a7dc20e1004d2741e6d15c1c36d5da8b4a
[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 _0xd10b=['../../config/environment','http','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x307cdd,_0x28c2fd){var _0x4c9403=function(_0x16c7b2){while(--_0x16c7b2){_0x307cdd['push'](_0x307cdd['shift']());}};_0x4c9403(++_0x28c2fd);}(_0xd10b,0x114));var _0xbd10=function(_0x1655d4,_0x52cf85){_0x1655d4=_0x1655d4-0x0;var _0x1c7ec7=_0xd10b[_0x1655d4];return _0x1c7ec7;};'use strict';var _=require(_0xbd10('0x0'));var util=require(_0xbd10('0x1'));var moment=require(_0xbd10('0x2'));var BPromise=require(_0xbd10('0x3'));var rs=require(_0xbd10('0x4'));var fs=require('fs');var Redis=require(_0xbd10('0x5'));var db=require(_0xbd10('0x6'))['db'];var utils=require(_0xbd10('0x7'));var logger=require(_0xbd10('0x8'))(_0xbd10('0x9'));var config=require(_0xbd10('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbd10('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x578d35,_0x2af53c,_0x6436e9){return new BPromise(function(_0x20976e,_0x19d0c3){return client['request'](_0x578d35,_0x6436e9)[_0xbd10('0xc')](function(_0x168d2d){logger['info'](_0xbd10('0xd'),_0x2af53c,_0xbd10('0xe'));logger[_0xbd10('0xf')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x2af53c,'request\x20sent',JSON['stringify'](_0x168d2d));if(_0x168d2d[_0xbd10('0x10')]){if(_0x168d2d[_0xbd10('0x10')][_0xbd10('0x11')]===0x1f4){logger['error'](_0xbd10('0xd'),_0x2af53c,_0x168d2d[_0xbd10('0x10')][_0xbd10('0x12')]);return _0x19d0c3(_0x168d2d[_0xbd10('0x10')][_0xbd10('0x12')]);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x2af53c,_0x168d2d[_0xbd10('0x10')][_0xbd10('0x12')]);return _0x20976e(_0x168d2d[_0xbd10('0x10')][_0xbd10('0x12')]);}else{logger[_0xbd10('0x13')](_0xbd10('0xd'),_0x2af53c,'request\x20sent');_0x20976e(_0x168d2d[_0xbd10('0x14')][_0xbd10('0x12')]);}})[_0xbd10('0x15')](function(_0x564fd1){logger[_0xbd10('0x10')](_0xbd10('0xd'),_0x2af53c,_0x564fd1);_0x19d0c3(_0x564fd1);});});}