Summary:ASTERISK-13428: ExternalIVR sending 'I' on hangup despite 'i' option not set.
Reporter:Chris Maciejewski (chris-mac)Labels:
Date Opened:2009-01-22 05:30:09.000-0600Date Closed:2009-02-09 11:52:07.000-0600
Versions:Frequency of
Description:According to doc/externalivr.txt when no additional options are set, ExternalIVR application should send 'H' event on channel hangup. However it sends 'I' event instead.

How to reproduce:

-- extensions.conf ----------------
exten => _X.,1,Answer()
exten => _X.,n,ExternalIVR(/tmp/test.sh) ; <- no 'i' option set
exten => _X.,n,Hangup()

-- /tmp/test.sh -------------------
echo "S,/var/lib/asterisk/sounds/demo-congrats"
while true; do
 read stdin
 echo $stdin >> /tmp/ivr-test.log

 if [ "${stdin:0:1}" = "H" ]; then

 if [ "${stdin:0:1}" = "I" ]; then
   echo "H,Bye"


Dial into IVR and console will show output similar to:
---- console -------------------
   -- Executing [123@test:1] Answer("SIP/<ip-address>-0838d650", "") in new stack
   -- Executing [123@test:2] ExternalIVR("SIP/<ip-address>-0838d650", "/tmp/test.sh") in new stack
[Jan 22 11:21:46] WARNING[10979]: app_externalivr.c:406 app_exec: SIP/<ip-address>-0838d650: Answering channel and starting generator
[Jan 22 11:21:49] NOTICE[10979]: app_externalivr.c:580 eivr_comm: SIP/<ip-address>-0838d650: Got check_hangup, but ignore_hangup set so sending 'I' command
[Jan 22 11:21:49] WARNING[10979]: app_externalivr.c:768 eivr_comm: SIP/<ip-address>-0838d650: Child process went away
 == Spawn extension (test, 123, 2) exited non-zero on 'SIP/<ip-address>-0838d650'
   -- Executing [h@test:1] Hangup("SIP/<ip-address>-0838d650", "") in new stack
 == Spawn extension (test, h, 1) exited non-zero on 'SIP/<ip-address>-0838d650'

Problem 1: "Got check_hangup, but ignore_hangup set so sending 'I' command":
------- ivr-test.log ------

Problem 2: "WARNING[10979]: app_externalivr.c:406 app_exec: SIP/<ip-address>-0838d650: Answering channel and starting generator"

Comments:By: David Vossel (dvossel) 2009-01-23 11:17:07.000-0600

chris-mac:  I saw some interesting things happen in trunk rev 170046.  I wasn't able to reproduce your results, but i did have trouble it not terminating the call correctly.  after updating trunk to rev 170458 i was not able to reproduce problems.  

rev 170458 results:


   -- Executing [6007@local:1] Answer("SIP/polycom-01c21d78", "") in new stack
   -- Executing [6007@local:2] ExternalIVR("SIP/polycom-01c21d78", "/usr/src/tests/ivr_i.sh") in new stack
[Jan 23 10:52:30] WARNING[7674]: app_externalivr.c:406 app_exec: SIP/polycom-01c21d78: Answering channel and starting generator
[Jan 23 10:52:41] NOTICE[7674]: app_externalivr.c:584 eivr_comm: SIP/polycom-01c21d78: Got check_hangup
 == Spawn extension (local, 6007, 2) exited non-zero on 'SIP/polycom-01c21d78'
      > Saved useragent "PolycomSoundPointIP-SPIP_430-UA/" for peer 6001

By: David Vossel (dvossel) 2009-02-09 11:52:06.000-0600

Updating to trunk rev 174325 or above should fix this issue.