Not getting the correct callerid

My sangoma gateway is connected to asterisk server. I have used the following code to get the incoming callerID

exten => 4712766020,1,NoOp()
same => n, NoOp(Caller NUM is: ${CALLERID(num)})

But it is not returning the correct caller id.

-- Executing [4712766020@users:1] NoOp("SIP/100001-0000001b", "") in new stack
-- Executing [4712766020@users:3] NoOp("SIP/100001-0000001b", "Caller NUM is: 100001") in new stack

Do i need to give any special configuration to get the correct callerid.
Plz help

Your log does not match your dialplan, and seems to be missing a line.

The logs provided contain no errors and the caller ID is plausible.

Please provide evidence, e.g. protocol traces, of what the correct caller ID should be, and also tell us what you expect it to be.

The complete dial plan and log is given below. Thanks to “david551”

Dialplan
exten => 4712766020,1,NoOp()
same => n, NoOp(${CALLERID(name)})
same => n, NoOp(Caller NUM is: ${CALLERID(num)})
same => n, Dial(SIP/101020,20)
same => n, Hangup()

Log
Connected to Asterisk 15.3.0 currently running on prasanth-HP-ZBook-17 (pid = 1606)
– Registered SIP ‘100001’ at 10.176.17.249:5060

Saved useragent “VEGA/15.02.10.1xS019” for peer 100001
== Using SIP RTP CoS mark 5
0x7fae3800aef0 – Strict RTP learning after remote address set to: 10.176.17.249:10072
– Executing [4712766020@users:1] NoOp(“SIP/100001-00000000”, “”) in new stack
– Executing [4712766020@users:2] NoOp(“SIP/100001-00000000”, “”) in new stack
– Executing [4712766020@users:3] NoOp(“SIP/100001-00000000”, “Caller NUM is: 100001”) in new stack
– Executing [4712766020@users:4] Dial(“SIP/100001-00000000”, “SIP/101020,20”) in new stack
== Using SIP RTP CoS mark 5
– Called SIP/101020
– SIP/101020-00000001 is ringing
== Spawn extension (users, 4712766020, 4) exited non-zero on ‘SIP/100001-00000000’

Hi,

I solved the issue, missed some configuration in sip.conf. Below given link helped me to configure my sip.
https://wiki.freepbx.org/display/VG/Registering+Vega+with+FreePBX

Thanks again david551