2014-11-14 21:05:20 +08:00
|
|
|
# Global configuration file
|
2014-11-11 04:11:09 +08:00
|
|
|
|
|
|
|
# load the local configs
|
2014-11-14 21:05:20 +08:00
|
|
|
config = require("./config_local")
|
2014-11-11 04:11:09 +08:00
|
|
|
|
2014-11-11 21:58:28 +08:00
|
|
|
# BigBlueButton configs
|
2014-11-14 21:05:20 +08:00
|
|
|
config.bbb or= {}
|
|
|
|
config.bbb.sharedSecret or= "33e06642a13942004fd83b3ba6e4104a"
|
|
|
|
config.bbb.apiPath or= "/bigbluebutton/api"
|
2014-11-12 01:07:05 +08:00
|
|
|
|
2014-11-11 21:58:28 +08:00
|
|
|
# Web server configs
|
2014-11-14 21:05:20 +08:00
|
|
|
config.server or= {}
|
|
|
|
config.server.port or= 3005
|
2014-11-11 21:58:28 +08:00
|
|
|
|
|
|
|
# Web hooks configs
|
2014-11-14 21:05:20 +08:00
|
|
|
config.hooks or= {}
|
2017-09-08 01:11:43 +08:00
|
|
|
|
|
|
|
# Channels to subscribe to.
|
|
|
|
config.hooks.channels or= {
|
|
|
|
mainChannel: 'from-akka-apps-redis-channel',
|
|
|
|
rapChannel: 'bigbluebutton:from-rap'
|
|
|
|
}
|
2014-11-11 21:58:28 +08:00
|
|
|
|
2014-11-11 04:11:09 +08:00
|
|
|
# Filters to the events we want to generate callback calls for
|
2014-11-14 21:05:20 +08:00
|
|
|
config.hooks.events or= [
|
2017-09-08 01:11:43 +08:00
|
|
|
{ channel: config.hooks.channels.mainChannel, name: "MeetingCreatedEvtMsg" },
|
|
|
|
{ channel: config.hooks.channels.mainChannel, name: "MeetingEndedEvtMsg" },
|
|
|
|
{ channel: config.hooks.channels.mainChannel, name: "UserJoinedMeetingEvtMsg" },
|
|
|
|
{ channel: config.hooks.channels.mainChannel, name: "UserLeftMeetingEvtMsg" },
|
|
|
|
{ channel: config.hooks.channels.mainChannel, name: "UserJoinedVoiceConfToClientEvtMsg" },
|
|
|
|
{ channel: config.hooks.channels.mainChannel, name: "UserLeftVoiceConfToClientEvtMsg" },
|
|
|
|
{ channel: config.hooks.channels.mainChannel, name: "UserMutedVoiceEvtMsg" },
|
|
|
|
{ channel: config.hooks.channels.mainChannel, name: "UserBroadcastCamStartedEvtMsg" },
|
|
|
|
{ channel: config.hooks.channels.mainChannel, name: "UserBroadcastCamStoppedEvtMsg" },
|
|
|
|
{ channel: config.hooks.channels.mainChannel, name: "RecordingStatusChangedEvtMsg" },
|
|
|
|
{ channel: config.hooks.channels.rapChannel, name: "sanity_started" },
|
|
|
|
{ channel: config.hooks.channels.rapChannel, name: "sanity_ended" },
|
|
|
|
{ channel: config.hooks.channels.rapChannel, name: "archive_started" },
|
|
|
|
{ channel: config.hooks.channels.rapChannel, name: "archive_ended" },
|
|
|
|
{ channel: config.hooks.channels.rapChannel, name: "post_archive_started" },
|
|
|
|
{ channel: config.hooks.channels.rapChannel, name: "post_archive_ended" },
|
|
|
|
{ channel: config.hooks.channels.rapChannel, name: "process_started" },
|
|
|
|
{ channel: config.hooks.channels.rapChannel, name: "process_ended" },
|
|
|
|
{ channel: config.hooks.channels.rapChannel, name: "post_process_started" },
|
|
|
|
{ channel: config.hooks.channels.rapChannel, name: "post_process_ended" },
|
|
|
|
{ channel: config.hooks.channels.rapChannel, name: "publish_started" },
|
|
|
|
{ channel: config.hooks.channels.rapChannel, name: "publish_ended" },
|
|
|
|
{ channel: config.hooks.channels.rapChannel, name: "post_publish_started" },
|
|
|
|
{ channel: config.hooks.channels.rapChannel, name: "post_publish_ended" },
|
|
|
|
{ channel: config.hooks.channels.rapChannel, name: "unpublished" },
|
|
|
|
{ channel: config.hooks.channels.rapChannel, name: "published" },
|
|
|
|
{ channel: config.hooks.channels.rapChannel, name: "deleted" }
|
2014-11-11 04:11:09 +08:00
|
|
|
]
|
|
|
|
|
2014-11-13 04:07:29 +08:00
|
|
|
# Retry intervals for failed attempts for perform callback calls.
|
|
|
|
# In ms. Totals to around 5min.
|
|
|
|
config.hooks.retryIntervals = [
|
|
|
|
100, 500, 1000, 2000, 4000, 8000, 10000, 30000, 60000, 60000, 60000, 60000
|
|
|
|
]
|
|
|
|
|
2014-11-13 22:03:42 +08:00
|
|
|
# Mappings of internal to external meeting IDs
|
|
|
|
config.mappings = {}
|
2014-11-15 02:53:46 +08:00
|
|
|
config.mappings.cleanupInterval = 10000 # 10 secs, in ms
|
2014-11-13 22:03:42 +08:00
|
|
|
config.mappings.timeout = 1000*60*60*24 # 24 hours, in ms
|
|
|
|
|
2014-11-13 02:35:25 +08:00
|
|
|
# Redis
|
|
|
|
config.redis = {}
|
|
|
|
config.redis.keys = {}
|
|
|
|
config.redis.keys.hook = (id) -> "bigbluebutton:webhooks:hook:#{id}"
|
|
|
|
config.redis.keys.hooks = "bigbluebutton:webhooks:hooks"
|
|
|
|
config.redis.keys.mappings = "bigbluebutton:webhooks:mappings"
|
2014-11-13 22:03:42 +08:00
|
|
|
config.redis.keys.mapping = (id) -> "bigbluebutton:webhooks:mapping:#{id}"
|
2014-11-13 02:35:25 +08:00
|
|
|
|
2014-11-12 01:48:36 +08:00
|
|
|
config.api = {}
|
|
|
|
config.api.responses = {}
|
|
|
|
config.api.responses.failure = (key, msg) ->
|
|
|
|
"<response> \
|
|
|
|
<returncode>FAILED</returncode> \
|
2014-11-12 03:54:00 +08:00
|
|
|
<messageKey>#{key}</messageKey> \
|
|
|
|
<message>#{msg}</message> \
|
2014-11-12 01:48:36 +08:00
|
|
|
</response>"
|
|
|
|
config.api.responses.checksumError =
|
|
|
|
config.api.responses.failure("checksumError", "You did not pass the checksum security check.")
|
|
|
|
|
2014-11-14 21:05:20 +08:00
|
|
|
config.api.responses.createSuccess = (id) ->
|
2014-11-12 01:48:36 +08:00
|
|
|
"<response> \
|
|
|
|
<returncode>SUCCESS</returncode> \
|
2014-11-12 21:28:49 +08:00
|
|
|
<hookID>#{id}</hookID> \
|
2014-11-12 01:48:36 +08:00
|
|
|
</response>"
|
2014-11-14 21:05:20 +08:00
|
|
|
config.api.responses.createFailure =
|
2014-11-12 21:28:49 +08:00
|
|
|
config.api.responses.failure("createHookError", "An error happened while creating your hook. Check the logs.")
|
2014-11-14 21:05:20 +08:00
|
|
|
config.api.responses.createDuplicated = (id) ->
|
2014-11-12 02:56:15 +08:00
|
|
|
"<response> \
|
|
|
|
<returncode>SUCCESS</returncode> \
|
2014-11-12 21:28:49 +08:00
|
|
|
<hookID>#{id}</hookID> \
|
2014-11-12 02:56:15 +08:00
|
|
|
<messageKey>duplicateWarning</messageKey> \
|
2014-11-12 21:28:49 +08:00
|
|
|
<message>There is already a hook for this callback URL.</message> \
|
2014-11-12 02:56:15 +08:00
|
|
|
</response>"
|
2014-11-12 01:48:36 +08:00
|
|
|
|
2014-11-12 21:28:49 +08:00
|
|
|
config.api.responses.destroySuccess =
|
2014-11-12 01:48:36 +08:00
|
|
|
"<response> \
|
|
|
|
<returncode>SUCCESS</returncode> \
|
2014-11-12 21:28:49 +08:00
|
|
|
<removed>true</removed> \
|
2014-11-12 01:48:36 +08:00
|
|
|
</response>"
|
2014-11-12 21:28:49 +08:00
|
|
|
config.api.responses.destroyFailure =
|
|
|
|
config.api.responses.failure("destroyHookError", "An error happened while removing your hook. Check the logs.")
|
|
|
|
config.api.responses.destroyNoHook =
|
|
|
|
config.api.responses.failure("destroyMissingHook", "The hook informed was not found.")
|
2014-11-12 01:48:36 +08:00
|
|
|
|
|
|
|
config.api.responses.missingParamCallbackURL =
|
|
|
|
config.api.responses.failure("missingParamCallbackURL", "You must specify a callbackURL in the parameters.")
|
2014-11-12 21:28:49 +08:00
|
|
|
config.api.responses.missingParamHookID =
|
|
|
|
config.api.responses.failure("missingParamHookID", "You must specify a hookID in the parameters.")
|
2014-11-12 01:48:36 +08:00
|
|
|
|
2014-11-11 04:11:09 +08:00
|
|
|
module.exports = config
|