bdbbc24124260aa27264b67d61afec3e7befe255
[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 _0x3731=['request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x124ac5,_0xf25dd9){var _0x1680aa=function(_0x265d7c){while(--_0x265d7c){_0x124ac5['push'](_0x124ac5['shift']());}};_0x1680aa(++_0xf25dd9);}(_0x3731,0xd3));var _0x1373=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3731[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x1373('0x0'));var moment=require('moment');var BPromise=require(_0x1373('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1373('0x2'));var db=require(_0x1373('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1373('0x4'))('rpc');var config=require(_0x1373('0x5'));var jayson=require(_0x1373('0x6'));var client=jayson[_0x1373('0x7')][_0x1373('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e5408,_0x86830e,_0x79e6ff){return new BPromise(function(_0x3726ff,_0xa97231){return client[_0x1373('0x9')](_0x2e5408,_0x79e6ff)['then'](function(_0x5ca922){logger[_0x1373('0xa')](_0x1373('0xb'),_0x86830e,_0x1373('0xc'));logger[_0x1373('0xd')](_0x1373('0xe'),_0x86830e,'request\x20sent',JSON['stringify'](_0x5ca922));if(_0x5ca922[_0x1373('0xf')]){if(_0x5ca922[_0x1373('0xf')][_0x1373('0x10')]===0x1f4){logger[_0x1373('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x86830e,_0x5ca922[_0x1373('0xf')][_0x1373('0x11')]);return _0xa97231(_0x5ca922['error'][_0x1373('0x11')]);}logger['error'](_0x1373('0xb'),_0x86830e,_0x5ca922[_0x1373('0xf')][_0x1373('0x11')]);return _0x3726ff(_0x5ca922[_0x1373('0xf')][_0x1373('0x11')]);}else{logger[_0x1373('0xa')](_0x1373('0xb'),_0x86830e,_0x1373('0xc'));_0x3726ff(_0x5ca922[_0x1373('0x12')][_0x1373('0x11')]);}})[_0x1373('0x13')](function(_0x42aae6){logger[_0x1373('0xf')](_0x1373('0xb'),_0x86830e,_0x42aae6);_0xa97231(_0x42aae6);});});}