This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require("lsqlite3") | |
| -- Igmar: Wanneer closen we dat DB object eigenlijk ? | |
| db = sqlite3.open('/etc/asterisk/users.sqlite') | |
| --CONSOLE = "Console/dsp" -- Console interface for demo | |
| --CONSOLE = "DAHDI/1" | |
| --CONSOLE = "Phone/phone0" | |
| TRUNK = "DAHDI/G1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| helpers do | |
| def protected! | |
| response = callcc do |cont| | |
| auth = Rack::Auth::Digest::MD5.new(cont, "Administrator only") do |username| | |
| "password" # username is ignored, or Password is always 'password' in this example. | |
| end | |
| auth.opaque = $$.to_s | |
| auth.call(request.env) | |
| end |