No caller number in cdr table

Hello everyone,
I want to keep the record of phone number of the caller. But the Caller number is not stored in cdr table, instead the User Id that I used to register the PSTN in Linksys Sipura ATA is stored in the Caller Number. I tried to set the caller number using asterisk dial plan also (like Set(CALLERID(name)=${CALLERID(num)})) but it also stored the UserId not the caller phone number. Any insight would be greatly appreciated.

I’m going to assume that this is SIP and you are using chan_sip.

Either the upstream system isn’t sending it, or it is sending it using P-Asserted-Idenity, or Remote-Party-ID, but you haven’t enabled trustrpid.

Thanks @david551
Here are some screenshots of my trunk setting (trunk setting1 and trunksetting2) and cdr report. I wanted the calling party’s phone number, but as you can see, I am getting ‘cidnum’ in src, clid. So what changes should I make to get the calling party’s number in my cdr report.

Does pstn status: not registered in Linksys Sipura ATA results this? Actually the Pstn Status is also not registered as in screenshot

Although I’m not an expert on Linksys ATA’s, I would say that, if it mattered, it would cause calls to Asterisk to fail completely…

Also please provide Asterisk configurations, not FreePBX GUI screen shots, although what is on the GUI suggests that trustrpid is set, in which case either the FreePBX dialplan is losing the caller ID or it is never being sent. For the former, please ask on as there is no reason why we should need to reverse engineer their dialplan. for thee latter enable the full log, set debug and verbose to at least 5 and run “sip set debug on” on the CLI.

There was no caller ID in cdr table because I had not enabled PSTN CID For VOIP CID in PSTN-To-VOIP Gateway setup of PSTN tab in my ATA(SPA3000). After enabling it as shown in the screenshot, I got the incoming CallerId in cdr report.
Thanks @david551 for your suggestion. :slight_smile: :slight_smile: :slight_smile: