Showing trunk CID and not callerID

Hello,

We have calls from a carrier coming through an incoming Trunk setup in our Asterisk/FreePBX.

The issue is that those calls are showing the outgoing trunk CID and not the callerID being passed in by the carrier.

Regular user/extension calls using the same trunk are displaying the correct CID, only those coming in from the carrier are displaying the default CID.

Our setup is, SIP Trunk - incoming:

type=peer
context=from-internal
host=xx.xx.xx.xx
disallow=all
allow=ulaw&alaw&g729
insecure=port,invite
accountcode=xxxxxxxxxx
sendrpid=yes
trustrpid=yes

Below are call logs.
As you can see, the CallerID exists and is set, but then is overridden by the trunkcid.

Any assistance is greatly appreciated, as I have tried absolutely everything and can not figure this out.

ZZZZZ = dial prefix
19999991212 = dialed number
15555551212 = caller number (CallerID)
Private" <4197013395> = trunk CID

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:1] NoOp(“SIP/custom-trunk-incoming-0000123c”, “ICX Incoming - stripping account code from number and add CID”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:2] Goto(“SIP/custom-trunk-incoming-0000123c”, “from-internal,19999991212,1”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Goto (from-internal,19999991212,1)

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:1] Macro(“SIP/custom-trunk-incoming-0000123c”, “user-callerid,SKIPTTL,”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:1] Set(“SIP/custom-trunk-incoming-0000123c”, “AMPUSER=15555551212”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:2] GotoIf(“SIP/custom-trunk-incoming-0000123c”, “0?report”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:3] ExecIf(“SIP/custom-trunk-incoming-0000123c”, “1?Set(REALCALLERIDNUM=15555551212)”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:4] Set(“SIP/custom-trunk-incoming-0000123c”, “AMPUSER=”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:5] Set(“SIP/custom-trunk-incoming-0000123c”, “AMPUSERCIDNAME=”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:6] GotoIf(“SIP/custom-trunk-incoming-0000123c”, “1?report”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Goto (macro-user-callerid,s,10)

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:10] GotoIf(“SIP/custom-trunk-incoming-0000123c”, “1?continue”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Goto (macro-user-callerid,s,19)

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:19] Set(“SIP/custom-trunk-incoming-0000123c”, “CALLERID(number)=15555551212”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:20] Set(“SIP/custom-trunk-incoming-0000123c”, “CALLERID(name)=”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:21] NoOp(“SIP/custom-trunk-incoming-0000123c”, “Using CallerID “” <15555551212>”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:2] NoOp(“SIP/custom-trunk-incoming-0000123c”, “Calling Out Route: LocalFreeZone_Misc”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:3] Set(“SIP/custom-trunk-incoming-0000123c”, “MOHCLASS=default”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:4] Set(“SIP/custom-trunk-incoming-0000123c”, “_NODEST=”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:5] Macro(“SIP/custom-trunk-incoming-0000123c”, “record-enable,OUT,”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:1] GotoIf(“SIP/custom-trunk-incoming-0000123c”, “1?check”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Goto (macro-record-enable,s,4)

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:4] ExecIf(“SIP/custom-trunk-incoming-0000123c”, “1?MacroExit()”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:6] Macro(“SIP/custom-trunk-incoming-0000123c”, “dialout-enum,6,9999991212,”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:1] GosubIf(“SIP/custom-trunk-incoming-0000123c”, “0?sub-pincheck,s,1”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:2] Macro(“SIP/custom-trunk-incoming-0000123c”, “outbound-callerid,6”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:1] ExecIf(“SIP/custom-trunk-incoming-0000123c”, “0?Set(CALLERPRES()=)”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:2] ExecIf(“SIP/custom-trunk-incoming-0000123c”, “0?Set(REALCALLERIDNUM=15555551212)”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:3] GotoIf(“SIP/custom-trunk-incoming-0000123c”, “1?normcid”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Goto (macro-outbound-callerid,s,6)

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:6] Set(“SIP/custom-trunk-incoming-0000123c”, “USEROUTCID=”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:7] Set(“SIP/custom-trunk-incoming-0000123c”, “EMERGENCYCID=”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:8] Set(“SIP/custom-trunk-incoming-0000123c”, “TRUNKOUTCID=“Private” <4197013395>”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:9] GotoIf(“SIP/custom-trunk-incoming-0000123c”, “1?trunkcid”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Goto (macro-outbound-callerid,s,12)

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:12] ExecIf(“SIP/custom-trunk-incoming-0000123c”, “1?Set(CALLERID(all)=“Private” <0000001212>)”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:13] ExecIf(“SIP/custom-trunk-incoming-0000123c”, “0?Set(CALLERID(all)=)”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:14] ExecIf(“SIP/custom-trunk-incoming-0000123c”, “0?Set(CALLERID(all)=)”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:15] ExecIf(“SIP/custom-trunk-incoming-0000123c”, “0?Set(CALLERPRES()=prohib_passed_screen)”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:3] Set(“SIP/custom-trunk-incoming-0000123c”, “OUTBOUND_GROUP=OUT_6”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:4] GotoIf(“SIP/custom-trunk-incoming-0000123c”, “1?nomax”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Goto (macro-dialout-enum,s,6)

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:6] Set(“SIP/custom-trunk-incoming-0000123c”, “DIAL_NUMBER=9999991212”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:7] Set(“SIP/custom-trunk-incoming-0000123c”, “DIAL_TRUNK=6”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:8] GosubIf(“SIP/custom-trunk-incoming-0000123c”, “0?sub-flp-6,s,1”) in new stack

Jul 30 21:00:13 VERBOSE [30122] pbx.c: – Executing [[email protected]:9] AGI(“SIP/custom-trunk-incoming-0000123c”, “enumlookup.agi”) in new stack

Jul 30 21:00:14 VERBOSE [30122] res_agi.c: – Launched AGI Script /var/lib/asterisk/agi-bin/enumlookup.agi

Many thanks!

Forgot to mention our versions…

Asterisk: 1.8.12.0

FreePBX: 2.8.1.4

Elastix: 2.3

Well, I found an article online (http://fonality.com/trixbox/forums/trixbox-forums/help/passing-inbound-cid-outbound-trunk) in which a user had the same/similar issue.

The fix was to enable the Intra-company option on the routes. For this to work, we had to enable on all our routes, then edit each users extension so that their CID Num Alias (internal CID) was the same as it would be for an external call… as this will not be passed for all calls.

Now the calls incoming from the carrier are routed back out a trunk and show the correct users callerid.

Now, this is not the ideal solution, and sure hope a fix/patch will be available to resolve the issue.

At the recent (2012) AstriCon I was told that the FreePBX forums are monitored and responded to.

What am I missing?
Are these the wrong forums?
Is there a different FreePBX forum I should be posting in?

Someone… anyone…?