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:

forums.digium.com/viewtopic.php?t=920&highlight=

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