Voicemail which asks questions

ollieonline
Posts: 2
Member Since:
2007-06-02

Hi

I would like to setup a voicemail type system to take messages as users answer a question. To explain a little better, a user could call and be played a greeting, such as welcome to the catalouge ordering line, then asked to leave their name after the tone, then the system records the callers name, next the system would prompt, please leave your address after the tone, and so on to capture all of the callers data. Does anyone know if this is possbile with trixbox or if there is an application I can add to my trixbox to make it happen :)

Thanks

PS. Sorry I'm being a little wordy im not sure of the proper term for what im asking for.



dickson
Posts: 1831
Member Since:
2006-06-02
Yes, you can do this, but

Yes, you can do this, but not 'out of the box' with the GUI. But asterisk has all the functions needed to build this.

It would take some programming of the dialplan, but its not really THAT complex to do.

If you aren't familiar with the coding process, i can put together some code for you in the next 24 hours.

Essentially you can use some built in dial-plan commands.

"PLAYBACK" or "BACKGROUND" which will play a sound file for you. The later will collect digits during the playing of the message.

"RECORD" allows you to activate the recording of the caller. So you can set the recording with some variables that allow you to determine when the callers stops speaking, and the way its saved. You can save the data with some unique information for the call (caller ID) and append some data to sort out the file. For example, the file might look like:
4092-b6e3de68.lastname.wav
4092-b6e3de68.firsname.wav
4092-b6e3de68.address.wav

And would appear in a directory. I THINK I can merge those into one continuous single .wav to. I'll rustle up some code and post it within 24 hours. (unless someone else has something, no sense re-inventing the wheel).

Do you want the system to collect any digits as well? Like PIN numbers, credit card, account, invoice numbers etc.?



ollieonline
Posts: 2
Member Since:
2007-06-02
Hi Thank you for posting

Hi

Thank you for posting back so fast. Some code would be wonderful. I'd quite like to be able to collect telephone numbers by the user typing the number on the keypad.

Thank you so much for your help.



dickson
Posts: 1831
Member Since:
2006-06-02
Here's some code, I've put

Here's some code, I've put some explanation for it, but if you have any questions on it, don't hesitate to post. The thing can do a lot more, but is a starting point to help you out.
You can get really fancy with these things, you could take the digits that are collected, fire it off to a database and do lookups really easily. If you knew some information about the customer, say through a PIN or CLID that they would provide, you could interact with Sugar or another database. Its really a sky the limit kind of deal.

DISCLAIMER
This is BETA code for testing/development purposes.

WHAT IT DOES
This code is used to collect information from callers. Either recording callers vocal responses and/or collecting digits entered on their phone number

Upon a caller entering the system, it uses the unique callID value for each call and uses that as a file name to store voices and callers digits that are collected.

The basic design will prompt the person with as many questions as you want, and will save the callers vocal responses into a single sound file. The appending allows you to listen to the entire file instead of having to load multiple responses from the same caller.

Additionally, there is a text file that is assigned with the same name that contains any DIGITS that the customer might have been requested to enter. This is stored in the accompanying file XXXXX.txt (same name as the sound file just different extensions)
Each answer is stored on a subsequent line.

ADJUSTMENTS
You can just copy/paste either of the two sections (S,5 & s,6 and/or s,50-s,54) to add more questions as you require.
Just increase the S,X values and in the Playback( X ) just substitute it with the file name of the questions that you have recorded.

Theoretically, its unlimited in the number of questions you can ask. Just depends on the patience of your caller!

APPEND DISABLE.
By default, the system appends each indvidual callers' multiple voice recordings into a single recording. You can change that by removing the "|a" in the Record command, and add a %d to the end of ${tempid}. %d is an auto value that increase by 1 for each response...prevents your multiple recordings from getting overwritten.

Record(/tmp/${tempid}:gsm|2|15|a) change to Record(/tmp/${tempid}%d:gsm|2|15)

STORED LOCATION CHANGE
location of stored files. Everything is saved in the /tmp/ folder at this moment, just change this path to store them in a different location.

DIGIT COLLECTION
You can change the max number of digits that a caller can enter. Right now its set to 30, change as desired.

INSTALLATION
Copy and paste everything below the ============= line into the bottom of /etc/asterisk/extensions_custom.conf
There are various ways you can access it, IVR or Ring group are two ways...use your imagination.
From an IVR, assign a numeric prompt and in the "CUSTOM" field, put in " custom-customer-survey,s,1 "
save the changes, click the red bar and test!
If you do use this in production, please don't forget to throw some credit for the code from the trixbox forum.

=========================================
[custom-customer-survey]

exten => s,1,NoOp(Customer Collection System)
exten => s,2,NoOp(&&& Unique id is: ${UNIQUEID})
exten => s,3,set(tempid=${CUT(UNIQUEID,.,1}) ;formats the uniqueid
exten => s,4,NoOp(&&& Unique id is: ${tempid})

exten => s,5,Playback(vm-rec-name) ; Question is played to caller
exten => s,6,Record(/tmp/${tempid}:gsm|2|15|a) ; Recorded response saved.

exten => s,7,Playback(say-temp-msg-prs-pound) ; QUESTION 2
exten => s,8,Record(/tmp/${tempid}:gsm|2|15|a)
;answer appended to the file.

exten => s,9,Goto(50)
; place holder. increase s,X for more room.

exten => s,50,NoOp(code for asking digit collection)
exten => s,51,playback(astcc-please-enter-your) ;message played to caller
exten => s,52,Playback(card-number) ;message played to caller
exten => s,53,Read(digitcollect||30) ;waits for caller to enter digits (max 30)
exten => s,54,system(echo "${digitcollect}" >> /tmp/${tempid}.txt)
;system writes digits to file.txt

exten => s,55,playback(astcc-please-enter-your)
;subsequent question. Just copy/paste and increase s,x

exten => s,56,Playback(card-number)
exten => s,57,Read(digitcollect||30)
exten => s,58,system(echo "${digitcollect}" >> /tmp/${tempid}.txt)



mvsystems
Posts: 1120
Member Since:
2006-06-05
dickson....you are the man!

dickson....you are the man! I have been looking for this as well, can't wait to test.

--

Tim Booth FtOCC
MaineVoIP Systems
VisionCom
Portland, Maine



dickson
Posts: 1831
Member Since:
2006-06-02
Thanks! Hope you can put it

Thanks! Hope you can put it to some use.
You can do some other things, like repeat each digit that the person presses as they press it. Or standard verifications "you have entered Seven-Two-Six-Four" ...if this is correct, press 1"
etc.
Tie it into a database and do lookups. "The part number Four Seven Six Eight you entered is in stock, Four in quantity" etc...

Let me know if there are any mods you are looking for, i'll see what I can come up with.



markwho
Posts: 675
Member Since:
2006-09-24
Thanks for the code

Thanks for the code. This is something we've been wanting to add to our trixbox systems.

In our NEC systems we service, they call this an Interview box, and it's used extensively by our customers who are currently on NEC systems.

Thanks, again.

Mark



dickson
Posts: 1831
Member Since:
2006-06-02
Here's some additional code

Here's some additional code hack.
Put this in the same way you put in the previous code.
When you execute this code, you can enter in the numeric value that the file is stored as and it will play it back. Useful for testing.

[custom-customer-survey-playback]
exten => s,1,NoOp(Playback of customer survey)
exten => s,2,playback(astcc-please-enter-your)
exten => s,3,Playback(astcc-digit-account-number)
exten => s,4,Read(playbacknumber)
exten => s,5,Playback(/tmp/${playbacknumber})
exten => s,6,Goto(s,1)



brogers77
Posts: 4
Member Since:
2006-12-13
Sending the wav files to email

This is perfect. How could I direct the files to an email address?



jjvx546
Posts: 1
Member Since:
2010-07-13
Database and lookups

Hello dickson

In this example that you mention above..¿ how you make database connection and lookup for the account number in order to obtain the balance? for example

thanks

james



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.