Skip to content
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

Recording Options don't work when creating extension #25

Open
AlisonGalvani opened this issue Jul 16, 2021 · 0 comments
Open

Recording Options don't work when creating extension #25

AlisonGalvani opened this issue Jul 16, 2021 · 0 comments

Comments

@AlisonGalvani
Copy link

AlisonGalvani commented Jul 16, 2021

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';

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

No branches or pull requests

1 participant