LEN function in custom destination

This is not evaluating the input right. It sees six digits and reports it back with the Noop but goes straight to the next line “exten => s,n,Noop(Not 6 digits)” and does the hangup.

I think I have a syntax issue but I’ve never used LEN or Read before.

Does anyone see the error in my ways?

[custom-digits]
exten => s,1,Wait(1)
exten => s,n,Read(custno,kentucky,0,3,10)
exten => s,n,Gotoif($["${LEN(${custno})}" = “6”]?s,20
exten => s,n,Noop(Not 6 digits)
exten => s,n,Hangup()
exten => s,20,Noop(6 digits entered, forwarding to techs)
exten => s,n,Dial(SIP/6005)

Asterisk 1.6.2.15
Dahdi 2.4.0
Ubuntu 10.4.1.LTS

Background: We are trying to screen out “after hours” tech support callers who are using a demo and don’t have a paid license number/account.

They hit an IVR and go to this custom destination. If their number is 6 digits long they get access to the “after hours tech support q” which buzzes all the techs in Round Robin.

Demo people don’t know the length or format of the customer number.

Someday I would like to validate against a mysql table but for now this is the quick and dirty.

CLI Output:

See “NOT 6 digits” near the bottom. It does the same if I enter 7 or 8 digits.

– Goto (ivr-2,s,1)
– Executing [[email protected]:1] Set(“SIP/66.193.176.35-0000000d”, “MSG=custom/pmatrix-ivr”) in new stack
– Executing [[email protected]:2] Set(“SIP/66.193.176.35-0000000d”, “LOOPCOUNT=0”) in new stack
– Executing [[email protected]:3] Set(“SIP/66.193.176.35-0000000d”, “__DIR-CONTEXT=”) in new stack
– Executing [[email protected]:4] Set(“SIP/66.193.176.35-0000000d”, “_IVR_CONTEXT_ivr-2=”) in new stack
– Executing [[email protected]:5] Set(“SIP/66.193.176.35-0000000d”, “_IVR_CONTEXT=ivr-2”) in new stack
– Executing [[email protected]:6] GotoIf(“SIP/66.193.176.35-0000000d”, “0?begin”) in new stack
– Executing [[email protected]:7] Answer(“SIP/66.193.176.35-0000000d”, “”) in new stack
– Executing [[email protected]:8] Wait(“SIP/66.193.176.35-0000000d”, “1”) in new stack
– Executing [[email protected]:9] Set(“SIP/66.193.176.35-0000000d”, “TIMEOUT(digit)=3”) in new stack
– Digit timeout set to 3.000
– Executing [[email protected]:10] Set(“SIP/66.193.176.35-0000000d”, “TIMEOUT(response)=10”) in new stack
– Response timeout set to 10.000
– Executing [[email protected]:11] Set(“SIP/66.193.176.35-0000000d”, “__IVR_RETVM=”) in new stack
– Executing [[email protected]:12] ExecIf(“SIP/66.193.176.35-0000000d”, “1?Background(custom/pmatrix-ivr)”) in new stack
– <SIP/66.193.176.35-0000000d> Playing ‘custom/pmatrix-ivr.slin’ (language ‘en’)
– Executing [[email protected]:1] NoOp(“SIP/66.193.176.35-0000000d”, "Deleting: ") in new stack
– Executing [[email protected]:2] Set(“SIP/66.193.176.35-0000000d”, “__NODEST=”) in new stack
– Executing [[email protected]:3] Goto(“SIP/66.193.176.35-0000000d”, “custom-digits,s,1”) in new stack
– Goto (custom-digits,s,1)
– Executing [[email protected]:1] Wait(“SIP/66.193.176.35-0000000d”, “1”) in new stack
– Executing [[email protected]:2] Read(“SIP/66.193.176.35-0000000d”, “custno,kentucky,0,3,10”) in new stack
– <SIP/66.193.176.35-0000000d> Playing ‘kentucky.gsm’ (language ‘en’)
– User entered ‘123456’
– Executing [[email protected]:3] GotoIf(“SIP/66.193.176.35-0000000d”, “0”) in new stack
– Executing [[email protected]:4] NoOp(“SIP/66.193.176.35-0000000d”, “Not 6 digits”) in new stack
– Executing [[email protected]:5] Hangup(“SIP/66.193.176.35-0000000d”, “”) in new stack

exten => s,n,Gotoif($["${LEN(${custno})}" = “6”]?s,20

Where is the last )?

That did it.