hi,
I hope someone can help me:-)
we’ve got a freepbx server. there are 2 special extensions (2001, 2002). if someone call this extensions (or a call is forwarded to these extensions) and these extension hangup (not the caller party), then we’d like to put the calls back into a queue (1000) and wouldn’t like to hangup.
I read your description about hangup hooks:
but still not able to implement it:-(
what I’ve done:
- found out in a hard way how to detect the current destination extension (because it’s turn out that CALLERID(dnid) is not working in case of forwarded call it’s show the original destination)
- write a macro-dialout-one-predial-hook and a hook marco like this:
[macro-dialout-one-predial-hook]
exten => s,1,Noop(Entering user defined context macro-dialout-one-predial-hook in extensions_custom.conf)
exten => s,n,GotoIf($[“${DEXTEN}”=“2001”]?special)
exten => s,n,GotoIf($[“${DEXTEN}”=“2002”]?special)
exten => s,n,MacroExit
exten => s,n(special),NoOp(--------------- Push Special Hangup Handler ------------------)
exten => s,n,Set(CHANNEL(hangup_handler_push)=back-to-1000-hangup,s,1)
exten => s,n,MacroExit
[back-to-1000-hangup]
exten => s,1,Noop(====== Entering user defined context back-to-1000-hangup =======)
;exten => s,n,Gosub(ext-intercom,*801000,1())
exten => s,n,Queue(1000)
;exten => s,n,Hangup
;exten => s,n,MacroExit
exten => s,n,Return
it seem to be called and seem to enter into to call but immediately hangup.
first of all in this case when in the hangup handler I will NOT like to hangup how should I finish the marco?:
Hangup
Return
MacroExit
how to redirect the call to the queue?:
Queue(1000)
Gosub(ext-intercom,*801000,1())
dial-one,HhTtrM(auto-blkvm),1000
and what is the reason I can’t put the call back to the queue?
thank you for your help in advance.
regards.