From 8ab22f5dd04eb9c38deec9f9fef2086897d33080 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Tue, 8 Dec 2009 18:00:16 +0000 Subject: Set a module load priority for format modules. A recent change to app_voicemail made it such that the module now assumes that all format modules are available while processing voicemail configuration. However, when autoloading modules, it was possible that app_voicemail was loaded before the format modules. Since format modules don't depend on anything, set a module load priority on them to ensure that they get loaded first when autoloading. This fix applies to trunk, 1.6.1, and 1.6.2. The fix for 1.4 and 1.6.0 will require a different approach since the module load priority functionality is not present in the module API. (issue #16412) Reported by: jiddings git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@233692 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- formats/format_g723.c | 6 +++++- formats/format_g726.c | 6 +++++- formats/format_g729.c | 6 +++++- formats/format_gsm.c | 6 +++++- formats/format_h263.c | 6 +++++- formats/format_h264.c | 6 +++++- formats/format_ilbc.c | 6 +++++- formats/format_jpeg.c | 6 +++++- formats/format_ogg_vorbis.c | 7 +++++-- formats/format_pcm.c | 6 +++++- formats/format_siren14.c | 6 +++++- formats/format_siren7.c | 6 +++++- formats/format_sln.c | 6 +++++- formats/format_sln16.c | 6 +++++- formats/format_vox.c | 6 +++++- formats/format_wav.c | 6 +++++- formats/format_wav_gsm.c | 6 +++++- 17 files changed, 85 insertions(+), 18 deletions(-) diff --git a/formats/format_g723.c b/formats/format_g723.c index c7d84c216..46f22f1ee 100644 --- a/formats/format_g723.c +++ b/formats/format_g723.c @@ -149,4 +149,8 @@ static int unload_module(void) return ast_format_unregister(g723_1_f.name); } -AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "G.723.1 Simple Timestamp File Format"); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "G.723.1 Simple Timestamp File Format", + .load = load_module, + .unload = unload_module, + .load_pri = 10, +); diff --git a/formats/format_g726.c b/formats/format_g726.c index 4394328fb..d519fa46d 100644 --- a/formats/format_g726.c +++ b/formats/format_g726.c @@ -258,4 +258,8 @@ static int unload_module(void) return(0); } -AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Raw G.726 (16/24/32/40kbps) data"); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Raw G.726 (16/24/32/40kbps) data", + .load = load_module, + .unload = unload_module, + .load_pri = 10, +); diff --git a/formats/format_g729.c b/formats/format_g729.c index 6a676e1c0..19be7a418 100644 --- a/formats/format_g729.c +++ b/formats/format_g729.c @@ -145,4 +145,8 @@ static int unload_module(void) return ast_format_unregister(g729_f.name); } -AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Raw G729 data"); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Raw G729 data", + .load = load_module, + .unload = unload_module, + .load_pri = 10, +); diff --git a/formats/format_gsm.c b/formats/format_gsm.c index 39526b4e8..f1ba9fb76 100644 --- a/formats/format_gsm.c +++ b/formats/format_gsm.c @@ -169,4 +169,8 @@ static int unload_module(void) return ast_format_unregister(gsm_f.name); } -AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Raw GSM data"); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Raw GSM data", + .load = load_module, + .unload = unload_module, + .load_pri = 10, +); diff --git a/formats/format_h263.c b/formats/format_h263.c index 13377f4ed..02b7f792c 100644 --- a/formats/format_h263.c +++ b/formats/format_h263.c @@ -183,4 +183,8 @@ static int unload_module(void) return ast_format_unregister(h263_f.name); } -AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Raw H.263 data"); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Raw H.263 data", + .load = load_module, + .unload = unload_module, + .load_pri = 10, +); diff --git a/formats/format_h264.c b/formats/format_h264.c index 1fbad01ba..1573475ce 100644 --- a/formats/format_h264.c +++ b/formats/format_h264.c @@ -172,4 +172,8 @@ static int unload_module(void) return ast_format_unregister(h264_f.name); } -AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Raw H.264 data"); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Raw H.264 data", + .load = load_module, + .unload = unload_module, + .load_pri = 10, +); diff --git a/formats/format_ilbc.c b/formats/format_ilbc.c index 6e34fb4cd..d01c74fc4 100644 --- a/formats/format_ilbc.c +++ b/formats/format_ilbc.c @@ -143,4 +143,8 @@ static int unload_module(void) return ast_format_unregister(ilbc_f.name); } -AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Raw iLBC data"); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Raw iLBC data", + .load = load_module, + .unload = unload_module, + .load_pri = 10, +); diff --git a/formats/format_jpeg.c b/formats/format_jpeg.c index 98b98c268..54a242212 100644 --- a/formats/format_jpeg.c +++ b/formats/format_jpeg.c @@ -112,4 +112,8 @@ static int unload_module(void) return 0; } -AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "JPEG (Joint Picture Experts Group) Image Format"); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "jpeg (joint picture experts group) image format", + .load = load_module, + .unload = unload_module, + .load_pri = 10, +); diff --git a/formats/format_ogg_vorbis.c b/formats/format_ogg_vorbis.c index 29d5ad50f..928b00104 100644 --- a/formats/format_ogg_vorbis.c +++ b/formats/format_ogg_vorbis.c @@ -556,5 +556,8 @@ static int unload_module(void) return ast_format_unregister(vorbis_f.name); } -AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "OGG/Vorbis audio"); - +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "OGG/Vorbis audio", + .load = load_module, + .unload = unload_module, + .load_pri = 10, +); diff --git a/formats/format_pcm.c b/formats/format_pcm.c index b8517af6e..3129fae11 100644 --- a/formats/format_pcm.c +++ b/formats/format_pcm.c @@ -494,4 +494,8 @@ static int unload_module(void) || ast_format_unregister(g722_f.name); } -AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Raw/Sun uLaw/ALaw 8KHz (PCM,PCMA,AU), G.722 16Khz"); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Raw/Sun uLaw/ALaw 8KHz (PCM,PCMA,AU), G.722 16Khz", + .load = load_module, + .unload = unload_module, + .load_pri = 10, +); diff --git a/formats/format_siren14.c b/formats/format_siren14.c index 8fdd4aa1f..215450f78 100644 --- a/formats/format_siren14.c +++ b/formats/format_siren14.c @@ -135,4 +135,8 @@ static int unload_module(void) return ast_format_unregister(siren14_f.name); } -AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "ITU G.722.1 Annex C (Siren14, licensed from Polycom)"); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "ITU G.722.1 Annex C (Siren14, licensed from Polycom)", + .load = load_module, + .unload = unload_module, + .load_pri = 10, +); diff --git a/formats/format_siren7.c b/formats/format_siren7.c index 44d4da751..a2871fcf8 100644 --- a/formats/format_siren7.c +++ b/formats/format_siren7.c @@ -135,4 +135,8 @@ static int unload_module(void) return ast_format_unregister(siren7_f.name); } -AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "ITU G.722.1 (Siren7, licensed from Polycom)"); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "ITU G.722.1 (Siren7, licensed from Polycom)", + .load = load_module, + .unload = unload_module, + .load_pri = 10, +); diff --git a/formats/format_sln.c b/formats/format_sln.c index 9c4cce75b..11b150d5b 100644 --- a/formats/format_sln.c +++ b/formats/format_sln.c @@ -127,4 +127,8 @@ static int unload_module(void) return ast_format_unregister(slin_f.name); } -AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Raw Signed Linear Audio support (SLN)"); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Raw Signed Linear Audio support (SLN)", + .load = load_module, + .unload = unload_module, + .load_pri = 10, +); diff --git a/formats/format_sln16.c b/formats/format_sln16.c index 15991f854..3f9a73678 100644 --- a/formats/format_sln16.c +++ b/formats/format_sln16.c @@ -135,4 +135,8 @@ static int unload_module(void) return ast_format_unregister(slin_f.name); } -AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Raw Signed Linear 16KHz Audio support (SLN16)"); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Raw Signed Linear 16KHz Audio support (SLN16)", + .load = load_module, + .unload = unload_module, + .load_pri = 10, +); diff --git a/formats/format_vox.c b/formats/format_vox.c index 546777752..db9e64631 100644 --- a/formats/format_vox.c +++ b/formats/format_vox.c @@ -132,4 +132,8 @@ static int unload_module(void) return ast_format_unregister(vox_f.name); } -AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Dialogic VOX (ADPCM) File Format"); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Dialogic VOX (ADPCM) File Format", + .load = load_module, + .unload = unload_module, + .load_pri = 10, +); diff --git a/formats/format_wav.c b/formats/format_wav.c index ab02a5d15..6cd4c54bc 100644 --- a/formats/format_wav.c +++ b/formats/format_wav.c @@ -495,4 +495,8 @@ static int unload_module(void) return ast_format_unregister(wav_f.name); } -AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Microsoft WAV format (8000Hz Signed Linear)"); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Microsoft WAV format (8000Hz Signed Linear)", + .load = load_module, + .unload = unload_module, + .load_pri = 10, +); diff --git a/formats/format_wav_gsm.c b/formats/format_wav_gsm.c index 5796e28a6..0b93b6eb9 100644 --- a/formats/format_wav_gsm.c +++ b/formats/format_wav_gsm.c @@ -548,4 +548,8 @@ static int unload_module(void) return ast_format_unregister(wav49_f.name); } -AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Microsoft WAV format (Proprietary GSM)"); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Microsoft WAV format (Proprietary GSM)", + .load = load_module, + .unload = unload_module, + .load_pri = 10, +); -- cgit v1.2.3