Need callers to input a phone # them send this to a Voicemail


I need some help here. this is what i’m trying to accomplish:

when the client call they hit the IVR and the IVR will say “if you are having problem to call out please press 1” then when they press 1 i want to ask a customer to which number are they calling example: “please enter the 10 digit number that you are dialing” then after i gather that number i would like to send it to a extension that is not register (i will use it only for Voicemail) so the user will get the busy voicemail greeting and left another message finally that voicemail i will send it to an email.

this is what i was thinking, i was searching and found a code that i can use to ask for the number and make it the caller id then when the call hit the extension use for the voicemail i will get the email with the caller id of the number that the customer is having issue.

the code bellow, i add it to extensions_custom.conf and it is not working.

if someone has another way to do it would really appreciate it.


here the code:
exten => *199,1,DigitTimeout(10)
exten => *199,2,ResponseTimeout(5)
exten => *199,3,Read(Secret,please-enter-your,number,9)
exten => *199,6,Set(CALLERID(number)=${Secret})
exten => *199,8,Dial(SIP/101) ;Extension 101 is my Voicemail extension