Quantcast
Channel: FreePBX Community Forums - Latest posts
Viewing all articles
Browse latest Browse all 226529

Looking to set up a Survey System

$
0
0

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 ^_^

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).


Viewing all articles
Browse latest Browse all 226529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>