Dial plan for PABX


I try to get phone numbers send to my asterisk by a PABX digit by digit. I tried this way :

exten => s,1,NoOp(${TIMESTAMP})
exten => s,2,Set(TIMEOUT(digit)=2)
exten => s,3,ResponseTimeout,10

exten => _X,1,NoOp(${EXTEN})
exten => _X,2,SetVar(Predigits=${EXTEN})
exten => _X,3,Goto(s-gathermoredigits,1)

exten => s-gathermoredigits,1,NoOp(${TIMESTAMP})
exten => s-gathermoredigits,2,DigitTimeout,5
exten => s-gathermoredigits,3,WaitExten(4)

exten => _X.,1,NoOp(${TIMESTAMP})
exten => _X.,2,Dial(SIP/${EXTEN}@myasterisk)
exten => _X.,n,Hangup()[/quote]

But it doesn’t work. Any idea ?

Thx in advance…