-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Punchblock returns incorrect recording URI #258
Comments
@system123 for documentation sake, can you include Asterisk trace logs so we can see what Asterisk returns? I'd like to know whether we can rely on some specific data returned from Asterisk, or if we have to infer something (obviously the former is preferable) |
Thanks for the logs (sent privately). The problem here is that Asterisk doesn't actually tell us what the filename is. When we send a request to start recording, it looks like this:
And when the recording completes:
As you can see, we request the filename of the recording, but don't specify an extension, only a format. Asterisk gets to choose the extension based on its internal rules. We have to guess. If we are going to fix this in Punchblock/Adhearsion 3, then we'll need to replicate the logic that Asterisk uses to pick the file name suffix. |
If it helps, the place to insert the logic to infer/guess the correct file name/extension is the Asterisk record component translator |
Is it not possible to force the file extension by specifying it as part of the filename passed in the Monitor data? I will have a look to see how Asterisk determines which extension to use. |
The Asterisk Monitor docs don't specify, but the source code doesn't seem to care whether a file extension is provided. |
It appears that Asterisk hardcode the replacement of wav49 to WAV as the extension. This can be seen here Thus the easiest will be for Punchblock to make the same replacement. |
I am initialising a recording in Adhearsion using the following code (note: I am using Asterisk 11)
def record_call record async: true, format: 'wav49' do |event| puts event.recording.uri end end
If I use the standard wav format then all recording URIs are correct, the issue comes in with the wav49 format, as this format has two possible valid extensions. It can either record to a .wav file or to a .wav49 file. Punchblock always returns the filename with a .wav49 extension however, some Asterisk instances appear to record to a .wav extension thus punchblock returns an incorrect URI for the recording.
The text was updated successfully, but these errors were encountered: