From 51b19e6fa63fa363f9ac095a422e719c6f02d653 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 3 May 2006 17:15:17 +0000 Subject: [PATCH] update git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1328 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_loadable_module.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/switch_loadable_module.c b/src/switch_loadable_module.c index 1faab1bf57..640d5aaaa3 100644 --- a/src/switch_loadable_module.c +++ b/src/switch_loadable_module.c @@ -568,14 +568,22 @@ SWITCH_DECLARE(switch_endpoint_interface_t *) switch_loadable_module_get_endpoin SWITCH_DECLARE(switch_codec_interface_t *) switch_loadable_module_get_codec_interface(char *name) { - char ucname[256] = ""; + char altname[256] = ""; + switch_codec_interface_t *codec; int x; - for(x = 0; x < strlen(name); x++) { - ucname[x] = toupper(name[x]); + if (!(codec = switch_core_hash_find(loadable_modules.codec_hash, name))) { + for(x = 0; x < strlen(name); x++) { + altname[x] = toupper(name[x]); + } + if (!(codec = switch_core_hash_find(loadable_modules.codec_hash, altname))) { + for(x = 0; x < strlen(name); x++) { + altname[x] = tolower(name[x]); + } + codec = switch_core_hash_find(loadable_modules.codec_hash, altname); + } } - - return switch_core_hash_find(loadable_modules.codec_hash, ucname); + return codec; } SWITCH_DECLARE(switch_dialplan_interface_t *) switch_loadable_module_get_dialplan_interface(char *name)