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

rmudgett reviewboard at asterisk.org
Thu Apr 14 17:09:15 CDT 2011


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

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/20110414/cfb9c877/attachment.htm>


More information about the asterisk-dev mailing list