Hi, first time freepbx user so be easy.
I’ve got most configured to my liking. Thanks for the excellent work. However I can not figure out one last goal.
I’m looking for the following functionality:
Caller’s without CID (hidden or anonymous) are answered by a custom destination. Which triggers a macro. The macro prompts the caller the speak their name and press the # to try to connect them. After the caller’s name has been recorded. The ringgroup should be dialed. The first extension to pickup should hear the caller’s name recording followed by a press 1 to accept menu or hangup to goto voicemail. If the user presses 1 to original incoming call should be transfered to the extension.
What works:
Via a macro in extensions_custom.conf I can record the callers name to a temporary file and get that recording in a voicemail box. See snippet below.
What doesn’t work:
- How to dial an extension and present an IVR upon answer? (the reverse, freepbx answers and plays IVR works out the box)
- How to transfer the call when user presses 1 to accept. Should I park the call or can it be transferred?
Please note that this is not the same as the privacy manager application which ask the caller to enter digits. Many government bodies don’t have direct phonenumbers. So asking them to enter their number is pointless. But asking them for their name isn’t.
Thank you for looking into this.
[macro-questionanswer]
exten => s,1,answer()
exten => s,n,playback(/var/lib/asterisk/sounds/nl/custom/message356)
exten => s,n,Record(${UNIQUEID}.ulaw,3,15,a)
;Generate .call file that asterisk will use to send the call to a voicemail box
exten => s,n,system(echo "Channel: LOCAL/1000" > /var/lib/asterisk/sounds/recording.call)
exten => s,n,system(echo "Context: macro-questionanswer1" >> /var/lib/asterisk/sounds/recording.call)
exten => s,n,system(echo "Extension: s" >> /var/lib/asterisk/sounds/recording.call)
exten => s,n,system(echo "Setvar: playfile=${UNIQUEID}" >> /var/lib/asterisk/sounds/recording.call);
exten => s,n,system(cp /var/lib/asterisk/sounds/recording.call /var/spool/asterisk/outgoing/recording.call)
exten => s,n,hangup()
[macro-questionanswer1]
exten => s,1,wait(1)
exten => s,n,senddtmf(#)
exten => s,n,playback(/var/lib/asterisk/sounds/${playfile})