PSTN = Public Switched Telephone Network – in other words, the phone company (ies).
IP Addresses are in a completely different “space”.
I’m going to guess that you’re asking about a DSL Gateway/Router, or a Dial-Up Modem.
If that’s the case, the answer is twofold:
Dial-Up uses the PSTN to connect two systems which then negotiate, and the dialed up system then assigns an IP address to the caller for the duration of the connection.
DSL is a separate signal “riding” on the regular phone line which is separated from the phone system (PSTN) at the local switching office. This is one of the reasons for the filters that you put on all the phones EXCEPT the one that goes to the DSL modem. The signal is irritating to listen to and interferes with voice and fax data, and at the switching office does NOT pass through into the rest of the PSTN.
Does this answer your question?