[asterisk-dev] [Code Review] AGI script not being notified of call hangup.

rmudgett reviewboard at asterisk.org
Thu Apr 7 18:45:06 CDT 2011


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

Review request for Asterisk Developers and Russell Bryant.


Summary
-------

If the call that the dialplan started an AGI script for is hungup while
the AGI script is in the middle of a command then the AGI script is not
notified of the hangup.  There are many AGI Exec commands that this can
happen with.  The reported applications have been: Background, Wait, Read,
and Dial.  Also the AGI Get Data command.

I have restored the AGI script's ability to return the AGI_RESULT_HANGUP
value in run_agi().  It previously only could return AGI_RESULT_SUCCESS or
AGI_RESULT_FAILURE after the DeadAGI and AGI applications were merged.

Should the run_agi() give priority to AGI_RESULT_HANGUP code over the
AGI_RESULT_FAILURE code?  The consequence is that the AGI application will
return -1 with the AGI_RESULT_HANGUP code and 0 otherwise.

I have some cleanup changes in this patch as well that I will commit
separately.  The fix changes are in run_agi() and __ast_read().


This addresses bugs 17954, 18492 and 18935.
    https://issues.asterisk.org/view.php?id=17954
    https://issues.asterisk.org/view.php?id=18492
    https://issues.asterisk.org/view.php?id=18935


Diffs
-----

  /branches/1.8/main/channel.c 313097 
  /branches/1.8/res/res_agi.c 313097 

Diff: https://reviewboard.asterisk.org/r/1165/diff


Testing
-------

I have setup an AGI script to:
exec Background tt-monkeys
exec Dial SIP phone

The AGI script stops running when expected with the patch and proceeds to
dial the SIP phone without it.


Thanks,

rmudgett

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


More information about the asterisk-dev mailing list