[Voiceglue] patch for file:// support

Dave Koberstein davek at komacke.com
Sun May 30 05:28:33 UTC 2010


Hi Doug,

I was trying to use file:// protocol (which curl supports) but had 
issues with it.  Turns out curl doesn't create a .header file and then 
voice glue errors out because that file doesn't exist.  I made a patch 
that touches the file if the protocol is file://.  voiceglue reports the 
file is not cacheable because there is no Last-Modified header, which 
seems reasonable.

I noticed that the cache doesn't get cleaned up by default.  Just to 
confirm my understanding (and that I didn't introduce a bug), it doesn't 
actually clean up, it simply marks that a file should not be reused so 
that the file can be re-fetched upon next use.

I also added a special feature.  Let me know if this is an ok 
implementation or if you'd like to see a different approach.  When the 
file:// URL is a relative path (not file:///) then the file is assumed 
to be in ast_sound_dir.  In my situation there are large audio files 
that may be NFS or CIFS mounted.  If curl is used then the file needs to 
be pulled over completely before asterisk can start playing.  However if 
asterisk could access the file directly then asterisk will start playing 
immediately.  So in the case of a file://[^/], I use 'ln -s' instead.

In this case maybe it makes sense to take the same approach as you did 
with tts.  Perhaps the transfer mechanism should be a script that can be 
adjusted, replaced or expanded as desired at deployment.  I took the 
approach of modifying voiceglue since I was already making the other 
patch.  Unless you've been getting requests probably this is a good 
solution for now.

Is it best to provide patches for your review directly to your address?

Thanks,

Davek




More information about the Voiceglue mailing list