[resolved] Question about automatic licensing

Dear FreePBX folks.

First of all, thank you for your excellent software!
I have played with FreePBX for the past three days at work for evaluation purposes since we need to replace our 20 year old phone system.

Now, I figured out the basics, and played with IVR, Queues, agent login/logoff, etc.

  1. My boss asked me now if it was possible to automate call-in licensing that way.

Essentially, someone calls in and gives us a code. We then check a database and if they paid, we give them a license key valid for some time. This takes up way too much time.

Of course, the database part can be programmed with a UNIX tool on our side.

So my question is whether I can create an interactive IVR with FreePBX that does this, and if so, maybe you could point me into the right direction:
-“Please enter your license request without dashes”
-User enters (for example): 471EJ21KAFP
-“Thank you, please enter your contract number”
-User enters (for example): L548168
-“Let me look that up”
-Data is somehow passed to an external tool we write (cmdline)
-Tool now comes back with an OK status, a key, and valid date:
-OR: Tools returns false, no payment received (or DB error, etc)
-System says “I’m sorry, we haven’t received payment yet”
-OR “Sorry, system unavailable, let me transfer you to an agent, etc…”
-essentially a different outcome/route/voice/announcement based on the return code of the external tool

-Phone system says “You’ve been licensed successfully, here’s the key”
-“F E five three …”
-“The license is valid until November 20th 2014”
-“Press one to repeat this or hang up”

  1. Would it be possible to use voice recognition instead of “press one”. I.e. "Press one or say “yes” "

Thank you for all your help in advance!

Yes to everything. I would pick up a copy of Jarred book Asterisk, the definitive guide. It is the best programming reference.

Roll up your sleeves and give it a try. When you get stuck come back and ask questions.

Welcome to FreePBX

Thanks for your pointer!

I have read some in the book online on Oreilly, and found that maybe a dialplan/extension like this should work. What do you think? Is that the way to go about it?

exten => 100,1,Answer()
same => n,Playback(custom/enter-your-contractnumber)
same => n,WaitExten(5,)
same => n,SayDigits(${EXTEN:1}) // Somehow call external program with $EXTEN (which is the contract #)
// more stuff

same => n,Hangup()

Yep, that’s dial plan code.

The speech recognition is from a company called Lumenvox.


I will check that once I have a normal key driven option working.
So the test dialplan should in theory do what I want it to?
I.e. Ask for a contract number, wait for you to enter it, and then say it?

Or would I have to replace this:
same => n,SayDigits(${EXTEN:1})

with this:
same => i,SayDigits(${EXTEN:1})

It’d be nice to have the option to have a # at the end of the contract number, I don’t yet how that would be possible?

Additionally, shouldn’t such an extension go into the custom file?
Would that be backed up then?

The syntax is connect, the logic is incomplete.

Thank you much for your help!
I’ve decided to use AGI with PHP and found an API that makes it a little easier too, and with that have set up a custom extension in Misc Destinations that does what I want to (I have a proof-of-concept that verifies number1 % number2, but the actual logic is just details).

The point is it works!
Thank you for your help!