def compile!
      unless @media.blank?
        print "Compiling media to #{@filename}.pcap..."
        compile_media.to_file filename: "#{@filename}.pcap"
        puts "done."
      end

      scenario_filename = "#{@filename}.xml"
      print "Compiling scenario to #{scenario_filename}..."
      File.open scenario_filename, 'w' do |file|
        file.write to_xml(:pcap_path => "#{@filename}.pcap")
      end
      puts "done."

      scenario_filename
    end
def compile!
      unless @media.blank?
        print "Compiling media to #{@filename}.pcap..."
        compile_media.to_file filename: "#{@filename}.pcap"
        puts "done."
      end

      scenario_filename = "#{@filename}.xml"
      print "Compiling scenario to #{scenario_filename}..."
      File.open scenario_filename, 'w' do |file|
        file.write to_xml(:pcap_path => "#{@filename}.pcap")
      end
      puts "done."

      scenario_filename
    end
Compile the scenario and its media to disk

 Writes the SIPp scenario file to disk at {filename}.xml, and the PCAP media to {filename}.pcap if applicable.
 {filename} is taken from the :filename option when creating the scenario, or falls back to a down-snake-cased version of the scenario name.

 @return [String] the path to the resulting scenario file

 @example Export a scenario to a specified filename
   scenario = Scenario.new 'Test Scenario', filename: 'my_scenario'
   scenario.compile! # Leaves files at my_scenario.xml and my_scenario.pcap

 @example Export a scenario to a calculated filename
   scenario = Scenario.new 'Test Scenario'
   scenario.compile! # Leaves files at test_scenario.xml and test_scenario.pcap