Built motion from commit (unavailable).|2.5.30
[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 _0x5b44=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','code','error','message','util','moment','bluebird'];(function(_0x15ad14,_0x5f0d89){var _0x29a1a3=function(_0x266eab){while(--_0x266eab){_0x15ad14['push'](_0x15ad14['shift']());}};_0x29a1a3(++_0x5f0d89);}(_0x5b44,0x179));var _0x45b4=function(_0x1c7cb7,_0xc9e6d1){_0x1c7cb7=_0x1c7cb7-0x0;var _0x5ac8e6=_0x5b44[_0x1c7cb7];return _0x5ac8e6;};'use strict';var _=require('lodash');var util=require(_0x45b4('0x0'));var moment=require(_0x45b4('0x1'));var BPromise=require(_0x45b4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x45b4('0x3'));var logger=require('../../config/logger')(_0x45b4('0x4'));var config=require(_0x45b4('0x5'));var jayson=require(_0x45b4('0x6'));var client=jayson[_0x45b4('0x7')][_0x45b4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b9b2a,_0xafe170,_0x1583a5){return new BPromise(function(_0x3b16c8,_0x2c9928){return client[_0x45b4('0x9')](_0x4b9b2a,_0x1583a5)[_0x45b4('0xa')](function(_0x45df98){logger[_0x45b4('0xb')](_0x45b4('0xc'),_0xafe170,_0x45b4('0xd'));logger[_0x45b4('0xe')](_0x45b4('0xf'),_0xafe170,_0x45b4('0xd'),JSON[_0x45b4('0x10')](_0x45df98));if(_0x45df98['error']){if(_0x45df98['error'][_0x45b4('0x11')]===0x1f4){logger[_0x45b4('0x12')](_0x45b4('0xc'),_0xafe170,_0x45df98['error']['message']);return _0x2c9928(_0x45df98[_0x45b4('0x12')][_0x45b4('0x13')]);}logger[_0x45b4('0x12')](_0x45b4('0xc'),_0xafe170,_0x45df98['error']['message']);return _0x3b16c8(_0x45df98[_0x45b4('0x12')]['message']);}else{logger['info'](_0x45b4('0xc'),_0xafe170,_0x45b4('0xd'));_0x3b16c8(_0x45df98['result'][_0x45b4('0x13')]);}})['catch'](function(_0x2345d4){logger[_0x45b4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xafe170,_0x2345d4);_0x2c9928(_0x2345d4);});});}