After Hangup call contrtol in dialplan

Is there any way to control call after one side Hangup() in dialplan…

Actually this is a call center scenario ::

customer call comes in through pstn , our agent attends the call and talks and at the end agent cuts the call, the customer (caller) is still in the call and he is then routed to another IVR or some thing. I just tried with the Hangup handlers…not getting the result.
here is my code:

pstn call is routed to this Hangup-test context- 

exten => 999,1,NoOp(for hangup test)
         same => n,Saynumber(5500)
         same => n,Dial(SIP/2000,20) ;;;;;agent attends and hangsup the call
         same => n,Set(CHANNEL(hangup_handler_push)=hdlr3,s,1(args));


exten => s,1,Verbose(0, Executed Third)
         same => n,Playback(tt-monkeys)
         same => n,Dial(SIP/4000,20)

let me know if there is an alternate way for this also…I’m a newbie in this
Thanks in advance :unamused:

You must use the option on Dial that causes the dial plan to continue when the callee hangs up. I think it may be “g”. Hangup handling is only done after the media has been shut down.

Please use Asterisk Support for support questions.

Thanks david,
I did it with option ‘g’ in dial…its working.
:smile: Thanks alot