I don’t do anything EXACTLY like this, but I think I know what’s going on.
I think asterisk is falling off the end of the extension and just exiting. This is the behavior you get with the (new in 1.2) default setting of autofallthrough
(From the sample extensions.conf that comes with a new 1.2 installation):
; If autofallthrough is set, then if an extension runs out of
; things to do, it will terminate the call with BUSY, CONGESTION
; or HANGUP depending on Asterisk's best guess (strongly recommended).
; If autofallthrough is not set, then if an extension runs out of
; things to do, asterisk will wait for a new extension to be dialed
; (this is the original behavior of Asterisk 1.0 and earlier).
So… you could try setting autofallthrough=no (I think this will cause asterisk to just sit and wait for another extension to be dialed (and of course your context will need to handle whatever extension they dial, as well as handling timeouts and invalids… ask if you need help on any of that)).
An alternative is to use background to playback silence while you’re waiting for digits. Say your greeting takes 5 seconds. You want to leave room for another 5 seconds for the caller to enter an extension. You could add
exten => 40,n,Background(silence/5)
right after your Background(greeting) line.