46c74a82d26cf2859c66a60a72b1a9e654d5b6d2
[motion2.git] / server / api / voiceMusicOnHold / voiceMusicOnHold.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 _0x347f=['../../config/logger','rpc','jayson/promise','client','http','then','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x5ca3d6,_0x5c7599){var _0x3a1032=function(_0x2b70fb){while(--_0x2b70fb){_0x5ca3d6['push'](_0x5ca3d6['shift']());}};_0x3a1032(++_0x5c7599);}(_0x347f,0x19d));var _0xf347=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x347f[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xf347('0x0'));var util=require(_0xf347('0x1'));var moment=require('moment');var BPromise=require(_0xf347('0x2'));var rs=require(_0xf347('0x3'));var fs=require('fs');var Redis=require(_0xf347('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf347('0x5'))(_0xf347('0x6'));var config=require('../../config/environment');var jayson=require(_0xf347('0x7'));var client=jayson[_0xf347('0x8')][_0xf347('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53c797,_0x265486,_0x142e2e){return new BPromise(function(_0x459aa8,_0x233eeb){return client['request'](_0x53c797,_0x142e2e)[_0xf347('0xa')](function(_0x2789cd){logger['info'](_0xf347('0xb'),_0x265486,_0xf347('0xc'));logger[_0xf347('0xd')](_0xf347('0xe'),_0x265486,_0xf347('0xc'),JSON[_0xf347('0xf')](_0x2789cd));if(_0x2789cd[_0xf347('0x10')]){if(_0x2789cd['error'][_0xf347('0x11')]===0x1f4){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x265486,_0x2789cd['error'][_0xf347('0x12')]);return _0x233eeb(_0x2789cd['error'][_0xf347('0x12')]);}logger[_0xf347('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x265486,_0x2789cd[_0xf347('0x10')][_0xf347('0x12')]);return _0x459aa8(_0x2789cd[_0xf347('0x10')][_0xf347('0x12')]);}else{logger[_0xf347('0x13')](_0xf347('0xb'),_0x265486,_0xf347('0xc'));_0x459aa8(_0x2789cd[_0xf347('0x14')][_0xf347('0x12')]);}})[_0xf347('0x15')](function(_0x403b9c){logger[_0xf347('0x10')](_0xf347('0xb'),_0x265486,_0x403b9c);_0x233eeb(_0x403b9c);});});}