[asterisk-dev] [Code Review] Clean up AsyncAGI command loop.

rmudgett reviewboard at asterisk.org
Mon Apr 18 10:18:06 CDT 2011



> On 2011-04-14 17:46:36, Russell Bryant wrote:
> > /branches/1.8/res/res_agi.c, lines 919-921
> > <https://reviewboard.asterisk.org/r/1183/diff/1/?file=16168#file16168line919>
> >
> >     Is there some way we could make sure this doesn't overlap with another return code?

Not really.  The exec command is the only exception and does not return like any other AGI commands.  Exec could return anything depending upon what the exec application returns.


- rmudgett


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


On 2011-04-14 17:09:15, rmudgett wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1183/
> -----------------------------------------------------------
> 
> (Updated 2011-04-14 17:09:15)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> The AsyncAGI command loop is lax in the value it returns for the return status.
> 
> This patch does the following:
> 
> * Return correct status: SUCCESS/FAILED/HANGUP.  Previously, abnormal exits from the command loop such as hangup would return SUCCESS.
> 
> * The "asyncagi break" command now returns SUCCESS and is now the only way to break the command loop with that status.  Previously, it returned FAILED.
> 
> * The AMI event AsyncAGI End is no longer sent if the AsyncAGI Start event is not sent.  Previously, this happened because of an error setting up the AGI pipes.
> 
> * All executed AGI commands now get an AsyncAGI Exec result event.  Previously, if the command returned failure (because of hangup), the command loop just exited with FAILURE and did not send the AsyncAGI Exec result event.
> 
> * Makes sure that the channel frame queue is empty on hangup.
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/res/res_agi.c 313821 
> 
> Diff: https://reviewboard.asterisk.org/r/1183/diff
> 
> 
> Testing
> -------
> 
> Manually sent the following AGI commands from the CLI:
> wait for digit -1
> exec background tt-monkeys
> asyncagi break
> 
> Got the expected return values and bahaviour when executed or hungup while executed.
> 
> 
> Thanks,
> 
> rmudgett
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110418/e0224c7e/attachment.htm>


More information about the asterisk-dev mailing list