It completely depends on what VOIP environment do you have, if you have a Cisco VOIP (CUCM)environment then please find the flow below as per the given scenario:-
1) For outbound PSTN call from Cisco IP phone:- Cisco IP phone/DN->CUCM->H.323/MGCP/SIP Gateway->PSTN
2) For Inbound to Cisco IP phone from PSTN number:- PSTN->Telco/Mobile Operator->H.323/MGCP/SIP Gateway->CUCM->Cisco IP phone/DN
3) For Outbound IP phone to IP phone/VOIP call-> Cisco IP phone/DN-CUCM->Cisco IP phone/DN
4) For Inbound IP phone to IP phone/VOIP call-> Cisco IP phone/DN-CUCM->Cisco IP phone/DN
Above explained flows are just basic overview that how the calls flow in different scenarios however there are lots of technical stuffs involved behind these call flows.
I hope it helps you.
Regards
Yash pal