CID passthrough when forwarding to an external number

I am running PIAF 1.7.5.5 with Asterisk 1.6.2.11
When I call forward from my extension to an external number all forwarded calls come in as anonymous and the log shows:
Executing [s@macro-outbound-callerid:15]
Set(CALLERPRES()=prohib_passed_screen)")

However when I forward the call to an internal extension I get the CID from the caller and the log shows:
Executing [s@macro-dial-one:36]
"__KEEPCID=TRUE")

From what I understand it seems to fail here [***] and there must be a parameter somewhere to resolve this. Help please?

[macro-outbound-callerid]
include => macro-outbound-callerid-custom
exten => s,1,ExecIf($["${CALLINGPRES_SV}" != “”]?Set(CALLERPRES()=${CALLINGPRES_SV}))
exten => s,n,ExecIf($["${REALCALLERIDNUM:1:2}" = “”]?Set(REALCALLERIDNUM=${CALLERID(number)}))
exten => s,n(start),GotoIf($[ $["${REALCALLERIDNUM}" = “”] | $["${KEEPCID}" != “TRUE”] | $["${OUTKEEPCID_${ARG1}}" = “on”] ]?normcid)
exten => s,n,Set(USEROUTCID=${REALCALLERIDNUM})
exten => s,n,GotoIf($[“foo${DB(AMPUSER/${REALCALLERIDNUM}/device)}” = “foo”]?bypass)
exten => s,n(normcid),Set(USEROUTCID=${DB(AMPUSER/${AMPUSER}/outboundcid)})
exten => s,n(bypass),Set(EMERGENCYCID=${DB(DEVICE/${REALCALLERIDNUM}/emergency_cid)})
exten => s,n,Set(TRUNKOUTCID=${OUTCID_${ARG1}})
exten => s,n,GotoIf($["${EMERGENCYROUTE:1:2}" = “” | “${EMERGENCYCID:1:2}” = “”]?trunkcid)
exten => s,n,Set(CALLERID(all)=${EMERGENCYCID})
exten => s,n(exit),MacroExit()
exten => s,n(trunkcid),ExecIf($[${LEN(${TRUNKOUTCID})} != 0]?Set(CALLERID(all)=${TRUNKOUTCID}))
exten => s,n(usercid),ExecIf($[${LEN(${USEROUTCID})} != 0]?Set(CALLERID(all)=${USEROUTCID}))
exten => s,n,ExecIf($[${LEN(${TRUNKCIDOVERRIDE})} != 0 | ${LEN(${FORCEDOUTCID_${ARG1}})} != 0]?Set(CALLERID(all)=${IF($[${LEN(${FORCEDOUTCID_${ARG1}})}=0]?${TRUNKCIDOVERRIDE}:${FORCEDOUTCID_${ARG1}})}))
[***] exten => s,n(hidecid),ExecIf($["${CALLERID(name)}"=“hidden”]?Set(CALLERPRES()=prohib_passed_screen))
; end of [macro-outbound-callerid]

I searched for prohib_passed_screen on this post, the only occurrence of it is the one I pointed out, where it is part of an ExecIf and not being called.

Beyond that, I really don’t know what you are referring to and I can tell you that the only time that the calling presence is set to anonymous on an outbound call is:

  • if you use “hidden” in the CNAM
  • if it came in as anonymous, in which case we change it while in the PBX (for various reasons) but put it back to how it came in before sending it back out.

Yes. It is set to prohib_passed_screen as per the original trace. You are just looking at the wrong call. I guess I shouldn’t have included 2 call examples. Sorry but I wanted to show 1 call that works and 1 that doesn’t work.

The first call is without forwarding and on that one the CID is maintained. The second call is the problem call and in the last 3 lines you can see the prohib_passed_screen flag.

Why can’t I change the dial plan somehow to simply not use the prohib-passed-screen flag? I tried changing the “usecallingpres=yes” parameter to “no” in chan_dahdi.conf but it did not do anything. There must be a way in freepbx to over ride this setting. No?

Just checking up on my old ISDN terminology
(CALLERPRES()=prohib_passed_screen)") = Presentation prohibited, passed screen.

That means the CID is there but presentation is prohibited so something in the dial plan decides the CID should not be presented and this is where the CID forwarding fails.

I would need to set
exten => s,n,SetCallerPres(allowed)
for the CID forwarding to work but I don’t know how to do this. I tried setting it for inbound DID calls but it did not make a difference.

[quote]Just checking up on my old ISDN terminology
(CALLERPRES()=prohib_passed_screen)") = Presentation prohibited, passed screen.[/quote]

It is not being set to that per the original trace.

examining/comparing the SIP INVITES between the two scenarios will show what is different between them, that’s your best bet.

From the first logs though, FreePBX did not look like it was setting the signaling to be anonymous though, but again, the SIP signaling won’t lie. (unless there is some sort of SIP ALG/proxy it subsequently passes through in which case you’ll have to have a look at the signaling at that point.)

well you didn’t include the INVITE packet for folks to see what the signaling was, but the CID is going out properly:

From: “5149999999” ;tag=as517dc81b

You far end may be treating it as anonymous because it does not have access to any info for Canada? (isn’t that Quebec?)

Can’t be that. When I call direct from one phone to the other I get the CID. It only doesn’t work when I forward the call.

I did the sip debug as you suggested but I can’t get any further on this. The CID is simply not sent on call forwarding. Maybe you could try to duplicate the issue? I forward a SIP extension to an external number and then call the sip extension from another external number.

One second I see the SIP invite from 5149999999 to 5145555555 (5141111111) and the next it’s anonymous to 5145555555. Could it be related to this bug?
http://lists.digium.com/pipermail/asterisk-bugs/2010-September/086400.html

[2010-12-19 17:11:48] VERBOSE[8925] chan_sip.c:
<— SIP read from UDP:208.65.240.153:5060 —>
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 67.99.99.67:5060;branch=z9hG4bK2e9fc101;rport=5060;received=67.99.99.67
From: “5149999999” sip:[email protected];tag=as517dc81b
To: sip:[email protected];tag=614836136
Call-ID: [email protected]
CSeq: 102 INVITE
Server: YATE-CPD/2.0.0
Contact: sip:[email protected]:5060
Allow: ACK, INVITE, BYE, CANCEL, REGISTER, REFER, OPTIONS, INFO
Content-Type: application/sdp
Content-Length: 236

v=0
o=Quintum 23259 716936854 IN IP4 208.79.56.168
s=VoipCall
c=IN IP4 208.79.56.168
t=0 0
m=audio 11150 RTP/AVP 18 101
c=IN IP4 208.79.56.168
a=rtpmap:18 g729/8000/1
a=ptime:20
a=rtpmap:101 telephone-event/8000/1
a=sendrecv

<------------->
[2010-12-19 17:11:48] VERBOSE[8925] chan_sip.c: — (11 headers 11 lines) —
[2010-12-19 17:11:48] VERBOSE[8925] chan_sip.c: Found RTP audio format 18
[2010-12-19 17:11:48] VERBOSE[8925] chan_sip.c: Found RTP audio format 101
[2010-12-19 17:11:48] VERBOSE[8925] chan_sip.c: Found audio description format g729 for ID 18
[2010-12-19 17:11:48] VERBOSE[8925] chan_sip.c: Found audio description format telephone-event for ID 101
[2010-12-19 17:11:48] VERBOSE[8925] chan_sip.c: Capabilities: us - 0x10c (ulaw|alaw|g729), peer - audio=0x100 (g729)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x100 (g729)
[2010-12-19 17:11:48] VERBOSE[8925] chan_sip.c: Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
[2010-12-19 17:11:48] VERBOSE[8925] chan_sip.c: Peer audio RTP is at port 208.79.56.168:11150
[2010-12-19 17:11:48] VERBOSE[16350] app_dial.c: – SIP/CallForward-00000350 is making progress passing it to Local/225145555555@from-internal-2052;2
[2010-12-19 17:11:48] VERBOSE[16349] app_dial.c: – Local/225145555555@from-internal-2052;1 is making progress passing it to SIP/208.72.120.217-0000034b
[2010-12-19 17:11:48] VERBOSE[8925] chan_sip.c:
<— SIP read from UDP:208.65.240.153:5060 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 67.99.99.67:5060;branch=z9hG4bK2e9fc101;rport=5060;received=67.99.99.67
From: “5149999999” sip:[email protected];tag=as517dc81b
To: sip:[email protected];tag=614836136
Call-ID: [email protected]
CSeq: 102 INVITE
Server: YATE-CPD/2.0.0
Contact: sip:[email protected]:5060
Allow: ACK, INVITE, BYE, CANCEL, REGISTER, REFER, OPTIONS, INFO
Content-Type: application/sdp
Content-Length: 236

v=0
o=Quintum 23260 716936854 IN IP4 208.79.56.168
s=VoipCall
c=IN IP4 208.79.56.168
t=0 0
m=audio 11150 RTP/AVP 18 101
c=IN IP4 208.79.56.168
a=rtpmap:18 g729/8000/1
a=ptime:20
a=rtpmap:101 telephone-event/8000/1
a=sendrecv

<------------->
[2010-12-19 17:11:48] VERBOSE[8925] chan_sip.c: — (11 headers 11 lines) —
[2010-12-19 17:11:48] VERBOSE[16350] app_dial.c: – SIP/CallForward-00000350 is ringing
[2010-12-19 17:11:48] VERBOSE[16350] app_dial.c: – SIP/CallForward-00000350 is making progress passing it to Local/225145555555@from-internal-2052;2
[2010-12-19 17:11:48] VERBOSE[16349] app_dial.c: – Local/225145555555@from-internal-2052;1 is ringing
[2010-12-19 17:11:48] VERBOSE[16349] chan_sip.c:
<— Transmitting (NAT) to 208.72.120.217:5060 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 208.72.120.217:5060;branch=z9hG4bK1691186508;received=208.72.120.217;rport=5060
From: “Spiderman” sip:[email protected];isup-oli=00;tag=1140127756
To: sip:[email protected];tag=as122f5bab
Call-ID: [email protected]
CSeq: 18803385 INVITE
Server: Asterisk PBX 1.6.2.11
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact: sip:[email protected]
Content-Length: 0

<------------>
[2010-12-19 17:11:48] VERBOSE[16349] app_dial.c: – Local/225145555555@from-internal-2052;1 is making progress passing it to SIP/208.72.120.217-0000034b
[2010-12-19 17:11:48] VERBOSE[8925] chan_sip.c: Really destroying SIP dialog ‘[email protected]’ Method: REGISTER
[2010-12-19 17:11:48] VERBOSE[8925] chan_sip.c: Reliably Transmitting (NAT) to 70.30.127.176:5060:

<------------->
[2010-12-19 17:11:48] VERBOSE[8925] chan_sip.c: — (11 headers 0 lines) —
[2010-12-19 17:11:48] VERBOSE[8925] chan_sip.c: Really destroying SIP dialog ‘[email protected]’ Method: OPTIONS
[2010-12-19 17:11:48] VERBOSE[8925] chan_sip.c:
<— SIP read from UDP:208.72.120.217:5060 —>
INVITE sip:[email protected] SIP/2.0
Max-Forwards: 19
Call-ID: [email protected]
Via: SIP/2.0/UDP 208.72.120.217:5060;rport;branch=z9hG4bK822776870
From: “Anonymous” sip:[email protected];isup-oli=00;tag=1799118516
To: sip:[email protected]
CSeq: 18803407 INVITE
User-Agent: DIDOASIS/1.1.0
Contact: sip:[email protected]:5060;isup-oli=00
Allow: ACK, INVITE, BYE, CANCEL, REFER, OPTIONS, INFO
Content-Type: application/sdp
Content-Length: 174

CNAM is always left off when passing on the call since through the PSTN it is otherwise ignored. (enum it might not be but in any event, it is still stripped off under the normal path).

Your call above is not being set to anonymous by FreePBX:

[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [s@macro-outbound-callerid:13] ExecIf("Local/225145555555@from-internal-e1c7;2", "1?Set(CALLERID(all)=5149999999)") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [s@macro-outbound-callerid:14] ExecIf("Local/225145555555@from-internal-e1c7;2", "0?Set(CALLERID(all)=)") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [s@macro-outbound-callerid:15] ExecIf("Local/225145555555@from-internal-e1c7;2", "0?Set(CALLERPRES()=prohib_passed_screen)") in new stack

That’s the crux, as you can see the CID is being set to 5149999999 and the CALLPRES() is not being executed because the condition is not being met.

In any event, you are better off turning on SIP debugging and looking at the SIP packets going out to see if for some reason they are being signaled as anonymous and work backwards from there.

when you forward a call, unless you have chosen one of the trunk options to alter the CID, it should be setting the CID to the original CID.

The 'hidecid" lind simply sets the presentation in the signaling to “anonymous” if you have “hidden” as the CNAM part of the CID.

I use the default settings for the trunk. No CID manipulation. My best guess is that the cnam info gets lost during the call forwarding process and then the call is set to anonymous even though we have the CID. I don’t want to reprint the entire log but here are some parts. You can see the name and number comes in and then name is stripped and call is passed on as anonymous. I used the enum route as example. The same happens on all other routes.

[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [5141111111@from-sip-external:1] NoOp("SIP/202.33.120.217-000000cc", "Received incoming SIP connection from unknown peer to 5141111111") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [5141111111@from-sip-external:2] Set("SIP/202.33.120.217-000000cc", "DID=5141111111") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [5141111111@from-sip-external:3] Goto("SIP/202.33.120.217-000000cc", "s,1") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Goto (from-sip-external,s,1)
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@from-sip-external:1] GotoIf("SIP/202.33.120.217-000000cc", "1?checklang:noanonymous") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Goto (from-sip-external,s,2)
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@from-sip-external:2] GotoIf("SIP/202.33.120.217-000000cc", "0?setlanguage:from-trunk,5141111111,1") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Goto (from-trunk,5141111111,1)
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [5141111111@from-trunk:1] Macro("SIP/202.33.120.217-000000cc", "exten-vm,5141111111,5141111111") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-exten-vm:1] Macro("SIP/202.33.120.217-000000cc", "user-callerid,") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-user-callerid:1] Set("SIP/202.33.120.217-000000cc", "AMPUSER=5149999999") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-user-callerid:2] GotoIf("SIP/202.33.120.217-000000cc", "0?report") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-user-callerid:3] ExecIf("SIP/202.33.120.217-000000cc", "1?Set(REALCALLERIDNUM=5149999999)") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-user-callerid:4] Set("SIP/202.33.120.217-000000cc", "AMPUSER=") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-user-callerid:5] Set("SIP/202.33.120.217-000000cc", "AMPUSERCIDNAME=") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-user-callerid:6] GotoIf("SIP/202.33.120.217-000000cc", "1?report") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Goto (macro-user-callerid,s,9)
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-user-callerid:9] GotoIf("SIP/202.33.120.217-000000cc", "0?continue") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-user-callerid:10] Set("SIP/202.33.120.217-000000cc", "__TTL=64") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-user-callerid:11] GotoIf("SIP/202.33.120.217-000000cc", "1?continue") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Goto (macro-user-callerid,s,18)
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-user-callerid:18] NoOp("SIP/202.33.120.217-000000cc", "Using CallerID "Mr. Spiderman" <5149999999>") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-exten-vm:2] Set("SIP/202.33.120.217-000000cc", "RingGroupMethod=none") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-exten-vm:3] Set("SIP/202.33.120.217-000000cc", "VMBOX=5141111111") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-exten-vm:4] Set("SIP/202.33.120.217-000000cc", "__EXTTOCALL=5141111111") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-exten-vm:5] Set("SIP/202.33.120.217-000000cc", "CFUEXT=") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-exten-vm:6] Set("SIP/202.33.120.217-000000cc", "CFBEXT=") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-exten-vm:7] Set("SIP/202.33.120.217-000000cc", "RT=25") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-exten-vm:8] Macro("SIP/202.33.120.217-000000cc", "record-enable,5141111111,IN") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-record-enable:1] MacroExit("SIP/202.33.120.217-000000cc", "") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-exten-vm:9] Macro("SIP/202.33.120.217-000000cc", "dial-one,25,tr,5141111111") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-dial-one:1] Set("SIP/202.33.120.217-000000cc", "DEXTEN=5141111111") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-dial-one:2] Set("SIP/202.33.120.217-000000cc", "DIALSTATUS_CW=") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-dial-one:3] GosubIf("SIP/202.33.120.217-000000cc", "0?screen,1") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-dial-one:4] GosubIf("SIP/202.33.120.217-000000cc", "1?cf,1") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [cf@macro-dial-one:1] Set("SIP/202.33.120.217-000000cc", "CFAMPUSER=5149999999") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [cf@macro-dial-one:2] ExecIf("SIP/202.33.120.217-000000cc", "0?Return()") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [cf@macro-dial-one:3] Set("SIP/202.33.120.217-000000cc", "DEXTEN=225145555555#") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [cf@macro-dial-one:4] ExecIf("SIP/202.33.120.217-000000cc", "1?Return()") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-dial-one:5] GotoIf("SIP/202.33.120.217-000000cc", "1?skip1") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Goto (macro-dial-one,s,8)
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-dial-one:8] GotoIf("SIP/202.33.120.217-000000cc", "0?nodial") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-dial-one:9] GotoIf("SIP/202.33.120.217-000000cc", "1?continue") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Goto (macro-dial-one,s,25)
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-dial-one:25] GotoIf("SIP/202.33.120.217-000000cc", "0?nodial") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-dial-one:26] GosubIf("SIP/202.33.120.217-000000cc", "0?dstring,1:dlocal,1") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [dlocal@macro-dial-one:1] Set("SIP/202.33.120.217-000000cc", "DSTRING=Local/225145555555@from-internal/n") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [dlocal@macro-dial-one:2] Return("SIP/202.33.120.217-000000cc", "") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-dial-one:27] GotoIf("SIP/202.33.120.217-000000cc", "0?nodial") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-dial-one:28] GotoIf("SIP/202.33.120.217-000000cc", "0?skiptrace") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-dial-one:29] GosubIf("SIP/202.33.120.217-000000cc", "1?ctset,1:ctclear,1") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [ctset@macro-dial-one:1] Set("SIP/202.33.120.217-000000cc", "DB(CALLTRACE/225145555555#)=5149999999") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [ctset@macro-dial-one:2] Return("SIP/202.33.120.217-000000cc", "") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-dial-one:30] Set("SIP/202.33.120.217-000000cc", "D_OPTIONS=tr") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-dial-one:31] ExecIf("SIP/202.33.120.217-000000cc", "0?SIPAddHeader(Alert-Info: )") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-dial-one:32] ExecIf("SIP/202.33.120.217-000000cc", "0?SIPAddHeader()") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-dial-one:33] ExecIf("SIP/202.33.120.217-000000cc", "0?SetMusicOnHold()") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-dial-one:34] GosubIf("SIP/202.33.120.217-000000cc", "0?qwait,1") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-dial-one:35] Set("SIP/202.33.120.217-000000cc", "__CWIGNORE=") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-dial-one:36] Set("SIP/202.33.120.217-000000cc", "__KEEPCID=TRUE") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] pbx.c: -- Executing [s@macro-dial-one:37] Dial("SIP/202.33.120.217-000000cc", "Local/225145555555@from-internal/n,25,tr") in new stack
[2010-12-18 20:05:45] VERBOSE[17349] app_dial.c: -- Called 225145555555@from-internal/n
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [225145555555@from-internal:1] Macro("Local/225145555555@from-internal-e1c7;2", "user-callerid,SKIPTTL,") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [s@macro-user-callerid:1] Set("Local/225145555555@from-internal-e1c7;2", "AMPUSER=5149999999") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [s@macro-user-callerid:2] GotoIf("Local/225145555555@from-internal-e1c7;2", "1?report") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Goto (macro-user-callerid,s,9)
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [s@macro-user-callerid:9] GotoIf("Local/225145555555@from-internal-e1c7;2", "1?continue") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Goto (macro-user-callerid,s,18)
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [s@macro-user-callerid:18] NoOp("Local/225145555555@from-internal-e1c7;2", "Using CallerID "Mr. Spiderman" <5149999999>") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [225145555555@from-internal:2] NoOp("Local/225145555555@from-internal-e1c7;2", "Calling Out Route: Montreal") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [225145555555@from-internal:3] Set("Local/225145555555@from-internal-e1c7;2", "MOHCLASS=default") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [225145555555@from-internal:4] Set("Local/225145555555@from-internal-e1c7;2", "_NODEST=") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [225145555555@from-internal:5] Macro("Local/225145555555@from-internal-e1c7;2", "record-enable,5149999999,OUT,") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [s@macro-record-enable:1] MacroExit("Local/225145555555@from-internal-e1c7;2", "") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [225145555555@from-internal:6] Macro("Local/225145555555@from-internal-e1c7;2", "dialout-enum,6,225145555555,") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [s@macro-dialout-enum:1] GosubIf("Local/225145555555@from-internal-e1c7;2", "0?sub-pincheck,s,1") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [s@macro-dialout-enum:2] Macro("Local/225145555555@from-internal-e1c7;2", "outbound-callerid,6") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [s@macro-outbound-callerid:1] ExecIf("Local/225145555555@from-internal-e1c7;2", "0?Set(CALLERPRES()=)") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [s@macro-outbound-callerid:2] ExecIf("Local/225145555555@from-internal-e1c7;2", "1?Set(REALCALLERIDNUM=5149999999)") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [s@macro-outbound-callerid:3] GotoIf("Local/225145555555@from-internal-e1c7;2", "0?normcid") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [s@macro-outbound-callerid:4] Set("Local/225145555555@from-internal-e1c7;2", "USEROUTCID=5149999999") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [s@macro-outbound-callerid:5] GotoIf("Local/225145555555@from-internal-e1c7;2", "1?bypass") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Goto (macro-outbound-callerid,s,7)
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [s@macro-outbound-callerid:7] Set("Local/225145555555@from-internal-e1c7;2", "EMERGENCYCID=") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [s@macro-outbound-callerid:8] Set("Local/225145555555@from-internal-e1c7;2", "TRUNKOUTCID=") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [s@macro-outbound-callerid:9] GotoIf("Local/225145555555@from-internal-e1c7;2", "1?trunkcid") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Goto (macro-outbound-callerid,s,12)
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [s@macro-outbound-callerid:12] ExecIf("Local/225145555555@from-internal-e1c7;2", "0?Set(CALLERID(all)=)") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [s@macro-outbound-callerid:13] ExecIf("Local/225145555555@from-internal-e1c7;2", "1?Set(CALLERID(all)=5149999999)") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [s@macro-outbound-callerid:14] ExecIf("Local/225145555555@from-internal-e1c7;2", "0?Set(CALLERID(all)=)") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [s@macro-outbound-callerid:15] ExecIf("Local/225145555555@from-internal-e1c7;2", "0?Set(CALLERPRES()=prohib_passed_screen)") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [s@macro-dialout-enum:3] Set("Local/225145555555@from-internal-e1c7;2", "OUTBOUND_GROUP=OUT_6") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Executing [s@macro-dialout-enum:4] GotoIf("Local/225145555555@from-internal-e1c7;2", "1?nomax") in new stack
[2010-12-18 20:05:45] VERBOSE[17350] pbx.c: -- Goto (macro-dialout-enum,s,6)

I had similar trouble, the same scenario and a slightly different one. I’ve found it to be a setting on the inbound route.

Change the privacy manager setting to yes.

This worked for me for my external dials to another freepbx system on a vpn, but I imagine it it will work for actual external dialing as well. I am using PBX in a flash Purple

Also sorry about posting on an old post, but hey I found a fix.