Built motion from commit 753c950e.|2.5.42
[motion2.git] / server / api / voiceQueuesLog / voiceQueuesLog.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 _0x34e1=['client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x39efbf,_0x118364){var _0xcbd510=function(_0x4e152f){while(--_0x4e152f){_0x39efbf['push'](_0x39efbf['shift']());}};_0xcbd510(++_0x118364);}(_0x34e1,0xdc));var _0x134e=function(_0x1301b4,_0x2fb602){_0x1301b4=_0x1301b4-0x0;var _0x4252dc=_0x34e1[_0x1301b4];return _0x4252dc;};'use strict';var _=require(_0x134e('0x0'));var util=require(_0x134e('0x1'));var moment=require(_0x134e('0x2'));var BPromise=require(_0x134e('0x3'));var rs=require(_0x134e('0x4'));var fs=require('fs');var Redis=require(_0x134e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x134e('0x6'));var logger=require(_0x134e('0x7'))(_0x134e('0x8'));var config=require(_0x134e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x134e('0xa')][_0x134e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26bef8,_0x8cc6b6,_0xec5fd1){return new BPromise(function(_0x1dd89b,_0x5e1bec){return client[_0x134e('0xc')](_0x26bef8,_0xec5fd1)[_0x134e('0xd')](function(_0x3c481a){logger['info'](_0x134e('0xe'),_0x8cc6b6,_0x134e('0xf'));logger[_0x134e('0x10')](_0x134e('0x11'),_0x8cc6b6,'request\x20sent',JSON['stringify'](_0x3c481a));if(_0x3c481a[_0x134e('0x12')]){if(_0x3c481a[_0x134e('0x12')][_0x134e('0x13')]===0x1f4){logger[_0x134e('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x8cc6b6,_0x3c481a['error']['message']);return _0x5e1bec(_0x3c481a[_0x134e('0x12')][_0x134e('0x14')]);}logger[_0x134e('0x12')](_0x134e('0xe'),_0x8cc6b6,_0x3c481a[_0x134e('0x12')][_0x134e('0x14')]);return _0x1dd89b(_0x3c481a[_0x134e('0x12')][_0x134e('0x14')]);}else{logger[_0x134e('0x15')](_0x134e('0xe'),_0x8cc6b6,'request\x20sent');_0x1dd89b(_0x3c481a[_0x134e('0x16')][_0x134e('0x14')]);}})['catch'](function(_0x281297){logger[_0x134e('0x12')](_0x134e('0xe'),_0x8cc6b6,_0x281297);_0x5e1bec(_0x281297);});});}