[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
Fri Oct 25 16:14:36 CDT 2013



> On Oct. 25, 2013, 4:54 p.m., David Lee wrote:
> > /branches/12/res/res_stasis_recording.c, line 282
> > <https://reviewboard.asterisk.org/r/2922/diff/2/?file=47169#file47169line282>
> >
> >     Since it's play_and_record_full() that's failing, could it really have been canceled?
> 
> jrose wrote:
>     I think if a user hangs up the phone during a recording instead of pushes pound, that might count as cancellation.
> 
> jrose wrote:
>     But... I should check on that.

Ugh.  So this is remarkably frustrating behavior. ast_play_and_record_full will return -1 on hangup even if the recording was successful.  It will also return -1 if the recording fails to start. The bottom line is that the return value isn't particularly useful for anything, so I'm going to go ahead and pull this change.


- jrose


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2922/#review9995
-----------------------------------------------------------


On Oct. 17, 2013, 5:46 p.m., jrose wrote:
> 
> -----------------------------------------------------------
> 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.
> 
> 
> 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
> -----
> 
>   /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/20131025/72a4b2f0/attachment.html>


More information about the asterisk-dev mailing list