Hello there. I think the reason you can''t connect to your distant server is because your agi_server running on port 4573 is only bound to the localhost. I''ve changed line 48 of lib/call_server.rb from @config[:BindAddress]=''localhost'' to @config[:BindAddress]= Telegraph::Config::Globals[''agiServer''] || ''localhost'' Then in your environment.rb file you can Telegraph::Config::Globals["agiServer"] = "0.0.0.0" When you run the call server it will then bind to any available IP address. I''ve also submitted a patch to the rubyforge page. Hope this helps Anthony ----- Anthony Ramm OpenAdvantage Systems Specialist T: 0121 6341620 F: 0121 6341630 http://www.openadvantage.org/ http://cumu.li/ Be enlightened - you are in control To find out more about our free IT consultancy and to visit a place on a seminar or training workshop visit http://www.openadvantage.org/ events Freedom, Choice, Control
Hi
Thanks for the tip. I''ve tested it and it fixes the problem.
Now there''s the problem of fetching audio files from a distant server.
I was thinking of using a system/trysystem call with wget to save the file
to a tmp file on the asterisk box. Something like (in call_connection.rb):
def prepare_audio(soundName)
if File.exists?(soundName)
suffix = File.extname(soundName)
tmpFile = "/tmp/#{File.basename(soundName, suffix)}"
soundUrl =
soundName.gsub(Telegraph::Config::Globals["SOUNDPATH"],
Telegraph::Config::Globals["SOUNDURL"])
exec("System", "(/bin/echo \"#{soundUrl}\"
>>
/tmp/prepare_audio.log)")
exec("System", "(/usr/bin/wget #{soundUrl} -O
#{tmpFile}#{suffix})")
exec("playback", tmpFile)
tmpFile
else
soundName
end
end
However it seems that the call isn''t executed. I tried as well with a
simple
/bin/echo instead of the wget command, but without success. Do you know if
there''s any restriction on using some applications like System with
AGI?
In the CLI with agi debug on, it seems alright to me:
AGI Rx << EXEC System (/bin/echo "
http://morcheeba:3000/sounds/banking-main-menu.sln" >>
/tmp/prepare_audio.log)
AGI Tx >> 200 result=0
AGI Rx << EXEC System (/usr/bin/wget
http://morcheeba:3000/sounds/banking-main-menu.sln -O /tmp/banking-
main-menu.sln)
AGI Tx >> 200 result=0
Finally, if I call the System app directly by editing extensions.conf, it
works fine. So I was thinking I could go for a macro instead. What do you
think?
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://rubyforge.org/pipermail/telegraph-users/attachments/20070608/1ddcaa06/attachment.html
Have you had any more luck with this? It seems to me like it should work as well, but I haven''t had a chance to play around with it. I''ll give it a shot in the next few days - let us know if you discover anything! JP On 6/8/07, Hoang-Anh Phan <chichgu at gmail.com> wrote:> > Hi > > Thanks for the tip. I''ve tested it and it fixes the problem. > > Now there''s the problem of fetching audio files from a distant server. > > I was thinking of using a system/trysystem call with wget to save the file > to a tmp file on the asterisk box. Something like (in call_connection.rb): > > def prepare_audio(soundName) > if File.exists?(soundName) > suffix = File.extname(soundName) > tmpFile = "/tmp/#{File.basename(soundName, suffix)}" > soundUrl = soundName.gsub(Telegraph::Config::Globals["SOUNDPATH"], > Telegraph::Config::Globals["SOUNDURL"]) > exec("System", "(/bin/echo \"#{soundUrl}\" >> > /tmp/prepare_audio.log)") > exec("System", "(/usr/bin/wget #{soundUrl} -O > #{tmpFile}#{suffix})") > exec("playback", tmpFile) > tmpFile > else > soundName > end > end > > However it seems that the call isn''t executed. I tried as well with a > simple /bin/echo instead of the wget command, but without success. Do you > know if there''s any restriction on using some applications like System with > AGI? > > In the CLI with agi debug on, it seems alright to me: > AGI Rx << EXEC System (/bin/echo "http://morcheeba:3000/sounds/banking-main-menu.sln > " >> /tmp/prepare_audio.log) > AGI Tx >> 200 result=0 > AGI Rx << EXEC System (/usr/bin/wget http://morcheeba:3000/sounds/banking-main-menu.sln > -O /tmp/banking-main-menu.sln) > AGI Tx >> 200 result=0 > > Finally, if I call the System app directly by editing extensions.conf, it > works fine. So I was thinking I could go for a macro instead. What do you > think? > > > _______________________________________________ > Telegraph-users mailing list > Telegraph-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/telegraph-users > >-- Jonathan Palley | Idapted Inc. jpalley at idapted.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/telegraph-users/attachments/20070610/5aecc28e/attachment.html
It is working pretty well with a macro like this:
[macro-prepare-audio]
exten => s,1,System(/usr/bin/wget ${ARG1} -O ${ARG2})
which can be called this way in call_connection.rb:
exec("Macro",
"prepare-audio|\"#{soundUrl}\"|\"#{tmpFile}#{suffix}\"")
exec("playback", tmpFile)
Audio files need to be moved to the public folder so that wget can fetch
them.
Using this, the next stage would be to have some kind of cache mechanism to
mimic the voicexml maxstale, maxage properties.
I''m not sure how this solution would scale though...
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://rubyforge.org/pipermail/telegraph-users/attachments/20070612/8d03629a/attachment.html