Skip to content

Instantly share code, notes, and snippets.

@ambiorixg12
Last active September 9, 2021 03:24
Show Gist options
  • Select an option

  • Save ambiorixg12/708a255b96b9c9e77949e913e53788d9 to your computer and use it in GitHub Desktop.

Select an option

Save ambiorixg12/708a255b96b9c9e77949e913e53788d9 to your computer and use it in GitHub Desktop.
survey
[au_survey]
exten=>_.,1,Answer()
same=>n(q1),read(q1,/var/lib/asterisk/sounds/en/Survey_recording_au,1)
;same => n,GotoIf($[${q1}<0]?q1)
same=>n,GotoIf($[$["${q1}"> "0"] & $["${q1}"<="5"]]?OK)
same=>n,goto(q1)
same=>n(OK),system(mysql --user=root --password='' test -e "INSERT INTO test.survey (surv_id, surv_value, surv_date, callerid,reserved1,reserved2) VALUES (NULL, '${q1}', CURRENT_TIMESTAMP, '${CALLERID(num)}', '', '')")
same=>n(continue),Playback(auth-thankyou)
same=>n,hangup()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment