Mauro Zanin
2005-Nov-11 09:05 UTC
[Asterisk-Users] Comand Read issue (Asterisk rel. 1.0.9)
Hi everybody, I have this issue: one particular Read command seems not work and return an empty string immediatelly. This is CLI output(partial)... -- Goto (ask_aster,s,1) -- Executing Read("SIP/2000-0b6d", "aster|asterisco|2|skip") in new stack -- Accepting a maximum of 2 digits. -- Playing 'asterisco' (language 'en') -- User entered '**' -- Executing GotoIf("SIP/2000-0b6d", "1?ask_service|s|1") in new stack -- Goto (ask_service,s,1) -- Executing SetVar("SIP/2000-0b6d", "aster=""") in new stack -- Executing Read("SIP/2000-0b6d", "aster|menu|1|skip") in new stack -- Accepting a maximum of 1 digits. -- Playing 'menu' (language 'en') -- User entered '1' -- Executing SetVar("SIP/2000-0b6d", "try=3") in new stack -- Executing Wait("SIP/2000-0b6d", ".5") in new stack -- Executing GotoIf("SIP/2000-0b6d", "1?ask_codice|s|1") in new stack -- Goto (ask_codice,s,1) -- Executing Wait("SIP/2000-0b6d", ".5") in new stack -- Executing Read("SIP/2000-0b6d", "codicez|codice|1|skip") in new stack -- Accepting a maximum of 1 digits. -- Playing 'codice' (language 'en') -- User entered ' Extensions file: [general] static=yes writeprotect=yes [home] exten => 2000,1,Answer exten => 2000,2,Goto(start-con,s,1) [start-con] exten => s,1,DigitTimeout(6) exten => s,2,ResponseTimeout(6) exten => s,3,Goto(start-connect,s,1) [start-connect] exten => s,1,Answer exten => s,2,Wait(2) exten => s,3,Playback(benvenuto) exten => s,4,SetVar(try=3) exten => s,5,Goto(ask_aster,s,1) [ask_aster] exten => s,1,Read(aster,asterisco,2,skip) exten => s,2,GotoIf($["${aster}" = "**"]?ask_service,s,1) exten => s,3,SetVar(try=${try}-1) exten => s,4,GotoIf($[${try} = 0]?ask_aster,s,1:numero_verde,s,1) [ask_service] exten => s,1,SetVar(aster="") exten => s,2,Read(aster,menu,1,skip) exten => s,3,SetVar(try=3) exten => s,4,Wait(.5) exten => s,5,GotoIf($["${aster}" = "1"]?ask_codice,s,1) ; this is last branch to failing instruction .................................................... exten => s,6,GotoIf($["${aster}" = "2"]?numero_verde,s,1:ask_service,s,1) [numero_verde] exten => s,1,Dial(zap/g1/800366466,20) exten => s,2,Goto(verde_occupato) exten => s,102,Goto(verde_occupato) [verde_occupato] exten => s,1,Playback(grazie) exten => s,2,Hangup [ask_codice] exten => s,1,Wait(.5) exten => s,2,Read(codicez,codice,1,skip) ; this is the failing instruction ........................................................................... ................... exten => s,3,MYSQL(Connect connection localhost mydb user telelettura) exten => s,4,MYSQL(Query resultid ${connection} Select\ lettura_precedente\,lettura_corrente\ from\ lettura_contatori\ where\ codiceutente=${codicez}) exten => s,5,MYSQL(Fetch fetchid ${resultid} precedente corrente) exten => s,6,MYSQL(Clear ${resultid}) exten => s,7,MYSQL(Disconnect ${connection}) exten => s,8,GotoIf($["${resultid}" = "1"]?controlla_date,s,1) ; se trovato va a controllo data exten => s,9,SetVar(try=${try}-1) exten => s,10,GotoIf($[${try} = 0]?chiama_operatore,s,1:ask_codice,s,1) ; chiede dell'operatore Thank you for help... Ciao Mauro