Built motion from commit 1fa89557.|2.6.10
[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 _0x8a54=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','catch','lodash'];(function(_0xeb2a9e,_0x4d27e1){var _0x441336=function(_0x431c2f){while(--_0x431c2f){_0xeb2a9e['push'](_0xeb2a9e['shift']());}};_0x441336(++_0x4d27e1);}(_0x8a54,0x11f));var _0x48a5=function(_0x1a9da0,_0x2ed687){_0x1a9da0=_0x1a9da0-0x0;var _0x1c853f=_0x8a54[_0x1a9da0];return _0x1c853f;};'use strict';var _=require(_0x48a5('0x0'));var util=require('util');var moment=require(_0x48a5('0x1'));var BPromise=require(_0x48a5('0x2'));var rs=require(_0x48a5('0x3'));var fs=require('fs');var Redis=require(_0x48a5('0x4'));var db=require(_0x48a5('0x5'))['db'];var utils=require(_0x48a5('0x6'));var logger=require('../../config/logger')(_0x48a5('0x7'));var config=require(_0x48a5('0x8'));var jayson=require(_0x48a5('0x9'));var client=jayson[_0x48a5('0xa')][_0x48a5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10fc1a,_0x22722c,_0x2d2170){return new BPromise(function(_0x32ba69,_0x146c9a){return client[_0x48a5('0xc')](_0x10fc1a,_0x2d2170)[_0x48a5('0xd')](function(_0x521a54){logger[_0x48a5('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x22722c,_0x48a5('0xf'));logger[_0x48a5('0x10')](_0x48a5('0x11'),_0x22722c,_0x48a5('0xf'),JSON[_0x48a5('0x12')](_0x521a54));if(_0x521a54[_0x48a5('0x13')]){if(_0x521a54[_0x48a5('0x13')][_0x48a5('0x14')]===0x1f4){logger['error'](_0x48a5('0x15'),_0x22722c,_0x521a54['error'][_0x48a5('0x16')]);return _0x146c9a(_0x521a54[_0x48a5('0x13')][_0x48a5('0x16')]);}logger[_0x48a5('0x13')](_0x48a5('0x15'),_0x22722c,_0x521a54['error'][_0x48a5('0x16')]);return _0x32ba69(_0x521a54[_0x48a5('0x13')][_0x48a5('0x16')]);}else{logger[_0x48a5('0xe')](_0x48a5('0x15'),_0x22722c,_0x48a5('0xf'));_0x32ba69(_0x521a54['result']['message']);}})[_0x48a5('0x17')](function(_0x112abc){logger[_0x48a5('0x13')](_0x48a5('0x15'),_0x22722c,_0x112abc);_0x146c9a(_0x112abc);});});}