My GotoIf call isn't working :( --nvm fixed

I’m not really sure why. It all looks good to me. This is my extension code:

exten => 2000,1,Answer
exten => 2000,n,Playback(custom/please_wait_for_assistant)
exten => 2000,n,AGI(KCS-callin1|param1|param2)
exten => 2000,n,Set(CALLERID(num)=${CALLERID(num)})
exten => 2000,n,Set(CALLERID(name)=Test Test)
exten => 2000,n,Dial(Local/7300, 30, rig)
exten => 2000,n,GotoIf($["{DIALSTATUS}" = “ANSWER”]?finished)
exten => 2000,n(failed),SayPhonetic(${DIALSTATUS})
exten => 2000,n(finished),Hangup

Basically, it calls a script, dials an extension, and then is supposed to jump to the “finished” label if the call was picked up properly, otherwise it continues and announces the status of the dial (e.g. BUSY, NOANSWER etc.).

The log file trace suggests that the script SHOULD be jumping to the “finished” label, but for some reason I still hear Asterisk say “alpha, november, sierra…” etc as it shouts out “ANSWER”.

-- Executing [[email protected]:11] Hangup("Local/[email protected],2", "")      in new stack

== Spawn extension (macro-hangupcall, s, 11) exited non-zero on ‘Local/[email protected] fault-3837,2’ in macro ‘hangupcall’
== Spawn h extension (macro-dial, h, 1) exited non-zero on ‘Local/[email protected] -3837,2’
== Spawn extension (macro-dial, s, 7) exited non-zero on ‘Local/[email protected] 837,2’ in macro ‘dial’
== Spawn extension (macro-exten-vm, s, 9) exited non-zero on ‘Local/[email protected] lt-3837,2’ in macro ‘exten-vm’
== Spawn extension (default, 7300, 1) exited non-zero on ‘Local/[email protected] 837,2’
– Executing [[email protected]:7] GotoIf(“SIP/7300-09a54720”, “0?finished” ) in new stack
– Executing [[email protected]:8] SayPhonetic(“SIP/7300-09a54720”, "ANSWER ") in new stack
– <SIP/7300-09a54720> Playing ‘phonetic/a_p’ (language ‘en’)
– <SIP/7300-09a54720> Playing ‘phonetic/n_p’ (language ‘en’)
– <SIP/7300-09a54720> Playing ‘phonetic/s_p’ (language ‘en’)
– <SIP/7300-09a54720> Playing ‘phonetic/w_p’ (language ‘en’)
– <SIP/7300-09a54720> Playing ‘phonetic/e_p’ (language ‘en’)
– <SIP/7300-09a54720> Playing ‘phonetic/r_p’ (language ‘en’)
– Executing [[email protected]:9] Hangup(“SIP/7300-09a54720”, “”) in new s tack

Oooh I figured it out.

exten => 2000,n,GotoIf($["{DIALSTATUS}" = “ANSWER”]?finished)

should be

exten => 2000,n,GotoIf($["${DIALSTATUS}" = “ANSWER”]?finished)

notice the missing dollar sign.

disregard this post, haha :slight_smile: