You need to set up IAX trunks between the 2, not extension and trunk, and set the "Intra Company" check box.
I actually have setup the IAX2 trunks on both boxes, the calls can get through from box 1 (freepbx with a2billing) to box 2 (freepbx, acts as a gateway for all outbound calls), however my problem is, how to tell the second box to dial out the number that it received from box 1. Right now , box 2 has no clue on what to do with the _FROM_DID=15142942365, which was dialed by the caller or phone card user, ( Set(CALLERID(name)=5142962262)"). Below is the excerpt from the asterisk cli:
Accepting UNAUTHENTICATED call from 192.168.15.10:
-- > requested format = ulaw,
-- > requested prefs = (ulaw),
-- > actual format = ulaw,
-- > host prefs = (ulaw|alaw|gsm),
-- > priority = mine
-- Executing [15142942365@from-trunk:1] NoOp("IAX2/PHONECARD_OUT-6618", "Catch-All DID Match - Found 15142942365 - You probably want a DID for this.") in new stack
-- Executing [15142942365@from-trunk:2] Set("IAX2/PHONECARD_OUT-6618", "__FROM_DID=15142942365") in new stack
-- Executing [15142942365@from-trunk:3] Goto("IAX2/PHONECARD_OUT-6618", "ext-did,s,1") in new stack
-- Goto (ext-did,s,1)
-- Executing [s@ext-did:1] ExecIf("IAX2/PHONECARD_OUT-6618", "0?Set(__FROM_DID=s)") in new stack
-- Executing [s@ext-did:2] Gosub("IAX2/PHONECARD_OUT-6618", "sub-record-cancel,s,1()") in new stack
-- Executing [s@sub-record-cancel:1] Set("IAX2/PHONECARD_OUT-6618", "__REC_POLICY_MODE=") in new stack
-- Executing [s@sub-record-cancel:2] ExecIf("IAX2/PHONECARD_OUT-6618", "1?Return()") in new stack
-- Executing [s@ext-did:3] Set("IAX2/PHONECARD_OUT-6618", "__REC_POLICY_MODE=never") in new stack
-- Executing [s@ext-did:4] Gosub("IAX2/PHONECARD_OUT-6618", "app-blacklist-check,s,1()") in new stack
-- Executing [s@app-blacklist-check:1] GotoIf("IAX2/PHONECARD_OUT-6618", "0?blacklisted") in new stack
-- Executing [s@app-blacklist-check:2] Set("IAX2/PHONECARD_OUT-6618", "CALLED_BLACKLIST=1") in new stack
-- Executing [s@app-blacklist-check:3] Return("IAX2/PHONECARD_OUT-6618", "") in new stack
-- Executing [s@ext-did:5] Set("IAX2/PHONECARD_OUT-6618", "CDR(did)=15142942365") in new stack
-- Executing [s@ext-did:6] ExecIf("IAX2/PHONECARD_OUT-6618", "1 ?Set(CALLERID(name)=5142962262)") in new stack
-- Executing [s@ext-did:7] Set("IAX2/PHONECARD_OUT-6618", "CHANNEL(musicclass)=none") in new stack
-- Executing [s@ext-did:8] Set("IAX2/PHONECARD_OUT-6618", "__MOHCLASS=none") in new stack
-- Executing [s@ext-did:9] Set("IAX2/PHONECARD_OUT-6618", "__CALLINGPRES_SV=allowed_not_screened") in new stack
-- Executing [s@ext-did:10] Set("IAX2/PHONECARD_OUT-6618", "CALLERPRES()=allowed_not_screened") in new stack
-- Executing [s@ext-did:11] Goto("IAX2/PHONECARD_OUT-6618", "app-blackhole,hangup,1") in new stack
-- Goto (app-blackhole,hangup,1)
-- Executing [hangup@app-blackhole:1] NoOp("IAX2/PHONECARD_OUT-6618", "Blackhole Dest: Hangup") in new stack
-- Executing [hangup@app-blackhole:2] Hangup("IAX2/PHONECARD_OUT-6618", "") in new stack
== Spawn extension (app-blackhole, hangup, 2) exited non-zero on 'IAX2/PHONECARD_OUT-6618'
-- Hungup 'IAX2/PHONECARD_OUT-6618'