Connect inbound call to a SIP Trunk

PBX heads,

i have setup a SIP trunk for outgoing calls which (finally) works.
i also have a my FXO (as a trunk) able to make incoming and outgoing calls. right now calls going to my FXO are diverted to an extension. and this also works!

but i am trying to find a way that when the FXO is dialed, the call is connected to my SIP trunk; so i can use this for making international calls.

for example my FXO is connected to a line with extension of 300 (this extension is on the old PBX system), when the user dials 300 it is connected to SIP trunk and can then dial the international call!

thanks

guys any one, i really need help!
could any one point me to a guide or tutorial?

stonet, thanks for your reply.
i either got the whole concept wrong or didnt fully make my question clear!

basically said this is what is happening:
i use an analog phone and dial a number which is sent to my FXO. FXO (which is registered as a trunk) forwards the call to extension 100 on my FreePBX.

something like this:
Analog phone > FXO > FreePBX > extension 100

now i want to be able to do this:
Analog phone > FXO > FreePBX > SIP Trunk

basically i want this setup to be able to use services such as VoipBuster, POIVY to place international calls from my analog phone!

if i am not mistaken, i have to do something with custom extension or so!?

The best way to do this is to set up a trunk from your old system to Asterisk.

I suspect on your old system you dial 9 or something like that to obtain an outside telco line connected to a FXO port.

Now set up an analogue extension on Asterisk using an ATA or Digium card to provide a FXS port and connect the old systems FXO port to the Asterisk FXS.

Now when you dial 9 on the old system you will get dial tone from Asterisk which is behaving just like a telco exchange line. All you need to do is setup an appropriate Outbound Route on asterisk to route the call to the SIP trunk.

Conversely setup an Inbound Route on asterisk to cause inbound calls on the SIP trunk to be routed to the extension you created. This will ring the old system which will deal with the inbound call as if it were a call incoming on a telco exchange line.