Hello,
I am trying to use the mysql_app in the asterisk for which the dialplan is given below. The two bold statements are correct or not.
[globals]
DBCurrentHost=localhost
DBname=mtsdb
DBuser=root
DBpass=
[users]
exten=>6001,1,VoiceFun(1)
exten=>6001,n,Dial(SIP/test_phone_avishek,20)
exten=>6002,1,VoiceFun(4)
exten=>6002,n,MYSQL(Connect connid ${DBCurrentHost} ${DBuser} ${DBpass} ${DBname})
exten=>6002,n,Verbose(2,“Connection Id is ${connid}”)
exten=>6002,n,GotoIf($["${connid}" = “”]?error,1)
exten=>6002,n,MYSQL(Query resultid ${connid} SELECT contact_number FROM contacts_table)
exten=>6002,n(fetchrow),MYSQL(Fetch foundRow ${resultid} contact_number) ; fetch row
exten=>6002,n,GotoIf($["${foundRow}" = “1”]?done) ; leave loop if no row found
exten=>6002,n,NoOp(${contact_number})
exten=>6002,n,Goto(fetchrow) ; continue loop if row found
exten=>6002,n(done),MYSQL(Clear ${resultid})
exten=>6002,n,MYSQL(Disconnect ${connid})
exten=>error,1,NoOp(Connection error - do whatever we have to do to crash nicely!)
exten=>error,n,Hangup
;exten=>6002,1,Monitor(wav,/tmp/test)
exten=>6002,n,Dial(SIP/test_phone_demo,20)