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 [[email protected]:20] GotoIf(“PJSIP/99-0000001e”, “0?bypass,1”) in new stack
– Executing [[email protected]:21] ExecIf(“PJSIP/99-0000001e”, “1?Set(CONNECTEDLINE(num,i)=+61xxxxxxxxx)”) in new stack
– Executing [[email protected]:22] ExecIf(“PJSIP/99-0000001e”, “1?Set(CONNECTEDLINE(name,i)=CID:+39055yyyyyy)”) in new stack
– Executing [[email protected]:23] ExecIf(“PJSIP/99-0000001e”, “0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)+39055yyyyyy)”) in new stack
– Executing [[email protected]:24] GotoIf(“PJSIP/99-0000001e”, “0?customtrunk”) in new stack
– Executing [[email protected]: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 [[email protected]:1] Macro("PJSIP/99-0000001e", "user-callerid,LIMIT,EXTERNAL,") in new stack
    -- Executing [[email protected]:1] Set("PJSIP/99-0000001e", "TOUCH_MONITOR=1540643169.50") in new stack
    -- Executing [[email protected]:2] Set("PJSIP/99-0000001e", "AMPUSER=99") in new stack
    -- Executing [[email protected]:3] GotoIf("PJSIP/99-0000001e", "0?report") in new stack
    -- Executing [[email protected]:4] ExecIf("PJSIP/99-0000001e", "1?Set(REALCALLERIDNUM=99)") in new stack
    -- Executing [[email protected]:5] Set("PJSIP/99-0000001e", "AMPUSER=99") in new stack
    -- Executing [[email protected]:6] GotoIf("PJSIP/99-0000001e", "0?limit") in new stack
    -- Executing [[email protected]:7] Set("PJSIP/99-0000001e", "AMPUSERCIDNAME=Michele") in new stack
    -- Executing [[email protected]:8] ExecIf("PJSIP/99-0000001e", "0?Set(__CIDMASQUERADING=TRUE)") in new stack
    -- Executing [[email protected]:9] GotoIf("PJSIP/99-0000001e", "0?report") in new stack
    -- Executing [[email protected]:10] Set("PJSIP/99-0000001e", "AMPUSERCID=99") in new stack
    -- Executing [[email protected]:11] Set("PJSIP/99-0000001e", "__DIAL_OPTIONS=Ttr") in new stack
    -- Executing [[email protected]:12] Set("PJSIP/99-0000001e", "CALLERID(all)="Michele" <99>") in new stack
    -- Executing [[email protected]:13] GotoIf("PJSIP/99-0000001e", "0?limit") in new stack
    -- Executing [[email protected]:14] ExecIf("PJSIP/99-0000001e", "1?Set(GROUP(concurrency_limit)=99)") in new stack
    -- Executing [[email protected]:15] ExecIf("PJSIP/99-0000001e", "0?Set(CHANNEL(language)=)") in new stack
    -- Executing [[email protected]:16] NoOp("PJSIP/99-0000001e", "Macro Depth is 1") in new stack
    -- Executing [[email protected]:17] GotoIf("PJSIP/99-0000001e", "1?report2:macroerror") in new stack
    -- Goto (macro-user-callerid,s,18)
    -- Executing [[email protected]:18] GotoIf("PJSIP/99-0000001e", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,37)
    -- Executing [[email protected]:37] Set("PJSIP/99-0000001e", "CALLERID(number)=99") in new stack
    -- Executing [[email protected]:38] Set("PJSIP/99-0000001e", "CALLERID(name)=Michele") in new stack
    -- Executing [[email protected]:39] GotoIf("PJSIP/99-0000001e", "0?cnum") in new stack
    -- Executing [[email protected]:40] Set("PJSIP/99-0000001e", "CDR(cnam)=Michele") in new stack
    -- Executing [[email protected]:41] Set("PJSIP/99-0000001e", "CDR(cnum)=99") in new stack
    -- Executing [[email protected]:42] Set("PJSIP/99-0000001e", "CHANNEL(language)=it") in new stack
    -- Executing [[email protected]:2] Gosub("PJSIP/99-0000001e", "sub-record-check,s,1(out,+61xxxxxxxxx,dontcare)") in new stack
    -- Executing [[email protected]:1] GotoIf("PJSIP/99-0000001e", "0?initialized") in new stack
    -- Executing [[email protected]:2] Set("PJSIP/99-0000001e", "__REC_STATUS=INITIALIZED") in new stack
    -- Executing [[email protected]:3] Set("PJSIP/99-0000001e", "NOW=1540643169") in new stack
    -- Executing [[email protected]:4] Set("PJSIP/99-0000001e", "__DAY=27") in new stack
    -- Executing [[email protected]:5] Set("PJSIP/99-0000001e", "__MONTH=10") in new stack
    -- Executing [[email protected]:6] Set("PJSIP/99-0000001e", "__YEAR=2018") in new stack
    -- Executing [[email protected]:7] Set("PJSIP/99-0000001e", "__TIMESTR=20181027-142609") in new stack
    -- Executing [[email protected]:8] Set("PJSIP/99-0000001e", "__FROMEXTEN=99") in new stack
    -- Executing [[email protected]:9] Set("PJSIP/99-0000001e", "__MON_FMT=wav") in new stack
    -- Executing [[email protected]:10] NoOp("PJSIP/99-0000001e", "Recordings initialized") in new stack
    -- Executing [[email protected]:11] ExecIf("PJSIP/99-0000001e", "0?Set(ARG3=dontcare)") in new stack
    -- Executing [[email protected]:12] Set("PJSIP/99-0000001e", "REC_POLICY_MODE_SAVE=") in new stack
    -- Executing [[email protected]:13] ExecIf("PJSIP/99-0000001e", "0?Set(REC_STATUS=NO)") in new stack
    -- Executing [[email protected]:14] GotoIf("PJSIP/99-0000001e", "3?checkaction") in new stack
    -- Goto (sub-record-check,s,17)
    -- Executing [[email protected]:17] GotoIf("PJSIP/99-0000001e", "1?sub-record-check,out,1") in new stack
    -- Goto (sub-record-check,out,1)
    -- Executing [[email protected]:1] NoOp("PJSIP/99-0000001e", "Outbound Recording Check from 99 to +61xxxxxxxxx") in new stack
    -- Executing [[email protected]:2] Set("PJSIP/99-0000001e", "RECMODE=dontcare") in new stack
    -- Executing [[email protected]:3] ExecIf("PJSIP/99-0000001e", "1?Goto(routewins)") in new stack
    -- Goto (sub-record-check,out,7)
    -- Executing [[email protected]:7] Gosub("PJSIP/99-0000001e", "recordcheck,1(dontcare,out,+61xxxxxxxxx)") in new stack
    -- Executing [[email protected]:1] NoOp("PJSIP/99-0000001e", "Starting recording check against dontcare") in new stack
    -- Executing [[email protected]:2] Goto("PJSIP/99-0000001e", "dontcare") in new stack
    -- Goto (sub-record-check,recordcheck,3)
    -- Executing [[email protected]:3] Return("PJSIP/99-0000001e", "") in new stack
    -- Executing [[email protected]:8] Return("PJSIP/99-0000001e", "") in new stack
    -- Executing [[email protected]:3] ExecIf("PJSIP/99-0000001e", "0 ?Set(CDR(accountcode)=)") in new stack
    -- Executing [[email protected]:4] Set("PJSIP/99-0000001e", "MOHCLASS=default") in new stack
    -- Executing [[email protected]:5] Set("PJSIP/99-0000001e", "_NODEST=") in new stack
    -- Executing [[email protected]:6] Macro("PJSIP/99-0000001e", "dialout-trunk,2,+61xxxxxxxxx,,off") in new stack
    -- Executing [[email protected]:1] Set("PJSIP/99-0000001e", "DIAL_TRUNK=2") in new stack
    -- Executing [[email protected]:2] ExecIf("PJSIP/99-0000001e", "0?Set(DIAL_OPTIONS=tr)") in new stack
    -- Executing [[email protected]:3] GosubIf("PJSIP/99-0000001e", "0?sub-pincheck,s,1()") in new stack
    -- Executing [[email protected]:4] ExecIf("PJSIP/99-0000001e", "0?Set(CALLERID(num)=99)") in new stack
    -- Executing [[email protected]:5] GotoIf("PJSIP/99-0000001e", "0?disabletrunk,1") in new stack
    -- Executing [[email protected]:6] Set("PJSIP/99-0000001e", "DIAL_NUMBER=+61xxxxxxxxx") in new stack
    -- Executing [[email protected]:7] Set("PJSIP/99-0000001e", "DIAL_TRUNK_OPTIONS=Ttr") in new stack
    -- Executing [[email protected]:8] Set("PJSIP/99-0000001e", "OUTBOUND_GROUP=OUT_2") in new stack
    -- Executing [[email protected]:9] Set("PJSIP/99-0000001e", "DIAL_TRUNK_OPTIONS=T") in new stack
    -- Executing [[email protected]:10] GotoIf("PJSIP/99-0000001e", "0?nomax") in new stack
    -- Executing [[email protected]:11] GotoIf("PJSIP/99-0000001e", "0?chanfull") in new stack
    -- Executing [[email protected]:12] GotoIf("PJSIP/99-0000001e", "0?skipoutcid") in new stack
    -- Executing [[email protected]alout-trunk:13] Macro("PJSIP/99-0000001e", "outbound-callerid,2") in new stack
    -- Executing [[email protected]:1] NoOp("PJSIP/99-0000001e", "99") in new stack
    -- Executing [[email protected]:2] NoOp("PJSIP/99-0000001e", "") in new stack
    -- Executing [[email protected]:3] NoOp("PJSIP/99-0000001e", "all") in new stack
    -- Executing [[email protected]:4] ExecIf("PJSIP/99-0000001e", "0?Set(CALLERPRES(name-pres)=)") in new stack
    -- Executing [[email protected]:5] ExecIf("PJSIP/99-0000001e", "0?Set(CALLERPRES(num-pres)=)") in new stack
    -- Executing [[email protected]:6] ExecIf("PJSIP/99-0000001e", "0?Set(REALCALLERIDNUM=99)") in new stack
    -- Executing [[email protected]:7] ExecIf("PJSIP/99-0000001e", "0?Set(AMPUSER=99)") in new stack
    -- Executing [[email protected]:8] GotoIf("PJSIP/99-0000001e", "1?normcid") in new stack
    -- Goto (macro-outbound-callerid,s,12)
    -- Executing [[email protected]:12] Set("PJSIP/99-0000001e", "USEROUTCID=") in new stack
    -- Executing [[email protected]:13] Set("PJSIP/99-0000001e", "EMERGENCYCID=") in new stack
    -- Executing [[email protected]:14] Set("PJSIP/99-0000001e", "TRUNKOUTCID=+39055599999") in new stack
    -- Executing [[email protected]:15] GotoIf("PJSIP/99-0000001e", "1?trunkcid") in new stack
    -- Goto (macro-outbound-callerid,s,20)
    -- Executing [[email protected]:20] ExecIf("PJSIP/99-0000001e", "1?Set(CALLERID(all)=+39055599999)") in new stack
    -- Executing [[email protected]:21] ExecIf("PJSIP/99-0000001e", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [[email protected]:22] ExecIf("PJSIP/99-0000001e", "1?Set(CALLERID(all)=+39055599999)") in new stack
    -- Executing [[email protected]:23] ExecIf("PJSIP/99-0000001e", "0?Set(CALLERPRES(name-pres)=prohib_passed_screen)") in new stack
    -- Executing [[email protected]:24] ExecIf("PJSIP/99-0000001e", "0?Set(CALLERPRES(num-pres)=prohib_passed_screen)") in new stack
    -- Executing [[email protected]:25] Set("PJSIP/99-0000001e", "CDR(outbound_cnum)=+39055599999") in new stack
    -- Executing [[email protected]:26] Set("PJSIP/99-0000001e", "CDR(outbound_cnam)=") in new stack
    -- Executing [[email protected]:14] GosubIf("PJSIP/99-0000001e", "1?sub-flp-2,s,1()") in new stack
    -- Executing [[email protected]:1] ExecIf("PJSIP/99-0000001e", "0?Return()") in new stack
    -- Executing [[email protected]:2] Return("PJSIP/99-0000001e", "") in new stack
    -- Executing [[email protected]:15] Set("PJSIP/99-0000001e", "OUTNUM=+61xxxxxxxxx") in new stack
    -- Executing [[email protected]:16] Set("PJSIP/99-0000001e", "custom=SIP/messagenet") in new stack
    -- Executing [[email protected]:17] ExecIf("PJSIP/99-0000001e", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)T)") in new stack
    -- Executing [[email protected]:18] ExecIf("PJSIP/99-0000001e", "0?Set(DIAL_TRUNK_OPTIONS=TM(confirm))") in new stack
    -- Executing [[email protected]:19] Macro("PJSIP/99-0000001e", "dialout-trunk-predial-hook,") in new stack
    -- Executing [[email protected]:1] MacroExit("PJSIP/99-0000001e", "") in new stack
    -- Executing [[email protected]:20] GotoIf("PJSIP/99-0000001e", "0?bypass,1") in new stack
    -- Executing [[email protected]:21] ExecIf("PJSIP/99-0000001e", "1?Set(CONNECTEDLINE(num,i)=+61xxxxxxxxx)") in new stack
    -- Executing [[email protected]:22] ExecIf("PJSIP/99-0000001e", "1?Set(CONNECTEDLINE(name,i)=CID:+39055599999)") in new stack
    -- Executing [[email protected]:23] ExecIf("PJSIP/99-0000001e", "0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)+39055599999)") in new stack
    -- Executing [[email protected]:24] GotoIf("PJSIP/99-0000001e", "0?customtrunk") in new stack
    -- Executing [[email protected]: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 [[email protected]:1] NoOp("SIP/messagenet-00000014", "Applying SIP Headers to channel") in new stack
    -- Executing [[email protected]:2] Set("SIP/messagenet-00000014", "SIPHEADERKEYS=") in new stack
    -- Executing [[email protected]:3] ExecIf("SIP/messagenet-00000014", "0?Set(Rheader=1)") in new stack
    -- Executing [[email protected]:4] While("SIP/messagenet-00000014", "0") in new stack
    -- Jumping to priority 8
    -- Executing [[email protected]:9] ExecIf("SIP/messagenet-00000014", "0?SIPRemoveHeader(Alert-Info:)") in new stack
    -- Executing [[email protected]:10] ExecIf("SIP/messagenet-00000014", "0?Set(PJSIP_HEADER(remove,Alert-Info)=)") in new stack
    -- Executing [[email protected]: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 [[email protected]:1] Macro("PJSIP/99-0000001e", "hangupcall") in new stack
    -- Executing [[email protected]:1] GotoIf("PJSIP/99-0000001e", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,3)
    -- Executing [[email protected]:3] ExecIf("PJSIP/99-0000001e", "0?Set(CDR(recordingfile)=)") in new stack
    -- Executing [[email protected]:4] NoOp("PJSIP/99-0000001e", "SIP/messagenet-00000014 monior file= ") in new stack
    -- Executing [[email protected]: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 [[email protected]: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.