Pstn ->sip ------>sip -> pstn

I am new to asterisk
i need to dial from PSTN to local SIP , asterisk should auto attend it and prompt for number to be dialed, and after entering the number asterisk dialout that number from another SIP provider to PSTN, anyone have any idea how to do this ?

Have a look at this thread:

It doesn’t exactly answer your query, but you should be able to get a general idea of how to approach the problem.