[asterisk-dev] [Code Review] 2922: ARI Recording: If the file already exists and ifExist is set to fail when we issue the command and we can verify it, issue a 409 instead of a success.
jrose
reviewboard at asterisk.org
Thu Oct 17 12:46:48 CDT 2013
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2922/
-----------------------------------------------------------
(Updated Oct. 17, 2013, 5:46 p.m.)
Review request for Asterisk Developers, David Lee and kmoore.
Changes
-------
Address mmichelson and dlee's reviews
Bugs: ASTERISK-22623
https://issues.asterisk.org/jira/browse/ASTERISK-22623
Repository: Asterisk
Description
-------
This affects both channel and bridge recording. Basically it just adds a simple check to make sure that the requested file doesn't already exist on the file system when we want to record. If it does, we set EEXIST on errno and return error. I went ahead and switched the errno value for when another live recording exists that uses the same base name to EAGAIN... not sure how appropriate that is.
I also added event models for Recording events, but nothing issues these events yet. They'll be useful later.
I've written a test for this, which is in review here: https://reviewboard.asterisk.org/r/2921/
Diffs (updated)
-----
/branches/12/res/ari/ari_model_validators.h 400905
/branches/12/res/ari/ari_model_validators.c 400905
/branches/12/res/ari/resource_bridges.c 400905
/branches/12/res/ari/resource_channels.c 400905
/branches/12/res/res_ari_bridges.c 400905
/branches/12/res/res_ari_channels.c 400905
/branches/12/res/res_stasis_recording.c 400905
/branches/12/rest-api/api-docs/bridges.json 400905
/branches/12/rest-api/api-docs/channels.json 400905
/branches/12/rest-api/api-docs/events.json 400905
/branches/12/rest-api/api-docs/recordings.json 400905
Diff: https://reviewboard.asterisk.org/r/2922/diff/
Testing
-------
I tested it manually with Swagger UI and attempted to record when a file existed where I wanted one and received the expected 409. I also checked to make sure I would still succeed if ifExists was set to overwrite. I also checked for success when the file just didn't exist in the first place. I think that covers all my bases. All of these scenarios are also covered by the automated test in review 2921
Thanks,
jrose
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20131017/c81a5bda/attachment.html>
More information about the asterisk-dev
mailing list