Looking to set up a Survey System

I am looking to set up a survey system for my local government.

I Have looked around for a add on to freepbx but got no joy, so I am assuming I will have to do this manually.

I would like to use a number list provided by the parish to call people. If the person agrees to take the survey I need to record their responses and tally them up for all the numbers contacted.

So lets say we are going to call 100 people with the IVR below.

Asterisk will pick up a line and dial numbers on the SurveyDialout.list

This is a survey from you local community center. Please press 1 if you would like to take the survey.

We are looking to add a spray park behind one of the following community centers. Bayou vista, Berwick, Or Amelia. Please keep in mind your phone number may only vote once. Please listen carefully before making your choice.

If you would like the spray park installed in Bayou Vista Press 11
If you would like the spray park installed in Berwick Press 22
If you would like the spray park installed in Amelia press 33

Thank you for your vote. If you know any one else who would like to vote on this subject please tell them to call 985-300-xxxx. Please remember any given number will only be counted once for a vote.

once the survey is run i am looking for a output of…

100 callees processed
80 callees took the survey
50 callees vote for option 1
10 callees vote for option 2
20 calles vote for option 3

I would like to also break out the results by exchange numbers…

25 callees from 985-384-xxxx vote for option 1
25 callees from 985-395-xxxx vote for option 1
2 callees from 985-330-xxxx vote for option 2
8 callees from 985-330-xxxx vote for option 2
18 callees from 985-300-xxxx vote for option 3
2 callees form 985-518-xxxx vote for option 3

If the callee does not answer to take the survey I would like that number to be called again in 24 hours.

There is a few other things but this is enough to get the general idea…

I have never set up something like this in the custom dial plan, I am willing to pay some one for their time to put this together if need be…

Samuel Rock

Look This: http://www.pcbackup.it/asterisk-gui-chan_dongle-sms-call-file-with-timestamp/

This would be pretty easy for someone experienced in asterisk dialplan coding; basically you’d direct everything into a simple IVR that calls stored procedures in the database, passing the ANI and option where needed.

Once somebody hits the IVR, if they haven’t voted already, their ANI is recorded in the database with NULL set for their vote option - otherwise, it does nothing.

When they select an option, the IVR updates the DB where ANI = their ANI and sets the vote to the int pressed (this also means that people can “update” their votes if incorrectly cast the first time)

The data presentation could then be done via DB queries (You could, in fact, do it as a single query, this is two):

select count(*) as ‘Count’, ‘Total Calls’ as ‘Description’ from DB.table
UNION select count(*) as ‘Count’, ‘Total Votes’ as ‘Description’ from DB.table where table.option is not NULL
UNION select count(*) as ‘Count’, 'Option ’ + table.option as ‘Description’ from DB.table;

select count(*) as ‘Count’, LEFT(table.ANI,6) as ‘Exchange’, table.option from DB.table group by LEFT(table.ANI,6), 'Option ’ + table.option;

I could most likely do the coding but I’m not an expert…there’s probably a better way to do things than how I’d do it and I would take longer figuring it out as I go than someone that actually knows what they’re doing :slight_smile:

You’d might also want to try and prevent people with “wrong” area codes from voting as well as [MAYBE] something to prevent ANI spoofing (I could set my PBX to make my CID anything I want; somebody could vote multiple times and potentially override votes for other people in doing so…don’t know how to combat this though or if it’s a plausible threat in your use case).