Unable to execute deadagi after hangup

i want to execute deadagi after the call gets hangup but unable to do so. My extensions.conf is as


exten => 100,1,Macro(DialFunction,${EXTEN})
exten => 101,1,Macro(DialFunction,${EXTEN})
exten => 500,1,VoiceMailMain(@internal)
exten => 600,1,MeetMe(600,1,54321)
exten => t,1,Hangup()
exten => h,1,deadagi(update-balance)

exten => s,1,Answer()
exten => s,n,Set(call-limit=1000)
exten => s,n,agi(check-pre-balance) ;sets the call-limit
exten => s,n,Dial(SIP/${ARG1},5,rL(${call-limit}:call-limit-15000))
exten => s,n,VoiceMail(u${ARG1}@internal)
exten => s,n,Hangup()
exten => s,102,Playback(tt-allbusy)
exten => s,n,VoiceMail(b${ARG1}@internal)
exten => s,n,Hangup()

But when i see the console, it shows me the following output

– Executing Macro(“SIP/101-0818d090”, “DialFunction|100”) in new stack
– Executing Answer(“SIP/101-0818d090”, “”) in new stack
– Executing Set(“SIP/101-0818d090”, “call-limit=1000”) in new stack
– Executing AGI(“SIP/101-0818d090”, “check-pre-balance”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/check-pre-balance
AGI Tx >> agi_request: check-pre-balance
AGI Tx >> agi_channel: SIP/101-0818d090
AGI Tx >> agi_language: en
AGI Tx >> agi_type: SIP
AGI Tx >> agi_uniqueid: 1175233081.0
AGI Tx >> agi_callerid: 101
AGI Tx >> agi_calleridname: Arif Asim
AGI Tx >> agi_callingpres: 0
AGI Tx >> agi_callingani2: 0
AGI Tx >> agi_callington: 0
AGI Tx >> agi_callingtns: 0
AGI Tx >> agi_dnid: 100
AGI Tx >> agi_rdnis: unknown
AGI Tx >> agi_context: macro-DialFunction
AGI Tx >> agi_extension: s
AGI Tx >> agi_priority: 4
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode: 0
AGI Tx >> *CLI>
Mar 30 10:38:02 NOTICE[2018]: chan_sip.c:10007 handle_response_peerpoke: Peer ‘101’ is now REACHABLE! (1ms / 2000ms)
AGI Rx << SET VARIABLE call-limit 45000
AGI Tx >> 200 result=1
– AGI Script check-pre-balance completed, returning 0
– Executing Dial(“SIP/101-0818d090”, “SIP/100|5|rL(45000:call-limit-15000)”) in new stack
– Called 100
– SIP/100-081926f8 is ringing
– SIP/100-081926f8 answered SIP/101-0818d090
– Attempting native bridge of SIP/101-0818d090 and SIP/100-081926f8
== Spawn extension (macro-DialFunction, s, 5) exited non-zero on ‘SIP/101-0818d090’ in macro ‘DialFunction’
== Spawn extension (macro-DialFunction, s, 5) exited non-zero on ‘SIP/101-0818d090’

It’s not executing this command
exten => h,1,deadagi(update-balance)

I’m using Asterisk 1.2.16

Any idea???
:bulb: :unamused:

I have not played with deadagi. As a general troubleshooting method, though, I would consider
a. moving all dial plan logic into main context for testing, or
b. setting up h extension in the macro

This is because I suspect that this is one of the queernesses of macro. Quite a few feature-bugs are not documented.

Actually you must define this extension: exten => h,1,deadagi(update-balance) in any context, with the h extension there is no inheritance policy, you must define the h extension in every context