How to check nr of digits in WaitExten()

In my dialpan, if you call 3000 it should give a voice message "please enter a four digit extension nr…"
My question is, is there a way to count the nr of digits entered while in WaitExten(5) AND start calling the extension nr as soon as the four digit nr is entered without waiting for timeout?

[code][sip-extension]
exten => 3000,1,Goto(submenu,1)

exten => submenu,1,NoOp()
same => n,Answer()
same => n,Background(enter-extension-nr)
same => n,WaitExten(5)
exten => 2101,1,Dial(SIP/${EXTEN},10,mtT)
same => n,hangup()
exten => 2101,1,Dial(SIP/${EXTEN},10,mtT)
same => n,hangup()[/code]

Run it in a context in which all the numbers are four digit or all the relevant four digit numbers are of the form “_1234!”.