This code all exists in inbound_did context in dialplan.rb
host_config = YAML::load(File.open("config/hosts.yml")).to_hash
sip_hash = host_config["sip_hash"]
hostnames = host_config["hostnames"]
I’m trying to figure out if I should put YAML::load in dialplan.rb or somewhere else. I’d like to only load it once when adhearsion is started but I don’t know how I could then access that config variable from the dialplan’s scope…
if you want to loads it only one then maybe constant will be OK for you?
then if you want to use it in another class then you can do something like this: