Outbound call on PJSIP showing anonymous with no CID

Hello - I read read lots of threads on missing outbound CID but I have not been able to get to anything to solve it. I am on FreePBX14/Asterisk13.

Below the trace of a test call to number +61xxxxx, where the trunk is set to pass its CID +39055xxxxxxx.

  • If I make the call from a SIP client connected straight to the SIP provider, with no Asterisk, all works good and the call receiver sees the CID
  • If I make the call from FreePBX the call receiver sees anonymous caller no matter the trunk settings I have including “force CID”
  • what I noticed is a “CID:(hidden)” and “customtrunk” tag that made be worried of something wrong going on:

– Executing [s@macro-dialout-trunk:20] GotoIf(“PJSIP/99-0000001e”, “0?bypass,1”) in new stack
– Executing [s@macro-dialout-trunk:21] ExecIf(“PJSIP/99-0000001e”, “1?Set(CONNECTEDLINE(num,i)=+61xxxxxxxxx)”) in new stack
– Executing [s@macro-dialout-trunk:22] ExecIf(“PJSIP/99-0000001e”, “1?Set(CONNECTEDLINE(name,i)=CID:+39055yyyyyy)”) in new stack
– Executing [s@macro-dialout-trunk:23] ExecIf(“PJSIP/99-0000001e”, “0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)+39055yyyyyy)”) in new stack
– Executing [s@macro-dialout-trunk:24] GotoIf(“PJSIP/99-0000001e”, “0?customtrunk”) in new stack
– Executing [s@macro-dialout-trunk:25] Dial(“PJSIP/99-0000001e”, “SIP/messagenet/+61xxxxxxxxx,300,Tb(func-apply-sipheaders^s^1)”) in new stack

I would appreciate any hint you can provide

Call trace:

-- Executing [+61xxxxxxxxx@from-internal:1] Macro("PJSIP/99-0000001e", "user-callerid,LIMIT,EXTERNAL,") in new stack
    -- Executing [s@macro-user-callerid:1] Set("PJSIP/99-0000001e", "TOUCH_MONITOR=1540643169.50") in new stack
    -- Executing [s@macro-user-callerid:2] Set("PJSIP/99-0000001e", "AMPUSER=99") in new stack
    -- Executing [s@macro-user-callerid:3] GotoIf("PJSIP/99-0000001e", "0?report") in new stack
    -- Executing [s@macro-user-callerid:4] ExecIf("PJSIP/99-0000001e", "1?Set(REALCALLERIDNUM=99)") in new stack
    -- Executing [s@macro-user-callerid:5] Set("PJSIP/99-0000001e", "AMPUSER=99") in new stack
    -- Executing [s@macro-user-callerid:6] GotoIf("PJSIP/99-0000001e", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:7] Set("PJSIP/99-0000001e", "AMPUSERCIDNAME=Michele") in new stack
    -- Executing [s@macro-user-callerid:8] ExecIf("PJSIP/99-0000001e", "0?Set(__CIDMASQUERADING=TRUE)") in new stack
    -- Executing [s@macro-user-callerid:9] GotoIf("PJSIP/99-0000001e", "0?report") in new stack
    -- Executing [s@macro-user-callerid:10] Set("PJSIP/99-0000001e", "AMPUSERCID=99") in new stack
    -- Executing [s@macro-user-callerid:11] Set("PJSIP/99-0000001e", "__DIAL_OPTIONS=Ttr") in new stack
    -- Executing [s@macro-user-callerid:12] Set("PJSIP/99-0000001e", "CALLERID(all)="Michele" <99>") in new stack
    -- Executing [s@macro-user-callerid:13] GotoIf("PJSIP/99-0000001e", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:14] ExecIf("PJSIP/99-0000001e", "1?Set(GROUP(concurrency_limit)=99)") in new stack
    -- Executing [s@macro-user-callerid:15] ExecIf("PJSIP/99-0000001e", "0?Set(CHANNEL(language)=)") in new stack
    -- Executing [s@macro-user-callerid:16] NoOp("PJSIP/99-0000001e", "Macro Depth is 1") in new stack
    -- Executing [s@macro-user-callerid:17] GotoIf("PJSIP/99-0000001e", "1?report2:macroerror") in new stack
    -- Goto (macro-user-callerid,s,18)
    -- Executing [s@macro-user-callerid:18] GotoIf("PJSIP/99-0000001e", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,37)
    -- Executing [s@macro-user-callerid:37] Set("PJSIP/99-0000001e", "CALLERID(number)=99") in new stack
    -- Executing [s@macro-user-callerid:38] Set("PJSIP/99-0000001e", "CALLERID(name)=Michele") in new stack
    -- Executing [s@macro-user-callerid:39] GotoIf("PJSIP/99-0000001e", "0?cnum") in new stack
    -- Executing [s@macro-user-callerid:40] Set("PJSIP/99-0000001e", "CDR(cnam)=Michele") in new stack
    -- Executing [s@macro-user-callerid:41] Set("PJSIP/99-0000001e", "CDR(cnum)=99") in new stack
    -- Executing [s@macro-user-callerid:42] Set("PJSIP/99-0000001e", "CHANNEL(language)=it") in new stack
    -- Executing [+61xxxxxxxxx@from-internal:2] Gosub("PJSIP/99-0000001e", "sub-record-check,s,1(out,+61xxxxxxxxx,dontcare)") in new stack
    -- Executing [s@sub-record-check:1] GotoIf("PJSIP/99-0000001e", "0?initialized") in new stack
    -- Executing [s@sub-record-check:2] Set("PJSIP/99-0000001e", "__REC_STATUS=INITIALIZED") in new stack
    -- Executing [s@sub-record-check:3] Set("PJSIP/99-0000001e", "NOW=1540643169") in new stack
    -- Executing [s@sub-record-check:4] Set("PJSIP/99-0000001e", "__DAY=27") in new stack
    -- Executing [s@sub-record-check:5] Set("PJSIP/99-0000001e", "__MONTH=10") in new stack
    -- Executing [s@sub-record-check:6] Set("PJSIP/99-0000001e", "__YEAR=2018") in new stack
    -- Executing [s@sub-record-check:7] Set("PJSIP/99-0000001e", "__TIMESTR=20181027-142609") in new stack
    -- Executing [s@sub-record-check:8] Set("PJSIP/99-0000001e", "__FROMEXTEN=99") in new stack
    -- Executing [s@sub-record-check:9] Set("PJSIP/99-0000001e", "__MON_FMT=wav") in new stack
    -- Executing [s@sub-record-check:10] NoOp("PJSIP/99-0000001e", "Recordings initialized") in new stack
    -- Executing [s@sub-record-check:11] ExecIf("PJSIP/99-0000001e", "0?Set(ARG3=dontcare)") in new stack
    -- Executing [s@sub-record-check:12] Set("PJSIP/99-0000001e", "REC_POLICY_MODE_SAVE=") in new stack
    -- Executing [s@sub-record-check:13] ExecIf("PJSIP/99-0000001e", "0?Set(REC_STATUS=NO)") in new stack
    -- Executing [s@sub-record-check:14] GotoIf("PJSIP/99-0000001e", "3?checkaction") in new stack
    -- Goto (sub-record-check,s,17)
    -- Executing [s@sub-record-check:17] GotoIf("PJSIP/99-0000001e", "1?sub-record-check,out,1") in new stack
    -- Goto (sub-record-check,out,1)
    -- Executing [out@sub-record-check:1] NoOp("PJSIP/99-0000001e", "Outbound Recording Check from 99 to +61xxxxxxxxx") in new stack
    -- Executing [out@sub-record-check:2] Set("PJSIP/99-0000001e", "RECMODE=dontcare") in new stack
    -- Executing [out@sub-record-check:3] ExecIf("PJSIP/99-0000001e", "1?Goto(routewins)") in new stack
    -- Goto (sub-record-check,out,7)
    -- Executing [out@sub-record-check:7] Gosub("PJSIP/99-0000001e", "recordcheck,1(dontcare,out,+61xxxxxxxxx)") in new stack
    -- Executing [recordcheck@sub-record-check:1] NoOp("PJSIP/99-0000001e", "Starting recording check against dontcare") in new stack
    -- Executing [recordcheck@sub-record-check:2] Goto("PJSIP/99-0000001e", "dontcare") in new stack
    -- Goto (sub-record-check,recordcheck,3)
    -- Executing [recordcheck@sub-record-check:3] Return("PJSIP/99-0000001e", "") in new stack
    -- Executing [out@sub-record-check:8] Return("PJSIP/99-0000001e", "") in new stack
    -- Executing [+61xxxxxxxxx@from-internal:3] ExecIf("PJSIP/99-0000001e", "0 ?Set(CDR(accountcode)=)") in new stack
    -- Executing [+61xxxxxxxxx@from-internal:4] Set("PJSIP/99-0000001e", "MOHCLASS=default") in new stack
    -- Executing [+61xxxxxxxxx@from-internal:5] Set("PJSIP/99-0000001e", "_NODEST=") in new stack
    -- Executing [+61xxxxxxxxx@from-internal:6] Macro("PJSIP/99-0000001e", "dialout-trunk,2,+61xxxxxxxxx,,off") in new stack
    -- Executing [s@macro-dialout-trunk:1] Set("PJSIP/99-0000001e", "DIAL_TRUNK=2") in new stack
    -- Executing [s@macro-dialout-trunk:2] ExecIf("PJSIP/99-0000001e", "0?Set(DIAL_OPTIONS=tr)") in new stack
    -- Executing [s@macro-dialout-trunk:3] GosubIf("PJSIP/99-0000001e", "0?sub-pincheck,s,1()") in new stack
    -- Executing [s@macro-dialout-trunk:4] ExecIf("PJSIP/99-0000001e", "0?Set(CALLERID(num)=99)") in new stack
    -- Executing [s@macro-dialout-trunk:5] GotoIf("PJSIP/99-0000001e", "0?disabletrunk,1") in new stack
    -- Executing [s@macro-dialout-trunk:6] Set("PJSIP/99-0000001e", "DIAL_NUMBER=+61xxxxxxxxx") in new stack
    -- Executing [s@macro-dialout-trunk:7] Set("PJSIP/99-0000001e", "DIAL_TRUNK_OPTIONS=Ttr") in new stack
    -- Executing [s@macro-dialout-trunk:8] Set("PJSIP/99-0000001e", "OUTBOUND_GROUP=OUT_2") in new stack
    -- Executing [s@macro-dialout-trunk:9] Set("PJSIP/99-0000001e", "DIAL_TRUNK_OPTIONS=T") in new stack
    -- Executing [s@macro-dialout-trunk:10] GotoIf("PJSIP/99-0000001e", "0?nomax") in new stack
    -- Executing [s@macro-dialout-trunk:11] GotoIf("PJSIP/99-0000001e", "0?chanfull") in new stack
    -- Executing [s@macro-dialout-trunk:12] GotoIf("PJSIP/99-0000001e", "0?skipoutcid") in new stack
    -- Executing [s@macro-dialout-trunk:13] Macro("PJSIP/99-0000001e", "outbound-callerid,2") in new stack
    -- Executing [s@macro-outbound-callerid:1] NoOp("PJSIP/99-0000001e", "99") in new stack
    -- Executing [s@macro-outbound-callerid:2] NoOp("PJSIP/99-0000001e", "") in new stack
    -- Executing [s@macro-outbound-callerid:3] NoOp("PJSIP/99-0000001e", "all") in new stack
    -- Executing [s@macro-outbound-callerid:4] ExecIf("PJSIP/99-0000001e", "0?Set(CALLERPRES(name-pres)=)") in new stack
    -- Executing [s@macro-outbound-callerid:5] ExecIf("PJSIP/99-0000001e", "0?Set(CALLERPRES(num-pres)=)") in new stack
    -- Executing [s@macro-outbound-callerid:6] ExecIf("PJSIP/99-0000001e", "0?Set(REALCALLERIDNUM=99)") in new stack
    -- Executing [s@macro-outbound-callerid:7] ExecIf("PJSIP/99-0000001e", "0?Set(AMPUSER=99)") in new stack
    -- Executing [s@macro-outbound-callerid:8] GotoIf("PJSIP/99-0000001e", "1?normcid") in new stack
    -- Goto (macro-outbound-callerid,s,12)
    -- Executing [s@macro-outbound-callerid:12] Set("PJSIP/99-0000001e", "USEROUTCID=") in new stack
    -- Executing [s@macro-outbound-callerid:13] Set("PJSIP/99-0000001e", "EMERGENCYCID=") in new stack
    -- Executing [s@macro-outbound-callerid:14] Set("PJSIP/99-0000001e", "TRUNKOUTCID=+39055599999") in new stack
    -- Executing [s@macro-outbound-callerid:15] GotoIf("PJSIP/99-0000001e", "1?trunkcid") in new stack
    -- Goto (macro-outbound-callerid,s,20)
    -- Executing [s@macro-outbound-callerid:20] ExecIf("PJSIP/99-0000001e", "1?Set(CALLERID(all)=+39055599999)") in new stack
    -- Executing [s@macro-outbound-callerid:21] ExecIf("PJSIP/99-0000001e", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [s@macro-outbound-callerid:22] ExecIf("PJSIP/99-0000001e", "1?Set(CALLERID(all)=+39055599999)") in new stack
    -- Executing [s@macro-outbound-callerid:23] ExecIf("PJSIP/99-0000001e", "0?Set(CALLERPRES(name-pres)=prohib_passed_screen)") in new stack
    -- Executing [s@macro-outbound-callerid:24] ExecIf("PJSIP/99-0000001e", "0?Set(CALLERPRES(num-pres)=prohib_passed_screen)") in new stack
    -- Executing [s@macro-outbound-callerid:25] Set("PJSIP/99-0000001e", "CDR(outbound_cnum)=+39055599999") in new stack
    -- Executing [s@macro-outbound-callerid:26] Set("PJSIP/99-0000001e", "CDR(outbound_cnam)=") in new stack
    -- Executing [s@macro-dialout-trunk:14] GosubIf("PJSIP/99-0000001e", "1?sub-flp-2,s,1()") in new stack
    -- Executing [s@sub-flp-2:1] ExecIf("PJSIP/99-0000001e", "0?Return()") in new stack
    -- Executing [s@sub-flp-2:2] Return("PJSIP/99-0000001e", "") in new stack
    -- Executing [s@macro-dialout-trunk:15] Set("PJSIP/99-0000001e", "OUTNUM=+61xxxxxxxxx") in new stack
    -- Executing [s@macro-dialout-trunk:16] Set("PJSIP/99-0000001e", "custom=SIP/messagenet") in new stack
    -- Executing [s@macro-dialout-trunk:17] ExecIf("PJSIP/99-0000001e", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)T)") in new stack
    -- Executing [s@macro-dialout-trunk:18] ExecIf("PJSIP/99-0000001e", "0?Set(DIAL_TRUNK_OPTIONS=TM(confirm))") in new stack
    -- Executing [s@macro-dialout-trunk:19] Macro("PJSIP/99-0000001e", "dialout-trunk-predial-hook,") in new stack
    -- Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("PJSIP/99-0000001e", "") in new stack
    -- Executing [s@macro-dialout-trunk:20] GotoIf("PJSIP/99-0000001e", "0?bypass,1") in new stack
    -- Executing [s@macro-dialout-trunk:21] ExecIf("PJSIP/99-0000001e", "1?Set(CONNECTEDLINE(num,i)=+61xxxxxxxxx)") in new stack
    -- Executing [s@macro-dialout-trunk:22] ExecIf("PJSIP/99-0000001e", "1?Set(CONNECTEDLINE(name,i)=CID:+39055599999)") in new stack
    -- Executing [s@macro-dialout-trunk:23] ExecIf("PJSIP/99-0000001e", "0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)+39055599999)") in new stack
    -- Executing [s@macro-dialout-trunk:24] GotoIf("PJSIP/99-0000001e", "0?customtrunk") in new stack
    -- Executing [s@macro-dialout-trunk:25] Dial("PJSIP/99-0000001e", "SIP/messagenet/+61xxxxxxxxx,300,Tb(func-apply-sipheaders^s^1)") in new stack
  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
    -- SIP/messagenet-00000014 Internal Gosub(func-apply-sipheaders,s,1) start
    -- Executing [s@func-apply-sipheaders:1] NoOp("SIP/messagenet-00000014", "Applying SIP Headers to channel") in new stack
    -- Executing [s@func-apply-sipheaders:2] Set("SIP/messagenet-00000014", "SIPHEADERKEYS=") in new stack
    -- Executing [s@func-apply-sipheaders:3] ExecIf("SIP/messagenet-00000014", "0?Set(Rheader=1)") in new stack
    -- Executing [s@func-apply-sipheaders:4] While("SIP/messagenet-00000014", "0") in new stack
    -- Jumping to priority 8
    -- Executing [s@func-apply-sipheaders:9] ExecIf("SIP/messagenet-00000014", "0?SIPRemoveHeader(Alert-Info:)") in new stack
    -- Executing [s@func-apply-sipheaders:10] ExecIf("SIP/messagenet-00000014", "0?Set(PJSIP_HEADER(remove,Alert-Info)=)") in new stack
    -- Executing [s@func-apply-sipheaders:11] Return("SIP/messagenet-00000014", "") in new stack
  == Spawn extension (from-trunk-sip-messagenet, +61xxxxxxxxx, 1) exited non-zero on 'SIP/messagenet-00000014'
    -- SIP/messagenet-00000014 Internal Gosub(func-apply-sipheaders,s,1) complete GOSUB_RETVAL=
    -- Called SIP/messagenet/+61xxxxxxxxx
  == Spawn extension (macro-dialout-trunk, s, 25) exited non-zero on 'PJSIP/99-0000001e' in macro 'dialout-trunk'
  == Spawn extension (from-internal, +61xxxxxxxxx, 6) exited non-zero on 'PJSIP/99-0000001e'
    -- Executing [h@from-internal:1] Macro("PJSIP/99-0000001e", "hangupcall") in new stack
    -- Executing [s@macro-hangupcall:1] GotoIf("PJSIP/99-0000001e", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,3)
    -- Executing [s@macro-hangupcall:3] ExecIf("PJSIP/99-0000001e", "0?Set(CDR(recordingfile)=)") in new stack
    -- Executing [s@macro-hangupcall:4] NoOp("PJSIP/99-0000001e", "SIP/messagenet-00000014 monior file= ") in new stack
    -- Executing [s@macro-hangupcall:5] AGI("PJSIP/99-0000001e", "attendedtransfer-rec-restart.php,SIP/messagenet-00000014,") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/attendedtransfer-rec-restart.php
    -- <PJSIP/99-0000001e>AGI Script attendedtransfer-rec-restart.php completed, returning 0
    -- Executing [s@macro-hangupcall:6] Hangup("PJSIP/99-0000001e", "") in new stack
  == Spawn extension (macro-hangupcall, s, 6) exited non-zero on 'PJSIP/99-0000001e' in macro 'hangupcall'

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.