Hangup is not recognised by software application

Asterisk 1.4.21.2

I am running an application which can report a hangup but somehow it doesn’t recognise it.
I am dialling internally only from one extension to another and during the process I hang up but this is not carried through to the application.

I am not sure if this will help, but I can see the macro-hangupcall is being executed but I don’t see a hangup being passed to the application:

== Spawn extension (macro-dial, s, 7) exited non-zero on ‘SIP/6005-09190b08’ in macro ‘dial’
== Spawn extension (macro-dial, s, 7) exited non-zero on ‘SIP/6005-09190b08’ in macro ‘exten-vm’
== Spawn extension (macro-dial, s, 7) exited non-zero on ‘SIP/6005-09190b08’
– Executing [h@macro-dial:1] Macro(“SIP/6005-09190b08”, “hangupcall”) in new stack
– Executing [s@macro-hangupcall:1] GotoIf(“SIP/6005-09190b08”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [s@macro-hangupcall:3] GotoIf(“SIP/6005-09190b08”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,5)
– Executing [s@macro-hangupcall:5] GotoIf(“SIP/6005-09190b08”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,7)
– Executing [s@macro-hangupcall:7] Hangup(“SIP/6005-09190b08”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 7) exited non-zero on ‘SIP/6005-09190b08’ in macro ‘hangupcall’
== Spawn extension (macro-hangupcall, s, 7) exited non-zero on ‘SIP/6005-09190b08’

I may be barking up the wrong tree completely, but can anyone help me to get this to work?

TIA
Glyn