Help please, dumb DID problem with incoming sip calls

I have a problem where my asterisk/freepbx setup is responding ‘401 Unauthorized’ to an incoming call from Sipgate.

Watching what happens with tcpdump, it sees the request:

INVITE sip:[email protected] (correct external ip as in sip_nat.conf)

and responds

SIP/2.0 401 Unauthorized

Sipgate sees my system as registered and it attempts to route the call to me.
The register string is:
9768224:[email protected]/9768224

I have a DID set up for 9768224 routing to a ringroup.

I’m using FreePBX 2.4 fully updated and (currently) Asterisk 1.6 beta 9 on Centos 5.

This used to work, it stopped some time ago - I can’t remember now exactly when this was relative to various software updates…

Also, what’s the correct context for the trunk setup? On similar setups I’ve seen both from-trunk & ext-did.

OK, this is an Asterisk 1.6 problem.

I swapped back to 1.4.21 and incoming calls work again.