[asterisk-users] AstDB & MixMonitor queries

Steve Edwards asterisk.org at sedwards.com
Mon Apr 20 14:38:16 CDT 2009


On Mon, 20 Apr 2009, ContactTel Business wrote:

> On Mon, 20 Apr 2009, Steve Edwards wrote:

>> I'm just finishing a system where for each "step" in my "recipe," there 
>> is a long prompt and a short prompt. The caller gets the long prompt 
>> the first time. After hearing their response (voice or DTMF) they get a 
>> chance to confirm. If they want to do over, they hear the short prompt.
>>
>> For this application, I have to record the prompt and their response. 
>> At the end of the call, all of the prompts and responses for all the 
>> steps are concatenated into a single WAV, encoded to WMA and uploaded 
>> to a web site for the client to review.
>>
>> All of the recipes and steps are stored in a MySQL database so I can 
>> add, subtract, and rearrange steps easily.

> Nice, and with a configuration file , you could pass to the agi, or 
> field names, you could even reuse the model for any type of survey.

One of the first steps in the dialplan calls an AGI (lookup-dnis) that 
reads the recipe and the steps from the database based on the DNIS (aka 
DID). The AGI sets a bunch (dozens) of channel variables like:

 	STEP-01-ACTIVE - YES or NO
 	STEP-01-DATA - any data needed by the step
 	STEP-01-MAX-LENGTH - maximum digits or seconds
 	STEP-01-MIN-LENGTH - minimum digits or seconds
 	STEP-01-PROMPT - path to the long prompt
 	STEP-01-RETRY-PROMPT - path to the short prompt
 	STEP-01-TYPE - AGENT-ID, DTMF, LANGUAGE, PHONE, PROMPT
 		, VARIABLE, VOICE.

The call is processed in a "while" loop in AEL by incrementing the index. 
Each type calls a different AGI to handle the specifics of that "data 
type."

I confess I'm pretty pleased how flexible this design worked out to be. 
The customer asked if I can add an SSN (social security number) data type 
-- piece of cake, just "wrap" DTMF with MAX-LENGTH and MIN-LENGTH forced 
to 9 before and set SSN=STEP-${IDX}-RESPONSE after.

Thanks in advance,
------------------------------------------------------------------------
Steve Edwards      sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                             Fax: +1-760-731-3000



More information about the asterisk-users mailing list