[asterisk-speech-rec] Hang while loading res_speech_lumenvox on FC

sysadmin at airlinksystems.com sysadmin at airlinksystems.com
Fri Aug 24 11:54:52 CDT 2007


Stephen,

    Based on your advice, I added in the sleep(2).  it worked !  I tested a dial plan with speech recognition in it and it behaved normally.

    It does take a long time to restart asterisk.  I did some experimentation, to see if the sleep(2) had to be before every module that was loaded, or only res_speech_lumenvox.so.  It worked if I do it for only res_speech_lumenvox !  This loads fast, increasing the asterisk restart time by only 2 seconds.  Here is what my code looks like in main/loader.c:

==================
       /* added to try to get res_speech_lumenvox.so to load, on the directions of
           Stephen Keller on the asterisk-speech-res mailing list.  Remove this when
           the problem is fixed.  RGR  24 Aug 2007 */
        if ( !strcmp(resource, "res_speech_lumenvox.so") )
        {
                ast_log(LOG_NOTICE, "sleeping 2 seconds before loading module %s.\n", resource);
                sleep(2);
        }

        /* if the system supports RTLD_NOLOAD, we can just 'promote' the flags
           on the already-opened library to what we want... if not, we have to
           close it and start over
        */
#if defined(HAVE_RTLD_NOLOAD) && !defined(__Darwin__)
        if (!dlopen(fn, RTLD_NOLOAD | (wants_global ? RTLD_LAZY | RTLD_GLOBAL : RTLD_NOW | RTLD_LOCAL))) {
                ast_log(LOG_WARNING, "Unable to promote flags on module '%s': %s\n", resource_in, dlerror());
                while (!dlclose(lib));
                free(resource_being_loaded);
                return NULL;
        }
#else
==================

This may help out someone else until the fix comes out.

I'd like to say that I am really greatful for the help and pointers I get on this list -- unfortunately, many software providers would not have bothered to do something like provide the sleep() workaround before the actual fix came out.  I know that bugs involving linking and loading can be very hard to track down and test, so your taking the time to offer a workaround while figuring that out is definitely appreciated !

--Rob1


>We're working on a fix for the hang while loading res_speech_lumenvox.so
> on Fedora Core.
> 
> In the interim, if Jeff's suggestion about reverting to other versions
> of openssl doesn't work for you, you can work around the problem by
> adding a delay to Asterisk's module loader. Modify main/loader.c and
> add:
> 
> sleep(2); 
> 
> Right before the following code:
> 
> 
> /* if the system supports RTLD_NOLOAD, we can just 'promote' the flags
> 	   on the already-opened library to what we want... if not, we
> have to
> 	   close it and start over
> 	*/
> #if defined(HAVE_RTLD_NOLOAD) && !defined(__Darwin__)
> 	if (!dlopen(fn, RTLD_NOLOAD | (wants_global ? RTLD_LAZY |
> RTLD_GLOBAL : RTLD_NOW | RTLD_LOCAL))) {
> 		ast_log(LOG_WARNING, "Unable to promote flags on module
> '%s': %s\n", resource_in, dlerror());
> 		while (!dlclose(lib));
> 		free(resource_being_loaded);
> 		return NULL;
> 	}
>  
> 
> This will cause Asterisk to wait between loading modules. This makes
> Asterisk take longer to start, and is intended only as a temporary fix.
> I'll be sure to let the list know when it the issue is worked out.
> 
> Thanks,
> 
> Stephen Keller
> LumenVox Support
> P: 877-977-0707, just say "Support"
> F: 858-707-7072
> Support at LumenVox.com
> www.LumenVox.com <http://www.lumenvox.com/> 
> 
>  <http://www.lumenvox.com/> 
> 
> Winner "Best Innovation in Speech Recognition"
> AVIOS SpeechTEK Award
> 
>  
> 
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
> 
> asterisk-speech-rec mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-speech-rec



More information about the asterisk-speech-rec mailing list