Survey Save DTMF to DB
Posted: Tue Nov 20, 2018 8:41 am
hello guys, im getting the need to request some help in this task
i need to do a dialplan entry to set multiple variables and save the DTMF input and at the end of the survey save all the variables to db, here is what im doing
in this entries, i followed an old setup i have done in the past, i make one CALL MENU for each entry/iteration, but the data is not being saved into the DB, i have run this same into a little Asterisk Server i got for testing and it works perfect, but i ported the entries for each vicidial CALL MENU and is not working.
any sugestions or advice ?
im using:
Vicibox ISO
VERSION: 2.14-588a
BUILD: 170211-1041
i need to do a dialplan entry to set multiple variables and save the DTMF input and at the end of the survey save all the variables to db, here is what im doing
in this entries, i followed an old setup i have done in the past, i make one CALL MENU for each entry/iteration, but the data is not being saved into the DB, i have run this same into a little Asterisk Server i got for testing and it works perfect, but i ported the entries for each vicidial CALL MENU and is not working.
any sugestions or advice ?
im using:
Vicibox ISO
VERSION: 2.14-588a
BUILD: 170211-1041
- Code: Select all
;;;;DIALPLAN TO MYSQL
[trans-id]
exten => s,1,Answer
exten => s,n,Set(INVCOUNT=0)
exten => s,n,Background(custom/trans-id)
exten => s,n,WaitExten(20)
; custom dialplan entries
exten => _XXXXXXXXXX.#,1,Set(trans-id=${EXTEN})
exten => _XXXXXXXXXX.#,n,Goto(zipcode,s,1)
[zipcode]
exten => s,1,Answer
exten => s,n,Set(INVCOUNT=0)
exten => s,n,Background(custom/zipcode)
exten => s,n,WaitExten(20)
; custom dialplan entries
exten => _XXXXX.#,1,Set(zipcode=${EXTEN})
exten => _XXXXX.#,n,Goto(lot-id,s,1)
[lot-id]
exten => s,1,Answer
exten => s,n,Set(INVCOUNT=0)
exten => s,n,Background(custom/lot-id)
exten => s,n,WaitExten(20)
; custom dialplan entries
exten => _XXXX.#,1,Set(lot-id=${EXTEN})
exten => _XXXX.#,n,Goto(agent-id,s,1)
[agent-id]
exten => s,1,Answer
exten => s,n,Set(INVCOUNT=0)
exten => s,n,Background(custom/agent-id)
exten => s,n,WaitExten(20)
; custom dialplan entries
exten => _XXXXXX.#,1,Set(agent-id=${EXTEN})
exten => _XXXXXX.#,n,Goto(wait,s,1)
[wait]
exten => s,1,Answer
exten => s,n,Set(INVCOUNT=0)
exten => s,n,Background(custom/wait)
exten => s,n,System(mysql -u DBUSER -pDBPASS -e "INSERT INTO requests.data (trans-id, zipcode, lot-id, agent-id) VALUES ('${trans-id}', '${zipcode}', '${lot-id}', '${agent-id}')")
exten => s,n,Goto(waitaudio,s,1)
[waitaudio]
exten => s,1,Answer
exten => s,n,Set(INVCOUNT=0)
exten => s,n,Background(custom/waitaudio)
exten => s,n,WaitExten(1)
exten => s,n,Goto(outro,s,1)
[outro]
exten => s,1,Answer
exten => s,n,Set(INVCOUNT=0)
exten => s,n,Background(custom/outro)
exten => s,n,WaitExten(1)
exten => t,n,Hangup()