How to make Asterisk call itself for specific test scenario

I have a very specific task I need to accomplish for a production system but in order to get to that point I need to do accomplish a series of tests that requires a strange configuration for Asterisk (provided I’m thinking about this whole thing correctly). In the production system I need to support two scenarios: 1.) A specific device needs to call in to the Asterisk box across PSTN, identify itself through DTMF tones and then provide additional status info and receive info through DTMF tones. 2.) An external program using AMI will originate a call from Asterisk to the device across PSTN, the device answers, exchanges DTMF tones for various things.

I know you’re thinking, why on God’s green earth are you using DTMF tones for information exchange. I can tell you that I would never design it this way, but the manufacturer of the device we have to connect with obviously fell in love with DTMF in the late '50s and hasn’t been able to move past the concept. Anyhow, that’s the production scenario we will be implementing.

In order to do the development and true, live-condition testing we need to simulate the dialing out across PSTN and the receipt across PSTN of a call from the device. The easy answer would be to have two POTS lines and then connect device to one and Asterisk to the other. However, my facilities personnel have all but ruled out this scenario in the short term; therefore, surely using Asterisk and hardware I can accomplish this.

I have ordered a TDM400 with 2 FXO and 2 FXS ports. My thought was that I could connect the 2 FXOs together with a standard telephone cable and the device could plug into an FXS port. I would then set up a scenario where the call (initiated via AMI) would go out an FXO, pick up from the other inbound-provisioned FXO, connect to the extension where the device is connected, and perform the DTMF stuff.

Secondarily, using completely separate test dialplan configuration, I would be able to initiate a call from the device out the FXO, to the inbound-provisioned FXO and run the necessary AGP script to accomplish the DTMF stuff for Scenario 2.

However, I am clearly missing something here since an FXO port wants to accept a dialtone and not generate one. Does anyone have experience in creating a simple ringdown circuit without having to purchase a hardware box to accomplish this? Anyone have any better suggestion as to how I can accomplish what I need to accomplish?