lib/pwn/plugins/baresip.rb in pwn-0.4.588 vs lib/pwn/plugins/baresip.rb in pwn-0.4.590

- old
+ new

@@ -354,11 +354,11 @@ rescue StandardError => e raise e end # Supported Method Parameters:: - # PWN::Plugins::BareSIP.recon( + # PWN::Plugins::BareSIP.dial_target_in_list( # ) public_class_method def self.dial_target_in_list(opts = {}) baresip_bin = opts[:baresip_bin] target_num = opts[:target_num] @@ -378,10 +378,13 @@ seconds_to_record = 60 if seconds_to_record.zero? sox_bin = opts[:sox_bin] if File.exist?(opts[:sox_bin].to_s) sox_bin ||= '/usr/bin/sox' + speech_to_text = true if opts[:speech_to_text] + speech_to_text ||= false + waveform_bin = 'waveform' # Intialize empty baresip obj for ensure block below baresip_obj = {} @@ -564,10 +567,22 @@ absolute_recording, absolute_waveform ) puts 'complete.' call_resp_hash[:waveform] = relative_waveform + + # TODO: Get thos block working + if speech_to_text + absolute_speech_to_text = "#{absolute_recording}-speech_to_text.txt" + relative_speech_to_text = "#{relative_recording}-speech_to_text.txt" + PWN::Plugins::OpenAI.speech_to_text( + audio_file_path: absolute_recording + ) + print "Generating Speech-to-Text for #{absolute_recording}..." + puts 'complete.' + call_resp_hash[:speech_to_text] = relative_speech_to_text + end puts end_of_color end call_resp_hash rescue StandardError => e @@ -603,10 +618,11 @@ max_threads = 3 if max_threads.zero? seconds_to_record = opts[:seconds_to_record].to_i seconds_to_record = 60 if seconds_to_record.zero? sox_bin = opts[:sox_bin] if File.exist?(opts[:sox_bin].to_s) sox_bin ||= '/usr/bin/sox' + speech_to_text = opts[:speech_to_text] target_range = parse_target_file( target_file: target_file, randomize: randomize ) @@ -631,10 +647,11 @@ config_root: config_root, session_root: session_root, randomize: randomize, src_num_rules: src_num_rules, seconds_to_record: seconds_to_record, - sox_bin: sox_bin + sox_bin: sox_bin, + speech_to_text: speech_to_text ) # Push Call Results to results_hash[:data] mutex.synchronize do results_hash[:data].push(call_resp_hash)