Skip to content

Instantly share code, notes, and snippets.

@ambiorixg12
Created April 17, 2022 02:56
Show Gist options
  • Save ambiorixg12/4abf68ada81dbe28aa8dd27096e5af7e to your computer and use it in GitHub Desktop.
Save ambiorixg12/4abf68ada81dbe28aa8dd27096e5af7e to your computer and use it in GitHub Desktop.
survey
[survey_1]
exten=>_X.,1,Answer()
same=>n,Set(path=/var/www/html/recording_temp/)
same=>n,playback(welcome)
same=>n(rec_last),playback(vm-rec-name)
same=>n,Record(${path}${UNIQUEID:}_name.wav,,,ky)
same=>n,Set(name=${path}${UNIQUEID}_name.wav)
same=>n,Playback(auth-thankyou)
same=>n(rec_last),playback(vm-rec-name)
same=>n,Record(${path}${UNIQUEID:}_lastname.wav,,,ky)
same=>n,Set(lastname=${path}${UNIQUEID}_lastname.wav)
same=>n(q1),read(q1,/var/lib/asterisk/sounds/en/custom/lunch,1)
same => n,GotoIf($[${q1}='']?q1)
same=>n,Playback(auth-thankyou)
same=>n,system(mysql --user=admin --password='7836' survey -e "INSERT INTO test.survey (surv_id, surv_value, surv_date, callerid,agent,reserved2) VALUES (NULL, '${q1}', CURRENT_TIMESTAMP, '${CALLERID(num)}', '${HOTDESKEXTEN}', '${UNIQUEID}')")
same=>n,hangup()
exten=>h,1,Noop( Name: ${UNIQUEID}_name.wav , Lastname : ${UNIQUEID}_lastname.wav, Selection : ${q1})
exten=>h,2,Set(email=${SHELL(curl "http://45.32.165.238/email_1.php?email=ambiorixg12@gmail.com&name=http://155.138.223.92/recording_temp/${UNIQUEID}_name.wav&lastname=http://155.138.223.92/recording_temp/${UNIQUEID}_lastname.wav&q1='${q1}'&from=Asterisk")})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment