Problem Record application - No Return

My script:

[code]; ============== Central de Recados em Ingles ============== ;
exten => ingles,1,noop(=== Recebimento de Recados em Ingles ===)
exten => ingles,n,agi(ivrLogSeteco.pl,${EXTEN},${UNIQUEID})
exten => ingles,n,playback(${Sound_Path}/RECADO_INGLES)
exten => ingles,n,Goto(via_record)
exten => ingles,n(via_record),set(FILENAME=${MONITOR_DIR}/recado_${CALLERIDNUM}-UNIQUEID_${UNIQUEID})
exten => ingles,n,Set(EmailTo=${ARG3})
exten => ingles,n,Set(ExecHangupAgi=Yes)
exten => ingles,n,record(${FILENAME}.wav,k)
exten => ingles,n,noop(Record Hangup)
exten => ingles,n,goto(h,1)

exten=> h,1,GotoIf($["${ExecHangupAgi}x" != “Yesx”]?desliga)
exten=> h,n,noop(Entrei no Hangup OK)
exten=> h,n,agi(Seteco-Notify.pl,${CALLERID(num)},${FILENAME},${EmailTo})
exten=> h,n(desliga),Hangup[/code]

When have Hang Up does not run the noop (Record Hangup OK).

But when I press # works ok.

Any idea?

What is the console output when you try this?

-- Executing [ingles@macro-aa-ura-client:1] NoOp("SIP/net-00001858", "=== Recebimento de Recados em Ingles ===") in new stack -- Executing [ingles@macro-aa-ura-client:2] AGI("SIP/net-00001858", "ivrLogclient.pl,ingles,1435327460.9453") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/ivrLogclient.pl -- <SIP/net-00001858>AGI Script ivrLogclient.pl completed, returning 0 -- Executing [ingles@macro-aa-ura-client:3] Playback("SIP/net-00001858", "ura/client/RECADO_INGLES") in new stack [Jun 26 11:04:28] DEBUG[3612]: format_wav.c:187 check_header: Skipping unknown block 'fact' -- <SIP/net-00001858> Playing 'ura/client/RECADO_INGLES.slin' (language 'en') -- Executing [ingles@macro-aa-ura-client:4] Set("SIP/net-00001858", "=yes") in new stack -- Executing [ingles@macro-aa-ura-client:5] Goto("SIP/net-00001858", "via_record") in new stack -- Goto (macro-aa-ura-client,ingles,6) -- Executing [ingles@macro-aa-ura-client:6] Set("SIP/net-00001858", "FILENAME=/home/monitor/gravacoes/recado_-UNIQUEID_1435327460.9453") in new stack -- Executing [ingles@macro-aa-ura-client:7] Set("SIP/net-00001858", "EmailTo=nicol.belo@gmail.com") in new stack -- Executing [ingles@macro-aa-ura-client:8] Set("SIP/net-00001858", "ExecHangupAgi=Yes") in new stack -- Executing [ingles@macro-aa-ura-client:9] Record("SIP/net-00001858", "/home/monitor/gravacoes/recado_-UNIQUEID_1435327460.9453.wav,,,k") in new stack -- <SIP/net-00001858> Playing 'beep.gsm' (language 'en')

I don’t see anything indicating the channel has been hung up. What is on the other side of the SIP connection?