Is there a way to get the the mobile to connect to asterisk in such a way that calls to the mobile are routed to an asterisk server and outbound calls from server can be done through n900?
That's actually quite easy to do. The N900 has SIP client support built in. You can configure the SIP accounts through the 'Accounts' option at the top of the SMS messages app. (There's probably somewhere else to configure it to). It just needs number@host and a password to work. (in my case, it's 1003@192.168.254.254 for the account name, and then my N900 becomes extension 1003 on my phone system)
I've got the SIP connection stuff tied in with OpenVPN so that when the VPN connection comes up it reconfigures the SIP connection accordingly. There's a good thread which explains how to set this all up at http://talk.maemo.org/showthread.php?t=36098
Is there a way to get the the mobile to connect to asterisk in such a way that calls to the mobile are routed to an asterisk server and outbound calls from server can be done through n900?
Theoretically yes, using chan_mobile. Though it seems like a waste of a perfectly good N900 when any old cheap bluetooth handset would do the job just as well.