summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2014-10-08 14:54:29 +0000
committerKinsey Moore <kmoore@digium.com>2014-10-08 14:54:29 +0000
commit9e0818030461fd6c05d2c30dc8f844b5a66f0402 (patch)
tree48fc6af1bb7f37f9d5df41040300bc31aaf4e914 /main
parent57a5e2ebee0e18ecf8ae53623b869f46b9bac171 (diff)
Indexer: Format message types may not exist
In Asterisk 13+, any given message type is not guaranteed to exist even if Asterisk comes up correctly since creation of the message type could be declined. The indexer should not prevent Asterisk from starting under these conditions. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@424833 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r--main/sounds_index.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/main/sounds_index.c b/main/sounds_index.c
index bc5263908..8ca5967e4 100644
--- a/main/sounds_index.c
+++ b/main/sounds_index.c
@@ -302,17 +302,21 @@ int ast_sounds_index_init(void)
return -1;
}
- res |= stasis_message_router_add(
- sounds_system_router,
- ast_format_register_type(),
- format_update_cb,
- NULL);
-
- res |= stasis_message_router_add(
- sounds_system_router,
- ast_format_unregister_type(),
- format_update_cb,
- NULL);
+ if (ast_format_register_type()) {
+ res |= stasis_message_router_add(
+ sounds_system_router,
+ ast_format_register_type(),
+ format_update_cb,
+ NULL);
+ }
+
+ if (ast_format_unregister_type()) {
+ res |= stasis_message_router_add(
+ sounds_system_router,
+ ast_format_unregister_type(),
+ format_update_cb,
+ NULL);
+ }
if (res) {
return -1;