exten=>_991,1,Answer()
same=>n,Playback(/var/lib/asterisk/agi-bin/survey/welcomesurvey)
same=>n(q1),read(q1,/var/lib/asterisk/agi-bin/survey/pregunta1,1)
same => n,GotoIf($[${q1}>5]?q1)
same=>n(q2),read(q2,/var/lib/asterisk/agi-bin/survey/pregunta2,1)
same => n,GotoIf($[${q2}>5]?q2)
same=>n(q3),read(q3,/var/lib/asterisk/agi-bin/survey/pregunta3,1)
same => n,GotoIf($[${q3}>5]?q3)
same=>n,Playback(/var/lib/asterisk/agi-bin/survey/goodbyesurvey)
same=>n,system(mysql --user=root --password='1932' survey -e "INSERT INTO survey.results (q1,q2,q3,did) VALUES ('${q1}','${q2}','${q3}','${EXTEN}')")
database;
create database survey;
use survey;
CREATE TABLE IF NOT EXISTS `results` (
`res_id` int(11) NOT NULL AUTO_INCREMENT,
`q1` varchar(1) DEFAULT NULL,
`q2` varchar(1) DEFAULT NULL,
`q3` varchar(1) DEFAULT NULL,
`did` varchar(20) DEFAULT NULL,
`res_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`res_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;
No hay comentarios:
Publicar un comentario