Skip to content

fix: escape recording IDs in API paths to support special characters#192

Open
fvieira-alb wants to merge 1 commit intoCyCoreSystems:mainfrom
fvieira-alb:bugfix/fix-recordings-operations
Open

fix: escape recording IDs in API paths to support special characters#192
fvieira-alb wants to merge 1 commit intoCyCoreSystems:mainfrom
fvieira-alb:bugfix/fix-recordings-operations

Conversation

@fvieira-alb
Copy link
Copy Markdown

@fvieira-alb fvieira-alb commented May 5, 2026

This PR adds URL path escaping to the LiveRecording methods. Currently, the key.ID is being concatenated directly into the API endpoint strings. If a recording ID contains special characters (like slashes), the resulting URL becomes malformed, leading to 405 errors.

Changes:

  • Imported the net/url package.
  • Wrapped key.ID with url.PathEscape() in all LiveRecording methods (Data, Stop, Pause, Resume, Mute, Unmute, and Scrap).

Why this is necessary:
In many environments, recording names or IDs are dynamically generated and may contain characters that are not URL-safe. Using url.PathEscape ensures that the ARI (Asterisk REST Interface) receives the correct identifier regardless of its content, making the client more robust and preventing failed requests.


This change is Reviewable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant