I have found lots of good information regarding this topic, but never found a definitive answer while searching.
After reading a bunch of posts then finally building the config by hand from info found in O'Reilly's "Asterisk the Future of Telephony" I thoguht that I would share my config to help others with this.
I am using Kamailio and asterisk to provide a SIP dial tone product to our internet service customers, so far it is working very well, the only problem I have now is getting the MWI to work, I do have a small java program that I am hacking together that is promising to work well for that, I will post about it when i finish... I digress
Asterisk Registering to a VSP(VoIP Service Provider) _OR_ sip proxy (SER, OpenSER, OpenSIP, Kamailio)
Vanilla Asterisk or FreeBPX Based(Vobis Voice Server, PBX in a Flash, Trixbox)
vanilla: under sip.conf in the "general" section add the following line, FreePBX: this is in your sip_general_custom.conf
register => NUMBER:[email protected]
vanilla: again in your sip.conf where you are provisioning sip peers, FreePBX: sip_custom.conf
NUMBER ;;; this should be in square brackets but I am having problems getting them to post
for vanilla asterisk users you can set your context to whatever you want here, it needs to correspond to context in your extensions.conf
for FreePBX you can set it to from-trunk and use Inbound route for DID NUMBER and it gives you full control over the call in FreePBX
good luck, it works like a champ for me YMMV