I don't know if this help you, but I try.
I have a similar scenario. I have openser, which deals with sip
registers. If a sip phone make a call, I send the request to asterisk.
Asterisk dispatch to PSTN or go back to openser (if this call is for
sip). Asterisk deal the dialplan and cdr-csv and it's a gateway to PSTN.
This is an idea.
If you want i can post the config files.
Bye.
--
--------------------------------
David Castro Mosquera
Adianta
Tel: (34) 902 999 178
Fax: (34) 902 501 437
Email: david.castro(a)adianta.net
Web:
www.adianta.net
--------------------------------