Page 1 of 1

Survey Save DTMF to DB

PostPosted: Tue Nov 20, 2018 8:41 am
by garias
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

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

Re: Survey Save DTMF to DB

PostPosted: Tue Nov 20, 2018 1:02 pm
by Mequetref43
Hello,

if you want to save dtmf on a call menu got to activate from system settings in admin Menu.

Here is a post talking about viewtopic.php?f=2&t=38440&p=134144#p134144

Is what you are looking for?

Re: Survey Save DTMF to DB

PostPosted: Tue Nov 20, 2018 3:42 pm
by garias
Wow!! soo many years using Vicidial systems and never see that option, that will simplify my scripts!

the only question is if i can set the default table to save them ? meanwhile ill be working on it ASAP

Thanks for your reply!!!

Mequetref43 wrote:Hello,

if you want to save dtmf on a call menu got to activate from system settings in admin Menu.

Here is a post talking about http://www.vicidial.org/VICIDIALforum/v ... 44#p134144

Is what you are looking for?

Re: Survey Save DTMF to DB

PostPosted: Tue Nov 20, 2018 4:09 pm
by garias
other thing is that i only see that the log is not set to store a number chain like : 123456, it is only to store one key press or option, please correct me if im wrong

Re: Survey Save DTMF to DB

PostPosted: Tue Nov 20, 2018 4:55 pm
by thephaseusa
When you get a prompt that says enter your account number i believe multiple number entries works too.

Vicidial does everything now. Everything except close your sales and direct deposit your paycheck on friday. I wouldn’t be surprised if it will do those things too soon))

Re: Survey Save DTMF to DB

PostPosted: Tue Nov 20, 2018 5:08 pm
by garias
:lol: :lol: :lol: :lol: :lol:

i will test it tomorrow, so i will see how it works and where it stores in the db

thephaseusa wrote:When you get a prompt that says enter your account number i believe multiple number entries works too.

Vicidial does everything now. Everything except close your sales and direct deposit your paycheck on friday. I wouldn’t be surprised if it will do those things too soon))

Re: Survey Save DTMF to DB

PostPosted: Wed Nov 21, 2018 7:08 am
by Mequetref43
Glad to know, it help you

Re: Survey Save DTMF to DB

PostPosted: Wed Nov 21, 2018 5:10 pm
by garias
as i understood i was right, the log catches each entry separated, each key press generates a full row, this will not work for long interaction as a chain of numbers

Image

thephaseusa wrote:When you get a prompt that says enter your account number i believe multiple number entries works too.

Vicidial does everything now. Everything except close your sales and direct deposit your paycheck on friday. I wouldn’t be surprised if it will do those things too soon))