* Preparing the evironment *
1) create a script directory for Asterisk and ensure it has permission to run the scripts.
* Running the script *
1) Dial extension 3000
2) Listen to the voice say 'hello world'
3) Observe a new output.txt file has been created containing the message 'hello world!'
file: hello-world.rb
#!/usr/bin/ruby #file : hello-world.rb file = File.new('/etc/asterisk/ruby/output.txt','w') file.puts 'hello world!' file.close
file: extensions.rb
exten => 3000,1,Playback(hello-world) exten => 3000,n,System(/etc/asterisk/ruby/./hello-world.rb) exten => 3000,n,Hangup
file: output.txt
hello world!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Paylasmak icin chat odaları, turkce sohbet deneyin.