From: Kinsey Moore Date: Wed, 8 Oct 2014 14:54:54 +0000 (+0000) Subject: Indexer: Format message types may not exist X-Git-Tag: 14.0.0-beta1~1582 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3dfc485e35d57ceff960a32955277498961d4ed3;p=thirdparty%2Fasterisk.git 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. ........ Merged revisions 424833 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424834 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/sounds_index.c b/main/sounds_index.c index bc5263908e..8ca5967e4d 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;