Needs help with simple home PBX

I am setting up a PBX to allow us to receive and make called over a sip trunk and be able to call between extensions. I can get the trunk calling working fine. I have 4 extensions, 2 cisco 7940’s and 2 android soft phones. I do want to add more 7940’s in the future. I cant get the extension to extension calls to work. I also need to be able to transfer calls between extensions. And I have two incoming DID’s which should be routed to different extensions and multiple each.

I hope someone could help me with this or point me to some good tutorials. I need some graphical maps of how the dial plans work. I just can not wrap my head around it all