CallerID(num) not showing on PJSIP trunk

Hi all. I have a Twilio SIP trunk configured on PJSIP. It was working some days ago, but I think they changed something on their side and now I can’t get the inbound CallerID(num).

Here’s the log:

<--- Received SIP request (1247 bytes) from UDP:177.71.206.192:5060 --->
INVITE sip:+551132300606@sip.asaas.com SIP/2.0
Record-Route: <sip:177.71.206.192:5060;lr;ftag=51023370_6772d868_62e0b4f2-7ac9-441e-822d-94acdcfc6841>
Max-Forwards: 62
To: <sip:+551132300606@sip.asaas.com;user=phone>
From: <sip:+5581983171332@asaas.pstn.twilio.com>;tag=51023370_6772d868_62e0b4f2-7ac9-441e-822d-94acdcfc6841
CSeq: 1 INVITE
Expires: 180
Diversion: <sip:+551132300606@public-vip.br1.twilio.com>;reason=unconditional
Call-ID: 8056515b9a246a57852c88ba0b9d40ce@0.0.0.0
Via: SIP/2.0/UDP 177.71.206.192:5060;branch=z9hG4bKf755.e7e1c123.0
Via: SIP/2.0/UDP 172.19.135.84:5060;rport=5060;received=172.19.135.84;branch=z9hG4bK62e0b4f2-7ac9-441e-822d-94acdcfc6841_6772d868_251-8065418271553484778
Contact: <sip:+5581983171332@172.19.135.84:5060;transport=udp>
Allow: CANCEL,ACK,INVITE,BYE,OPTIONS
User-Agent: Twilio Gateway
X-Twilio-AccountSid: ACad4713fd4856c067e1fa739f264c8f23
Content-Type: application/sdp
X-Twilio-CallSid: CA5111ffecf20c40861fc72c4e70819ef3
Content-Length: 240

And here’s the pjsip.conf:

[twilio]
type=auth
auth_type=userpass
username=myusername
password=notmyrealpassword

[twilio]
type=aor
contact=sip:asaas.pstn.twilio.com:5060
qualify_frequency=15

[twilio]
type=endpoint
context=from-pstn
disallow=all
allow=ulaw
outbound_auth=twilio
aors=twilio
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes

[twilio]
type=identify
endpoint=twilio
match=177.71.206.192
match=177.71.206.193
match=177.71.206.194
match=177.71.206.195

try setting trust_id_inbound=yes

Thanks @ambiorixg12, but it doesn’t work. CallerID(num) is still blank on dialplan and CDR.

Do you have the res_pjsip_callerid module loaded?

Hi @jcolp, yes:

asavs0002l*CLI> module load res_pjsip_caller_id.so 
Unable to load module res_pjsip_caller_id.so
Command 'module load res_pjsip_caller_id.so ' failed.
[May  8 08:00:55] WARNING[29719]: loader.c:1077 load_resource: Module 'res_pjsip_caller_id.so' already exists.

And the full console output?

    -- Executing [+551132300606@from-pstn:1] Goto("PJSIP/twilio-00027b70", "551132300606,1") in new stack
    -- Goto (from-pstn,551132300606,1)
    -- Executing [551132300606@from-pstn:1] Answer("PJSIP/twilio-00027b70", "") in new stack
    -- Executing [551132300606@from-pstn:2] Set("PJSIP/twilio-00027b70", "_FROM_PSTN=twilio") in new stack
    -- Executing [551132300606@from-pstn:3] Set("PJSIP/twilio-00027b70", "MYEXTEN=551132300606") in new stack
    -- Executing [551132300606@from-pstn:4] Set("PJSIP/twilio-00027b70", "MYTIME=075751") in new stack
    -- Executing [551132300606@from-pstn:5] Set("PJSIP/twilio-00027b70", "TIMESTAMP=1525777071") in new stack
    -- Executing [551132300606@from-pstn:6] Set("PJSIP/twilio-00027b70", "CALLERID(num)=") in new stack
    -- Executing [551132300606@from-pstn:7] Set("PJSIP/twilio-00027b70", "MONITOR_FILENAME=/var/spool/asterisk/monitor/2018/05/08/-551132300606-075751") in new stack
    -- Executing [551132300606@from-pstn:8] System("PJSIP/twilio-00027b70", "mkdir -p /var/spool/asterisk/monitor/2018/05/08") in new stack
    -- Executing [551132300606@from-pstn:9] Queue("PJSIP/twilio-00027b70", "comercial,tc") in new stack
    -- Started music on hold, class 'default', on channel 'PJSIP/twilio-00027b70'

Nothing stands out, what version are you using?

certified/13.13-cert8

That’s an old version of certified, the latest version is 13.18. As well unless you have a support agreement with Digium any bug fix that could result from this will not be merged into certified.

Looks to me as though you have explicitly set it to blank!

Good point! I misread Set as NoOp for some reason.

Well, I’m embarassed. Thank you guys, I really missed it. Sorry for the noise.