CID / CNAME problem on SIP trunks between FreePBX boxes

So here is the setup:
MainPBX which has

  • SIP trunks to providers
  • Trunk to SecPBX
  • Few remote workers

SecPBX which has:

  • SIP trunk to MainPBX

I finally was able to route DID from providers to SecPBX and route outbound calls from SecPBX to PSTN through MainPBX but these calls are shown as “Private”. Please note that I do not need to be able to join direct ext in both PBX, just to be able to get inbound external calls from Main to Sec and outbound calls from Sec through Main

Here is trunks config.

MainPBX:

PEER Details [SecPBX]

host=secpbx.domain.tld
username=MainPBX
secret=*****
type=peer
trustrpid=yes
sendrpid=yes
context=from-internal

USER Details and Register string are BLANKs

PEER Details [MainPBX]

host=mainpbx.domain.tld
username=SecPBX
secret=*****
type=peer
trustrpid=yes
sendrpid=yes
context=from-internal

USER Details and Register string are BLANKs

I tried ticking Intra-Company in SecPBX Outbound route section as well.

I am using FreePBX 6.12.65 with Asterisk 13.2 in both systems and they are connected through Internet. I don’t think it’s a firewall problem as calls are going through both ways.

Thanks,

Here are CLI output from a call:

  -- Goto (macro-outbound-callerid,s,14)
    -- Executing [[email protected]:14] ExecIf("SIP/1000-00000004", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [[email protected]:15] ExecIf("SIP/1000-00000004", "1?Set(CALLERID(all)="John Doe" <8196996666>)") in new stack
    -- Executing [[email protected]:16] ExecIf("SIP/1000-00000004", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [[email protected]:17] ExecIf("SIP/1000-00000004", "0?Set(CALLERPRES()=prohib_passed_screen)") in new stack
    -- Executing [[email protected]:18] Set("SIP/1000-00000004", "CDR(outbound_cnum)=8196996666") in new stack
    -- Executing [[email protected]:19] Set("SIP/1000-00000004", "CDR(outbound_cnam)=John Doe") in new stack

The prohib_passed_screen makes is probably the culprit, but I can’t find where to set this.

Thanks,

-- Executing [[email protected]:17] ExecIf("SIP/1000-00000004", "0?Set(CALLERPRES()=prohib_passed_screen)") in new stack

I see the above in both the SecPBX and MainPBX Asterisk CLI even though CID / CNAME seems to go through.

I have to admit I’m lost on this one.

Thanks,

EDIT: I think it might be related with this: http://forum.elastix.org/viewtopic.php?f=3&t=128127&sid=7ce562e97880c97249366fc2c127a0ec&mobile=mobile

OK, so I further investigated. If SecPBX is calling a MainPBX ext directly, the SecPBX ext. Outbound CID is properly shown. Also, if I call a MainPBX assigned DID, it still properly shown. As soon as it goes through the MainPBX VSP trunk, from-header is modified, name is still on it but sends “John Doe” [email protected]

I have the exact same problem. I can’t find any information on this. Did you ever solve your problem? I would be very interrested in knowing the solution!