Built motion from commit (unavailable).|2.5.23
[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 _0x94e1=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0xeda623,_0xb2b4d6){var _0x2940ed=function(_0x5cdec9){while(--_0x5cdec9){_0xeda623['push'](_0xeda623['shift']());}};_0x2940ed(++_0xb2b4d6);}(_0x94e1,0xb8));var _0x194e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x94e1[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x194e('0x0'));var util=require(_0x194e('0x1'));var moment=require(_0x194e('0x2'));var BPromise=require(_0x194e('0x3'));var rs=require(_0x194e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x194e('0x5'))['db'];var utils=require(_0x194e('0x6'));var logger=require(_0x194e('0x7'))(_0x194e('0x8'));var config=require(_0x194e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x194e('0xa')][_0x194e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f6261,_0x1453ea,_0x5f0f8d){return new BPromise(function(_0x2a8580,_0x4dfde5){return client[_0x194e('0xc')](_0x3f6261,_0x5f0f8d)[_0x194e('0xd')](function(_0x298a48){logger[_0x194e('0xe')](_0x194e('0xf'),_0x1453ea,'request\x20sent');logger['debug']('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x1453ea,_0x194e('0x10'),JSON[_0x194e('0x11')](_0x298a48));if(_0x298a48[_0x194e('0x12')]){if(_0x298a48[_0x194e('0x12')]['code']===0x1f4){logger['error'](_0x194e('0xf'),_0x1453ea,_0x298a48[_0x194e('0x12')][_0x194e('0x13')]);return _0x4dfde5(_0x298a48[_0x194e('0x12')][_0x194e('0x13')]);}logger[_0x194e('0x12')](_0x194e('0xf'),_0x1453ea,_0x298a48[_0x194e('0x12')]['message']);return _0x2a8580(_0x298a48[_0x194e('0x12')][_0x194e('0x13')]);}else{logger['info'](_0x194e('0xf'),_0x1453ea,_0x194e('0x10'));_0x2a8580(_0x298a48[_0x194e('0x14')][_0x194e('0x13')]);}})['catch'](function(_0x322d15){logger['error'](_0x194e('0xf'),_0x1453ea,_0x322d15);_0x4dfde5(_0x322d15);});});}