Can you attach the complete dial-peer configuration? Most probably you are trying to add the session target command to a pots dial-peer which is incorrect; the dial-peer must be a voip one.
That error is usually seen if you try to configure a VoIP dial-peer with a port and/or a POTS dial-peer with a session target.
Getting Started
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: