This PR changes how mod_audio_stream attaches ASR JSON data to the event. #102
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently the module uses:
This adds the JSON payload into the event body, which makes it difficult for ESL clients and event routers to parse, because the body is not key-value structured and cannot be retrieved via event.get("key").
This PR replaces the body with a dedicated event header:
Reasons for the change
Headers are key-value pairs
They can be retrieved directly using ESL’s event.get("AudioStream-ASR"), which is much easier and more reliable.
Body parsing is inconsistent
The body is appended after all headers and may contain arbitrary content and delimiters, making JSON extraction fragile.
Consistent with FreeSWITCH best practices
Most modules that deliver structured data (e.g., mod_json_cdr, mod_verto) use event headers instead of bodies.
Backward compatibility
Existing functionality is preserved; only the method of delivering the JSON payload is improved.