I’m trying to implement “callback on busy” in my dialplan and I’d like to have an IVR to interactively choice ‘5’ to be recalled when destination hangups or ‘9’ to leave a message in voicemail.
Actually, I have this macro in my dialplan (only derived from Trixbox but I can freely edit it) to call a local extension:
[macro-exten-vm]
exten => s,1,Macro(user-callerid)
exten => s,n,Set(FROMCONTEXT=exten-vm)
exten => s,n,SetCDRUserField(to-internal)
exten => s,n,Macro(dial,${RINGTIMER},${DIAL_OPTIONS},${ARG2})
exten => s,n,GotoIf($["${CHANNEL:0:5}" = “Local”]?s-${DIALSTATUS},1) ; if the channel is Local, then
do not go to voicemail. This is primarily to avoid vm for call-forwarded extensions in ring groups
exten => s,n,GotoIf($["${ARG1}" = “novm”]?s-${DIALSTATUS},1) ; no voicemail in use for this e
xtension
exten => s,n,NoOp(Sending to Voicemail box ${ARG2})
exten => s,n,GotoIf($["${DIALSTATUS}" != “BUSY”]?NOCB)
exten => s,n,GotoIf($["${MACRO_CONTEXT}" != “from-internal”]?NOCB)
exten => s,n,Set(DB(CallBack/${ARG2})=${CALLERIDNUM})
exten => s,n(NOCB),Macro(vm,${ARG1},${DIALSTATUS})
exten => s-BUSY,1,NoOp(Extension is reporting BUSY and has no Voicemail)
exten => s-BUSY,n,GotoIf($["${MACRO_CONTEXT}" != “from-internal”]?NOCB)
exten => s-BUSY,n,Set(DB(CallBack/${ARG2})=${CALLERIDNUM})
exten => s-BUSY,n(NOCB),Busy(20)
exten => _s-.,1,Macro(outisbusy)
Here I simply set an ASTDB record but I’d like to have an IVR as described.
Can I have an IVR in a macro? Can someone give me some good suggestion?
Thanks