If I do :
same => n,agi(googletts.agi,"Statut de l'appel : "${DIALSTATUS},fr,any,1.5)
the TTS is saying the dialstatus variable. If it’s busy it says “BUSY” and if the number does not exist it says “CHANUNAVAIL”, so I guess the value returned by voip.ms is correct.
There is my new syntax I found from the official asterisk doc:
[all]
exten => _+.,1,Dial(PJSIP/${EXTEN}@voipms)
same => n,GotoIf($[ ${DIALSTATUS} = “BUSY”]?400)
same => n,GotoIf($[ ${DIALSTATUS} = “CHANUNAVAIL”]?500)
same => n,agi(googletts.agi,"Statut de l'appel : "${DIALSTATUS},fr,any,1.5)
exten => _+.,400,agi(googletts.agi,"Ligne occupée.",fr,any,1.5)
exten => _+.,500,agi(googletts.agi,"Le numéro n'est pas attribué.",fr,any,1.5)
And there is a part of log, we can see that the GotoIf is testing “0”, but why?
-- Executing [+xxxxxxxxxxx@Tout:1] Dial("PJSIP/1067-00000df4", "PJSIP/+xxxxxxxxxxx@voipms") in new stack
-- Called PJSIP/+xxxxxxxxxxxxx@voipms
== Everyone is busy/congested at this time (1:1/0/0)
-- Executing [+xxxxxxxxxxxxxxxx@Tout:2] GotoIf("PJSIP/1067-00000df4", "0?400") in new stack
-- Executing [+xxxxxxxxxx@Tout:3] GotoIf("PJSIP/1067-00000df4", "0?500") in new stack
-- Executing [+xxxxxxxxxxx@Tout:4] AGI("PJSIP/1067-00000df4", "googletts.agi,"Statut de l'appel : "BUSY,fr,any,1.5") in new stack
We can also see that GoogleAGI got the variable without problem, so it’s the syntax of my gotoif who’s not working