Built motion from commit f7863d46.|2.5.41
[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 _0x7834=['then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0xf48244,_0x115cad){var _0x37d890=function(_0x19a886){while(--_0x19a886){_0xf48244['push'](_0xf48244['shift']());}};_0x37d890(++_0x115cad);}(_0x7834,0x13f));var _0x4783=function(_0x2020ea,_0x26fc4f){_0x2020ea=_0x2020ea-0x0;var _0x3657fe=_0x7834[_0x2020ea];return _0x3657fe;};'use strict';var _=require(_0x4783('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4783('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4783('0x2'));var db=require(_0x4783('0x3'))['db'];var utils=require(_0x4783('0x4'));var logger=require(_0x4783('0x5'))(_0x4783('0x6'));var config=require(_0x4783('0x7'));var jayson=require(_0x4783('0x8'));var client=jayson['client'][_0x4783('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf8c030,_0x518da8,_0x2dcf46){return new BPromise(function(_0x16c83e,_0x36c0a7){return client[_0x4783('0xa')](_0xf8c030,_0x2dcf46)[_0x4783('0xb')](function(_0x1f8b29){logger['info'](_0x4783('0xc'),_0x518da8,_0x4783('0xd'));logger[_0x4783('0xe')](_0x4783('0xf'),_0x518da8,_0x4783('0xd'),JSON[_0x4783('0x10')](_0x1f8b29));if(_0x1f8b29[_0x4783('0x11')]){if(_0x1f8b29['error']['code']===0x1f4){logger[_0x4783('0x11')](_0x4783('0xc'),_0x518da8,_0x1f8b29['error'][_0x4783('0x12')]);return _0x36c0a7(_0x1f8b29['error'][_0x4783('0x12')]);}logger[_0x4783('0x11')](_0x4783('0xc'),_0x518da8,_0x1f8b29[_0x4783('0x11')][_0x4783('0x12')]);return _0x16c83e(_0x1f8b29['error'][_0x4783('0x12')]);}else{logger[_0x4783('0x13')](_0x4783('0xc'),_0x518da8,_0x4783('0xd'));_0x16c83e(_0x1f8b29[_0x4783('0x14')][_0x4783('0x12')]);}})[_0x4783('0x15')](function(_0x40dbcf){logger[_0x4783('0x11')](_0x4783('0xc'),_0x518da8,_0x40dbcf);_0x36c0a7(_0x40dbcf);});});}