<div>You can put the Asterisk system in front (i.e., between the PSTN and your Comdial system). This will let Asterisk choose whether the call should go out over the PSTN or the Internet using VoIP.</div>
<div> </div>
<div>You would use the same for the second location, provided that is a complete Comdial system. You could not, however, just put Comdial phones over there and expect it to work. You also would not be "on the same phone system." But, if you are looking at tying two offices together using VoIP (and not paying long distance), then yes, this would work.
</div>
<div> </div>
<div>With the right dial plan, you could possibly dial direct if the Comdial has an autoattendant. In this case, Asterisk would dial into the remote Comdial, wait, then dial the extension number and complete the call. On the local COmdial, you would most problably have to dial a 9 to get to the Asterisk system. I imagine, you may be able to use speeddials for the remote extensions which would automatically dial the 9.
</div>
<div> </div>
<div>The possibilities are endless.</div>