CallerID not being set on outbound calls

Asterisk 1.4.21.2 / FreePBX 2.7

I’m having a problem with one of my servers where it isn’t setting CallerID on outbound calls - which causes the ITSP to use the default set for the account.

I’m not running into this anywhere else.

Here’s debug output for a follow-me call, though the problem is happening on any outbound call, not just follow-me:

Setup is:

Calling Party --------------> PiaF ------------------> Cellphone
CID: 1111111111… DID: 2222222222… Followme: 3333333333

CallerID seen at 3333333333 should be 1111111111, but instead is showing up as 2222222222

Asterisk log on the outbound follow-me call to 3333333333:

-- Executing [s@macro-dialout-trunk:12] Macro("Local/3333333333@from-internal-ac3e,2", "outbound-callerid|4") in new stack -- Executing [s@macro-outbound-callerid:1] ExecIf("Local/3333333333@from-internal-ac3e,2", "1|SetCallerPres|allowed_not_screened") in new stack -- Executing [s@macro-outbound-callerid:2] ExecIf("Local/3333333333@from-internal-ac3e,2", "1|Set|REALCALLERIDNUM=1111111111") in new stack -- Executing [s@macro-outbound-callerid:3] GotoIf("Local/3333333333@from-internal-ac3e,2", "0?normcid") in new stack -- Executing [s@macro-outbound-callerid:4] Set("Local/3333333333@from-internal-ac3e,2", "USEROUTCID=1111111111") in new stack -- Executing [s@macro-outbound-callerid:5] GotoIf("Local/3333333333@from-internal-ac3e,2", "1?bypass") in new stack -- Goto (macro-outbound-callerid,s,7) -- Executing [s@macro-outbound-callerid:7] Set("Local/3333333333@from-internal-ac3e,2", "EMERGENCYCID=") in new stack -- Executing [s@macro-outbound-callerid:8] Set("Local/3333333333@from-internal-ac3e,2", "TRUNKOUTCID="PIAF-CALLERID" <2222222222>") in new stack -- Executing [s@macro-outbound-callerid:9] GotoIf("Local/3333333333@from-internal-ac3e,2", "1?trunkcid") in new stack -- Goto (macro-outbound-callerid,s,12) -- Executing [s@macro-outbound-callerid:12] ExecIf("Local/3333333333@from-internal-ac3e,2", "1|Set|CALLERID(all)=PIAF-CALLERID <2222222222>") in new stack -- Executing [s@macro-outbound-callerid:13] ExecIf("Local/3333333333@from-internal-ac3e,2", "1|Set|CALLERID(all)=1111111111") in new stack -- Executing [s@macro-outbound-callerid:14] ExecIf("Local/3333333333@from-internal-ac3e,2", "0|Set|CALLERID(all)=") in new stack -- Executing [s@macro-outbound-callerid:15] ExecIf("Local/3333333333@from-internal-ac3e,2", "0|SetCallerPres|prohib_passed_screen") in new stack

Here’s the SIP INVITE being sent to the VSP on the follow-me call - note the From field has sip:vsp-acctname instead of sip:1111111111 - which is causing the voip provider to use the default callerID on the account (2222222222)

note: I removed <>'s around fields on the From:, To:, Contact:, and Remote-Party-ID: lines because the forum was discarding characters inside the <>s

Reliably Transmitting (NAT) to vtsp-server:5060: INVITE sip:3333333333@vtsp-server SIP/2.0 Via: SIP/2.0/UDP 172.31.1.12:5060;branch=z9hG4bK2f7f92fc;rport From: "1111111111" sip:[email protected];tag=as1a180910 To: sip:3333333333@vtsp-server Contact: sip:[email protected] Call-ID: [email protected] CSeq: 102 INVITE User-Agent: Asterisk PBX Max-Forwards: 70 Remote-Party-ID: "1111111111" sip:[email protected];privacy=off;screen=no Date: Fri, 29 Oct 2010 19:15:29 GMT Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY Supported: replaces Content-Type: application/sdp Content-Length: 259

Any help in troubleshooting this great appreciated.

The From: field on the invite here is: “1111111111” sip:[email protected] whereas on the working boxes it’s the equivalent of: “1111111111” sip:[email protected] - even with fromuser set.

This is rather frustrating!

… but I have that set on multiple other boxes and outbound callerID works everywhere else.

Without fromuser set (to the vtsp account name) in the trunk config, the VoIP service provider rejects outbound calls.

Why would this act different on this box (vs the others that do work correctly)?

check with your provider, it may be something on there end. Maybe the others are using the RPID and this connection is not, or something similar.

Bottom line, the dialplan is acting correctly, the specific details of configuration that your provider needs is something they are probably going to need to tell you or set on their end.

FreePBX is setting it correctly per the dialplan (and you can see that further basedo n the RPID SIP field).

Check you SIP configuration with your trunk, it may be that you have set the fromuser field, which I believe will have that effect (and in any event, that’s going to be where the problem is because the dialplan is setting it correct per the log trace you provided.