Tim -
I don''t think its a bug, from my understanding of what you are
doing. When you do a redirect its like a new call to a new action.
So @temp_file_name was defined by the record action/method.
I encourage you to look at the Telegraph forms implementation. It
was designed to basically deal with this sort of situation. If you
record using a form it''ll send the filename you recorded to to the
next action that the "form" results are "posted" to. It
basically
keeps the MVC style and allows you to do exactly what I believe you
are doing.
Also, I''m curious why you are using the rami_dialout and not the
Telegraph AMI implementation?
Jonathan
On Jul 18, 2007, at 8:11 PM, Tim Uckun wrote:
> I have a controller called prompts.
>
> I have a method called record. It goes like this.
>
> @prompt = Prompt.find(8)
>
> @prompt_directory >
"#{Telegraph::Config::Globals[''sound_path'']}/#{File.dirname
> (@prompt.file_name)}/"
> logger.info @prompt_directory
>
> @prompt_file_name = File.basename(@prompt.file_name)
> logger.info @prompt_file_name
>
> srand
>
> @temp_file_name >
"/tmp/#{rand(10000000000000000000000000000000000000)}" if
> @temp_file_name.nil?
> logger.info @temp_file_name
> respond_to do |format|
> # wants.xml {}
> format.html do
> rami_dialout
> render
> end #html
> format.voice do
> render_voice
> end #format.voice
> end
> end
>
>
> record.voice looks like this.
> -----------
> voice.play @prs_prompts[:recording_instructions]
> logger.info "recording " + @temp_file_name
> r = voice.record_file(@temp_file_name , 120, true, 100 )
> logger.info "recorded " + r.to_yaml
>
> voice.redirect_to :action=>''accept_menu''
>
> ---------------------
>
>
> In accept_menu.voice @temp_file_name is not in scope. It''s nil.
>
> That looks like a bug to me. Is it supposed to be this way?
> _______________________________________________
> Telegraph-users mailing list
> Telegraph-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/telegraph-users