-
Notifications
You must be signed in to change notification settings - Fork 27
Description
The api documentation says that it is possible to pass the following parameters:
recording_in_internal: always
recording_in_external: always
recording_out_internal: always
recording_out_external: always
To enable extension recordings, but these parameters are not working. Extensions are always being created with 'dontcare'.
Looking at the api code in /var/www/html/pbxapi/controllers/extension.php in lines 512 to 515 it is possible to see that there are validations for the following parameters: recording.inbound_external, recording.inbound_internal, recording.outbound_external, recording.outbound_internal are not received, by default they will be 'dontcare'. Example:
$RECINEXT = isset($post['recording.inbound_external'])?$post['recording.inbound_external']:'dontcare';
I think here we have the first error: the name of the parameters in validation is different from what was documented, causing the Recording Options not to work when passing the parameters that was documented.
I did tests passing the parameters as lines 512-515 expect, but I still got 'dontcare', so I found the possible second error.
In line 898 of the file /var/www/html/pbxapi/controllers/extension.php, it renames the received parameters according to the variable $field_map, declared in the same file in line 42, causing the parameters of the Recording Options to be renamed as follows:
'recording.inbound_external' = 'astdb.ampusers.recording/in/external'
'recording.inbound_internal' = 'astdb.ampusers.recording/in/internal'
'recording.outbound_external' = 'astdb.ampusers.recording/out/external'
'recording.outbound_internal' = 'astdb.ampusers.recording/out/internal'
The parameters are now called 'astdb.ampusers.recording/in/external', 'astdb.ampusers.recording/in/internal', 'astdb.ampusers.recording/out/external', 'astdb.ampusers.recording/out/ internal', different from what lines 512-515 expect, causing the value to always be 'dontcare'.
Could you fix that? Thanks!
Edit: My suggestion for correction: change lines 512-515 to:
$RECINEXT = isset($post['astdb.ampusers.recording/in/external'])?$post['astdb.ampusers.recording/in/external']:'dontcare'; $RECININT = isset($post['astdb.ampusers.recording/in/internal'])?$post['astdb.ampusers.recording/in/internal']:'dontcare'; $RECOUTEXT = isset($post['astdb.ampusers.recording/out/external'])?post['astdb.ampusers.recording/out/external']:'dontcare'; $RECOUTINT = isset($post['astdb.ampusers.recording/out/internal'])?post['astdb.ampusers.recording/out/internal']:'dontcare';