Need a Outgoing Dial Rule to replace a number, strip and add in one action

I am using Asterisk 1.2.18 with FreePBX 2.2.0.

I have two Asterisk systems with an IAX2 trunk between them. I want to make each end so when a user dials the local 7 digit number for the other end it will try to rute the call through the IAX2 trunk before trying the PSTN lines. When the call comes in on the other end I want it to hit my external IVR.

The IAX2 trunk connection is working great a call going to 1234567 goes over the Internet to the other end but then on the receiving end it tries to dial out a zap channel to call back in the 1234567 zap channel.

I have the outbound route to match 1234567 to the IAX2 trunk and in the IAX2 trunk I need to strip off the 7 digit number and replace it with a *02 to call my external IVR on the other end.

For testing I have been trying to make the call connect to my extension on the other end but I am not having any luck.

I need some help to make this Outgoing Dial Rule work. This is what I am trying to use

From what I have read this should strip off the exact matching 7 digit local number 1234567 and add a prefix of 219 but it does not. From trying different orders and mixing this around I am only able to do one or the other. I can either strip off the 1234567 which does nothing or I can add a 219 prefix that calls 2191234567 on the other end.

What do I need to do to strip off the 7 digit number that was dialed and replace it with a 219 or replace it with a *02?

I set the Outgoing Dial Rule to only strip the area code, this makes the IAX trunk pass the 7 digit local number. Then on the other end I added a Misc Application with the local 7 digit number as the Feature Code. Now when a call to 1234567 comes in over the IAX it is handled internally by the Misc Application that hands it off to the external IVR.