User input a number

Hi everyone, i have a request that might be easy for some
we need a caller to call in, system will ask him to enter an ID number (could be any number we supply to him)
once he enter that number, we need to take this number and either email it to a specific email, or have it printed ? or have it as an output to a text file and have it saved or something along this line
i looked at a post that was talking about database lookup, but this is not that complex, we just need what ever the caller enter a number, have that number pulled out for us to process it
thanks in advance

This sounds like a good fit for a custom context that you’ll have to have somebody write up to get that functionality.

This might be a good starting point for you:

https://community.freepbx.org/t/hooking-for-fun-and-income/57718/25

example dialplan that accepts a 10 digit number and emails it… you need to adjust the prompts etc… note this is untested so may have bugs…

[email-code]
exten => s,1,NoOp(Entering email code)
    same => n,Set([email protected])
    same => n,Answer()
    same => n,Playback(custom/enter_number)
    same => n,WaitExten(10)
    same => n,Goto(s,check_number)

exten => _X.,1(check_number)
    same => n,NoOp(Checking entered number: ${EXTEN})
    same => n,Set(number=${EXTEN})
    same => n,GotoIf($[${LEN(${number})} = 10]?send_email:invalid_number)

exten => send_email,1
    same => n,NoOp(Sending email with the entered number)
    same => n,System(echo "Number: ${number}" | mail -s "Entered Number" ${EMAIL_ADDRESS})
    same => n,Hangup()

exten => invalid_number,1
    same => n,NoOp(Invalid number entered)
    same => n,Playback(custom/invalid_number)
    same => n,Goto(s,1)

2 Likes

thanks jfinstrom,
i have a beginner question, where would i put these codes ?
so someone calls in >> IVR >> eg: hit 2 to listen to a recorded message >> and take them to an extension ? or ?

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.