Help with Caller ID over IAX trunk

Hello guys,
I hope you could help me with this issue I have.
I am running two machines with Astersix 1.6 and FreePBX 2.7. On the first machine I do have a PRI trunk, second machine is having only IAX trunk to the first one.
I have setup trunking and routing following these instructions:
http://fonality.com/trixbox/node/25093/93824#comment-93824

Everything is working so far with no problems.
One thing I couldn’t figure it out is that when I make a call from one asterisk to the other it is passing the extension’s CID (or whatever I have set for Outbound CID).
When an incoming call on the PRI is routed trough the IAX trunk to the second Asterisk, I am seeing the name of the IAX trunk as a caller id.
At some point it says:
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:2] ExecIf(“DAHDI/5-1”, “1?Set(TRUNKCIDOVERRIDE=iax2route)”) in new stack

why it is doing so and how I can fix this?

This is the log from the system with the PRI circuit:
[Oct 31 16:01:24] VERBOSE[3849] chan_dahdi.c: – Accepting call from ‘9077237005’ to ‘3721’ on channel 0/5, span 1
[Oct 31 16:01:24] VERBOSE[26396] pbx.c: – Executing [[email protected]:1] NoOp(“DAHDI/5-1”, “”) in new stack
[Oct 31 16:01:24] VERBOSE[26396] pbx.c: – Executing [[email protected]:2] Wait(“DAHDI/5-1”, “1”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:3] NoOp(“DAHDI/5-1”, “WIRELESS CALLER”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:4] Goto(“DAHDI/5-1”, “from-pstn,3721,1”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Goto (from-pstn,3721,1)
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:1] Set(“DAHDI/5-1”, “__FROM_DID=3721”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:2] Gosub(“DAHDI/5-1”, “app-blacklist-check,s,1”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:1] GotoIf(“DAHDI/5-1”, “0?blacklisted”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:2] Set(“DAHDI/5-1”, “CALLED_BLACKLIST=1”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:3] Return(“DAHDI/5-1”, “”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:3] ExecIf(“DAHDI/5-1”, “0 ?Set(CALLERID(name)=9077237005)”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:4] Set(“DAHDI/5-1”, “__CALLINGPRES_SV=allowed”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:5] Set(“DAHDI/5-1”, “CALLERPRES()=allowed_not_screened”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:6] Goto(“DAHDI/5-1”, “ext-miscdests,2,1”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Goto (ext-miscdests,2,1)
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:1] NoOp(“DAHDI/5-1”, “MiscDest: iax3721”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:2] Goto(“DAHDI/5-1”, “from-internal,3721,1”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Goto (from-internal,3721,1)
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:1] Macro(“DAHDI/5-1”, “user-callerid,SKIPTTL,”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:1] Set(“DAHDI/5-1”, “AMPUSER=9077237005”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:2] GotoIf(“DAHDI/5-1”, “0?report”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:3] ExecIf(“DAHDI/5-1”, “1?Set(REALCALLERIDNUM=9077237005)”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:4] Set(“DAHDI/5-1”, “AMPUSER=”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:5] Set(“DAHDI/5-1”, “AMPUSERCIDNAME=”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:6] GotoIf(“DAHDI/5-1”, “1?report”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Goto (macro-user-callerid,s,10)
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:10] GotoIf(“DAHDI/5-1”, “1?continue”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Goto (macro-user-callerid,s,19)
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:19] NoOp(“DAHDI/5-1”, “Using CallerID “WIRELESS CALLER” <9077237005>”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:2] ExecIf(“DAHDI/5-1”, “1?Set(TRUNKCIDOVERRIDE=iax2route)”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:3] Set(“DAHDI/5-1”, “_NODEST=”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:4] Macro(“DAHDI/5-1”, “record-enable,OUT,”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:1] GotoIf(“DAHDI/5-1”, “1?check”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Goto (macro-record-enable,s,4)
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:4] ExecIf(“DAHDI/5-1”, “1?MacroExit()”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:5] Macro(“DAHDI/5-1”, “dialout-trunk,10,3721,”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:1] Set(“DAHDI/5-1”, “DIAL_TRUNK=10”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:2] GosubIf(“DAHDI/5-1”, “0?sub-pincheck,s,1”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:3] GotoIf(“DAHDI/5-1”, “0?disabletrunk,1”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:4] Set(“DAHDI/5-1”, “DIAL_NUMBER=3721”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:5] Set(“DAHDI/5-1”, “DIAL_TRUNK_OPTIONS=tTrwW”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:6] Set(“DAHDI/5-1”, “OUTBOUND_GROUP=OUT_10”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:7] GotoIf(“DAHDI/5-1”, “1?nomax”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Goto (macro-dialout-trunk,s,9)
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:9] GotoIf(“DAHDI/5-1”, “0?skipoutcid”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:10] Set(“DAHDI/5-1”, “DIAL_TRUNK_OPTIONS=tTwW”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:11] Macro(“DAHDI/5-1”, “outbound-callerid,10”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:1] ExecIf(“DAHDI/5-1”, “1?Set(CALLERPRES()=allowed)”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:2] ExecIf(“DAHDI/5-1”, “0?Set(REALCALLERIDNUM=9077237005)”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:3] GotoIf(“DAHDI/5-1”, “1?normcid”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Goto (macro-outbound-callerid,s,6)
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:6] Set(“DAHDI/5-1”, “USEROUTCID=”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:7] Set(“DAHDI/5-1”, “EMERGENCYCID=”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:8] Set(“DAHDI/5-1”, “TRUNKOUTCID=”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:9] GotoIf(“DAHDI/5-1”, “1?trunkcid”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Goto (macro-outbound-callerid,s,12)
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:12] ExecIf(“DAHDI/5-1”, “0?Set(CALLERID(all)=)”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:13] ExecIf(“DAHDI/5-1”, “0?Set(CALLERID(all)=)”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:14] ExecIf(“DAHDI/5-1”, “1?Set(CALLERID(all)=iax2route)”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:15] ExecIf(“DAHDI/5-1”, “0?Set(CALLERPRES()=prohib_passed_screen)”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:12] ExecIf(“DAHDI/5-1”, “0?AGI(fixlocalprefix)”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:13] Set(“DAHDI/5-1”, “OUTNUM=3721”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:14] Set(“DAHDI/5-1”, “custom=IAX2/ToVElstx”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:15] ExecIf(“DAHDI/5-1”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^)tTwW)”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:16] Macro(“DAHDI/5-1”, “dialout-trunk-predial-hook,”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:1] MacroExit(“DAHDI/5-1”, “”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:17] GotoIf(“DAHDI/5-1”, “0?bypass,1”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:18] GotoIf(“DAHDI/5-1”, “0?customtrunk”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] pbx.c: – Executing [[email protected]:19] Dial(“DAHDI/5-1”, “IAX2/ToVElstx/3721,300,tTwW”) in new stack
[Oct 31 16:01:25] VERBOSE[26396] app_dial.c: – Called ToVElstx/3721
[Oct 31 16:01:25] VERBOSE[3859] chan_iax2.c: – Call accepted by 10.127.7.60 (format ulaw)
[Oct 31 16:01:25] VERBOSE[3859] chan_iax2.c: – Format for call is ulaw
[Oct 31 16:01:25] VERBOSE[26396] app_dial.c: – IAX2/ToVElstx-2043 is ringing