Caller ID problem on Asterisk 16.2.1


I have CALLERID problem with outgoing calls through my SIP provider. When I try to make the call from my Asterisk connected SIP phone, through my SIP provider, to my (mobile) phone, it’s visible/received as “private number” - the number doesn’t get displayed. How can I fix that? The setting for caller ID on the SIP provider website is set as “38618882222”.

I tried using several options:

exten => _0.,1,Set(CALLERID(num)=38618882222)
exten => _0.,2,Dial(SIP/${EXTEN:1}@sipprovider,60,tr)
exten => _0.,3,Playback(invalid)
exten => _0.,4,Hangup

I also tried replacing it with:
exten => _0.,1,Set(CALLERID(num)=38618882222)
exten => _0.,1,Set(CALLERID(num)=0038618882222)
exten => _0.,1,Set(CALLERID(num)=+38618882222)

My sip.conf looks like this:

type = friend
insecure = invite
nat = no
canreinvite = no
authuser = 12345678
username = 12345678
fromuser = 12345678
fromdomain =
host =
secret = xxxxxxxx
dtmfmode = rfc2833
context = sipprovider-in ;extensions.conf context for inbound calls
sendrpid = yes
trustrpid = yes
disallow = all
allow = ulaw
allow = alaw
qualify = yes

type = friend
insecure = invite
nat = no
canreinvite = no
authuser = 100
username = 100
fromuser = 100
sendrpid = yes
trustrpid = yes
secret = xxxxxxxx
host = dynamic
dtmfmode = rfc2833
context = sipprovider-out ;extensions.conf context for outbound calls
disallow = all
allow = alaw
allow = ulaw
qualify = yes

Kind regards,

chan_sip is no longer fully supported and the option names you are using include deprecated ones.

The most likely reason is that you haven’t proved to your SIP provider that you control the number that you are trying to present, or they simply do not provide a service to provide custom numbers.

Hello @david551,

I bought/rented the DID custom number (+38618882222) at the SIP provider and it is allocated to my SIP account, which is linked to my Asterisk. They list several Caller ID outgoing options for numbers:

  1. 38618882222
  2. 12345678 (SIP account number)
  3. My registered mobile phone number

I assume that I could choose from any of those 3 numbers and it was supposed to display such number in the outgoing call? I haven’t contacted their support yet, because I assumed that maybe my Asterisk setup is done wrong?

My provider allows me to set my caller ID to whatever I want.

I have

        sendrpid                        = yes
        trustrpid                       = yes

in the provider’s stanza in sip.conf.

In my dialplan I execute


before my dial() request.

my INVITE looks like:

INVITE sip:1<dialed-number>@<provider-ip> SIP/2.0
Via: SIP/2.0/UDP <my-external-ip>:5060;branch=z9hG4bK770227fe;rport
Max-Forwards: 70
From: "poly-77a1" <sip:<my-username>@<my-external-ip>>;tag=as6d0d67e0
To: <sip:1<dialed-number>@<provider-ip>>
Contact: <sip:<my-username>@<my-external-ip>:5060>
Call-ID: 1f163f6e308c6f575ec10afb7e5decd5@<my-external-ip>:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 13.14.1~dfsg-2+deb9u4
Date: Tue, 28 Apr 2020 19:21:31 GMT
Supported: replaces, timer
Remote-Party-ID: "poly-77a1" <sip:5555555555@<my-external-ip>>;party=calling;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 290

o=root 883103243 883103243 IN IP4 <my-external-ip>
s=Asterisk PBX 13.14.1~dfsg-2+deb9u4
c=IN IP4 <my-external-ip>
t=0 0
m=audio 17574 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16

If you enable SIP debugging (‘sip set debug on’) you should see something similar.

If you carrier set the caller id based on the Remote-Party-ID header , your settings are correct, now you need to contact them to make sure they will honour the caller id you re sending on the call

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