"Private number" or "No caller id" problem

Hello,

I am using Asterisk PBX 22.2.0 on my centos 7 server. I try to make phone call using asterisk using udp transport. I can make call succesfully running command:

asterisk -rx “channel originate PJSIP/tele2/sip:+3706@voip.mobilistotele.tele2.lt application echo”

problem is I see caller as “no caller id” on iphone and “private number” on android phone instead of provider phone number.
Maybe someone can help me, why is that?

My pjsip.conf:

[transport-udp]

type=transport

protocol=udp

bind=0.0.0.0:5060

[tele2-auth]

type=auth

auth_type=userpass

username=VEKZS3S0

password=

realm=voip.mobilistotele.tele2.lt

[tele2-aor]

type=aor

contact=sip:VEKZS3S0@:5060

qualify_frequency=60

[tele2-reg]

type=registration

outbound_auth=tele2-auth

server_uri=sip:voip.mobilistotele.tele2.lt:5060

client_uri=sip:VEKZS3S0@voip.mobilistotele.tele2.lt

expiration=300

retry_interval=60

[tele2]

type=endpoint

context=outbound-calls

transport=transport-udp

disallow=all

allow=ulaw,alaw

from_domain=voip.mobilistotele.tele2.lt

callerid=<+370>

direct_media=no

force_rport=yes

aors=tele2-aor

auth=tele2-auth

outbound_auth=tele2-auth

trust_id_inbound = yes

trust_id_outbound = yes

send_pai = yes

send_rpid = yes

from_user=VEKZS3S0

extensions.conf:

[outbound-calls]

exten => _+X.,1,Progress()

exten => _+X.,1,Set(CALLERID(name)=“”)

exten => _+X.,n,Set(CALLERID(num)=+370)

same => n,Set(PJSIP_HEADER(add,P-Asserted-Identity)=<sip:+370@voip.mobilistotele.tele2.lt>)

same => n,Set(PJSIP_HEADER(add,Remote-Party-ID)=<sip:+370@voip.mobilistotele.tele2.lt>;party=calling;screen=yes)

same => n,Dial(PJSIP/${EXTEN}@tele2,60)

same => n,Hangup()

INVITE call looks like this:

Via: SIP/2.0/UDP :5060;rport;branch=z9hG4bKPja57c352c-6da6-4abe-ac9e-296857f2057b

Max-Forwards: 70

Contact: <sip:VEKZS3S0@:5060>

To: <sip:+370@voip.mobilistotele.tele2.lt>

From: “Anonymous” sip:VEKZS3S0@voip.mobilistotele.tele2.lt;tag=30fc4714-bff1-4e06-8a6d-2b855068a24d

Call-ID: a968c0a5-a043-45e9-a8cf-7b403c0bac4c

CSeq: 734 INVITE

Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER

Content-Type: application/sdp

Supported: 100rel, timer, replaces, norefersub, histinfo

User-Agent: Asterisk PBX 22.2.0

Session-Expires: 1800

Content-Length: 263

Min-SE: 90

Using the CLI originate does not allow you to specify a callerid. It is therefore set to anonymous. If you want to send it via the dialplan where things can be done, you would use a Local channel instead.

Also:

You should not do both:

and

preferably just the former, but certainly not both.

Also:

is being run on the wrong channel; if used, it needs to be run on the outgoing channel (currently you are not using any dialplan code, at all).

URIs must have a domain part!

The last one is faulty markup, for the forum. The intended markup was:

contact=sip:VEKZS3S0@<my server public ip adress>:5060

However that is wrong. . If anything, it should the service provider’s address, and normally would not include a user part.

Thank you, now it works for outbound calls with settings:
pjsip.conf:

[transport-udp]
type=transport
protocol=udp
bind=<server ip adress>:5060

[VEKZ-auth]
type=auth
auth_type=userpass
username=VEKZ
password=Password
realm=voip.mobilistotele.tele2.lt

[VEKZ-aor]
type=aor
contact=sip:VEKZ@voip.mobilistotele.tele2.lt:5060
qualify_frequency=0

[VEKZ-reg]
type=registration
outbound_auth=VEKZ-auth
server_uri=sip:voip.mobilistotele.tele2.lt:5060
client_uri=sip:VEKZ@voip.mobilistotele.tele2.lt
expiration=300
retry_interval=60

[VEKZ]
type=endpoint
context=VEKZ-calls
transport=transport-udp
disallow=all
allow=alaw
from_domain=voip.mobilistotele.tele2.lt
direct_media=no
force_rport=yes
aors=VEKZ-aor
outbound_auth=VEKZ-auth
trust_id_inbound = no
send_pai = yes
send_rpid = no
from_user=VEKZ

[VEKZ-identify]
type=identify
endpoint=VEKZ
match=<provider ip adress>/32

[transport-wss]
type=transport
protocol=wss
bind=0.0.0.0:8089

[VEKZ_webrtc_aor]
type=aor
contact=sip:VEKZ_webrtc_user@<server domain>
max_contacts=1
qualify_frequency=60

[VEKZ_webrtc_auth]
type=auth
auth_type=userpass
username=VEKZ_webrtc_user
password=Password

[VEKZ_webrtc_endpoint]
type=endpoint
context=VEKZ-calls
disallow=all
allow=alaw
webrtc=yes
transport=transport-wss
auth=VEKZ_webrtc_auth
aors=VEKZ_webrtc_aor
direct_media=no
ice_support=yes
dtls_auto_generate_cert=yes
dtmf_mode=rfc4733

extensions.conf

[VEKZ-calls]
exten => s,1,NoOp(Inbound call)
  same => n,Progress()
  same => n,Dial(PJSIP/VEKZ_webrtc_endpoint,60)
  same => n,Hangup()

and now I try to get inbound call aswell but when I try to call to my provider number phone call is instantly cancelled and log show:

[2025-04-04 00:14:47] VERBOSE[14799] res_pjsip/pjsip_configuration.c: Endpoint VEKZ_webrtc_endpoint is now Reachable
[2025-04-04 00:14:47] VERBOSE[14799] res_pjsip/pjsip_options.c: Contact VEKZ_webrtc_aor/sip:VEKZ_webrtc_user@[server domain] is now Reachable.  RTT: 3.985 msec
[2025-04-04 00:15:25] VERBOSE[14983] res_http_websocket.c: WebSocket connection from '[my IP address]:55350' for protocol 'sip' accepted using version '13'
[2025-04-04 00:15:37] VERBOSE[14995][C-00000001] pbx.c: Executing [s@VEKZ-calls:1] NoOp("PJSIP/VEKZ-00000000", "Inbound call") in new stack
[2025-04-04 00:15:37] VERBOSE[14995][C-00000001] pbx.c: Executing [s@VEKZ-calls:2] Progress("PJSIP/VEKZ-00000000", "") in new stack
[2025-04-04 00:15:37] VERBOSE[14995][C-00000001] pbx.c: Executing [s@VEKZ-calls:3] Dial("PJSIP/VEKZ-00000000", "PJSIP/VEKZ_webrtc_endpoint,60") in new stack
[2025-04-04 00:15:37] VERBOSE[14799] res_rtp_asterisk.c: DTLS ECDH initialized (automatic), faster PFS enabled
[2025-04-04 00:15:37] VERBOSE[14995][C-00000001] app_dial.c: Called PJSIP/VEKZ_webrtc_endpoint
[2025-04-04 00:15:37] NOTICE[14799] res_pjsip/pjsip_distributor.c: Request 'INVITE' from '"+3706XXXXXXX" <sip:+3706XXXXXXX@[server IP adress]>' failed for '[server IP adress]:5060' (callid: 9c564f7c-276a-4c15-8c8f-176cb55687c7) - No matching endpoint found
[2025-04-04 00:15:37] ERROR[14799] res_pjsip_outbound_authenticator_digest.c:  VEKZ_webrtc_endpoint:[server IP adress]: There were no auth ids available
[2025-04-04 00:15:37] VERBOSE[14995][C-00000001] app_dial.c: Everyone is busy/congested at this time (1:0/0/1)
[2025-04-04 00:15:37] VERBOSE[14995][C-00000001] pbx.c: Executing [s@VEKZ-calls:4] Hangup("PJSIP/VEKZ-00000000", "") in new stack
[2025-04-04 00:15:37] VERBOSE[14995][C-00000001] pbx.c: Spawn extension (VEKZ-calls, s, 4) exited non-zero on 'PJSIP/VEKZ-00000000'

where is the problem?

If you have max_contacts, you should not normally have contact and you should normally have an aor name that is the same as endpoint name.

It looks like you have the wrong domain address in contact, in the above. If present, it should be that of the webrtc device (but I don’t think one can have static webrtc clients!).

I use sip.js as webrtc device, it connects like this:

new SIP.UserAgent({
          uri: SIP.UserAgent.makeURI("sip:VEKZ_webrtc_user@<server domain>"),
          authorizationUsername: 'VEKZ_webrtc_user',
          authorizationPassword: 'Password',
          transportOptions: {
            server: "wss://<server domain>:8089/ws",
            traceSip: true
          }
});

Websocket connection is succesfull. I have tried to increase max_contacts for testing purposes but it dont resolve problem. If I comment out “contact=sip:VEKZ_webrtc_user@[server domain]” and leave it like:

[VEKZ_webrtc_endpoint]
type=aor
max_contacts=5
qualify_frequency=60

endpoint is “Unavailable”:

[root@sblr ~]# asterisk -rx "pjsip show endpoints"
No ethernet interface found for seeding global EID. You will have to set it manually.

 Endpoint:  <Endpoint/CID.....................................>  <State.....>  <Channels.>
    I/OAuth:  <AuthId/UserName...........................................................>
        Aor:  <Aor............................................>  <MaxContact>
      Contact:  <Aor/ContactUri..........................> <Hash....> <Status> <RTT(ms)..>
  Transport:  <TransportId........>  <Type>  <cos>  <tos>  <BindAddress..................>
   Identify:  <Identify/Endpoint.........................................................>
        Match:  <criteria.........................>
    Channel:  <ChannelId......................................>  <State.....>  <Time.....>
        Exten: <DialedExten...........>  CLCID: <ConnectedLineCID.......>
==========================================================================================

 Endpoint:  VEKZ                                             Not in use    0 of inf
    OutAuth:  VEKZ-auth/VEKZ
        Aor:  VEKZ-aor                                       0
      Contact:  VEKZ-aor/sip:VEKZ@voip.mobilistote 66338442e7 NonQual         nan
  Transport:  transport-udp             udp      0      0  <server IP adress>:5060
   Identify:  VEKZ-identify/VEKZ
        Match: <provider IP adress>/32

 Endpoint:  VEKZ_webrtc_endpoint                             Unavailable   0 of inf
     InAuth:  VEKZ_webrtc_auth/VEKZ_webrtc_user
        Aor:  VEKZ_webrtc_endpoint                           5
  Transport:  transport-wss             wss      0      0  0.0.0.0:8089


Objects found: 2

if I add contact part back like this:

[VEKZ_webrtc_endpoint]
type=aor
contact=sip:VEKZ_webrtc_user@<server domain>
max_contacts=5
qualify_frequency=60

endpoint is “Not in use”

[root@sblr ~]# asterisk -rx "pjsip show endpoints"
No ethernet interface found for seeding global EID. You will have to set it manually.

 Endpoint:  <Endpoint/CID.....................................>  <State.....>  <Channels.>
    I/OAuth:  <AuthId/UserName...........................................................>
        Aor:  <Aor............................................>  <MaxContact>
      Contact:  <Aor/ContactUri..........................> <Hash....> <Status> <RTT(ms)..>
  Transport:  <TransportId........>  <Type>  <cos>  <tos>  <BindAddress..................>
   Identify:  <Identify/Endpoint.........................................................>
        Match:  <criteria.........................>
    Channel:  <ChannelId......................................>  <State.....>  <Time.....>
        Exten: <DialedExten...........>  CLCID: <ConnectedLineCID.......>
==========================================================================================

 Endpoint:  VEKZ                                             Not in use    0 of inf
    OutAuth:  VEKZ-auth/VEKZ
        Aor:  VEKZ-aor                                       0
      Contact:  VEKZ-aor/sip:VEKZ@voip.mobilistote 66338442e7 NonQual         nan
  Transport:  transport-udp             udp      0      0  <server IP adress>:5060
   Identify:  VEKZ-identify/VEKZ
        Match: <provider IP adress>/32

 Endpoint:  VEKZ_webrtc_endpoint                             Not in use    0 of inf
     InAuth:  VEKZ_webrtc_auth/VEKZ_webrtc_user
        Aor:  VEKZ_webrtc_endpoint                           5
      Contact:  VEKZ_webrtc_endpoint/sip:VEKZ_webr c9a54128c0 Avail         6.412
  Transport:  transport-wss             wss      0      0  0.0.0.0:8089


Objects found: 2

I dont know if this is issue why I cant see inbound call in my webrtc client, but it is differences I see when changing configs.
Thanks for help

A WebRTC client has to register to Asterisk. If it’s not registered or is unavailable, then you can’t call it. Merely establishing a Websocket doesn’t cause a registration. The remote side has to send a SIP REGISTER and actually do the registration process. That is what you have to troubleshoot. Is the remote side ACTUALLY registering? (pjsip set logger on will show the SIP traffic)

As for specifying a contact=, you can’t do that for WebRTC.

I havent though about websocket registration, thanks for pointing that out.
I have changed sip connection to simpleuser connection:

const server = "wss://<server domain>:8089/ws";
          const destination = "sip:VEKZ_webrtc_user@<server domain>";
          const aor = "sip:VEKZ_webrtc_user@<server domain>";
          const authorizationUsername = 'VEKZ_webrtc_user';
          const authorizationPassword = 'Password';

          const options = {
              aor,
              media: {
                  remote: {
                      audio: getAudioElement("remoteAudio")
                  }
              },
              userAgentOptions: {
                  authorizationPassword,
                  authorizationUsername,
              }
          };

          const simpleUser = new SIP.Web.SimpleUser(server, options);

          simpleUser.delegate = {
              onCallReceived: async () => {
                  await simpleUser.answer();
              }
          };

          await simpleUser.connect();
          await simpleUser.register();

and I see that client is not registering with messages in console:

Fri Apr 04 2025 16:59:41 GMT+0300 (Eastern European Summer Time) | sip.Transport | Sending WebSocket message:

REGISTER sip:<server domain> SIP/2.0
Via: SIP/2.0/WSS 5jilcrivqmgo.invalid;branch=z9hG4bK3139861
To: <sip:VEKZ_webrtc_user@<server domain>>
From: <sip:VEKZ_webrtc_user@<server domain>>;tag=og18cntrh9
CSeq: 2 REGISTER
Call-ID: mpbu0vadlqqe9kaai2bs
Max-Forwards: 70
Contact: <sip:7s24762f@5jilcrivqmgo.invalid;transport=ws>;expires=600
Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER
Supported: outbound, path, gruu
User-Agent: SIP.js/0.20.0
Content-Length: 0

Fri Apr 04 2025 16:59:41 GMT+0300 (Eastern European Summer Time) | sip.Transport | Received WebSocket text message:

SIP/2.0 401 Unauthorized
Via: SIP/2.0/WSS 5jilcrivqmgo.invalid;rport=65379;received=<my ip adress>;branch=z9hG4bK3139861
Call-ID: mpbu0vadlqqe9kaai2bs
From: <sip:VEKZ_webrtc_user@<server domain>>;tag=og18cntrh9
To: <sip:VEKZ_webrtc_user@<server domain>>;tag=z9hG4bK3139861
CSeq: 2 REGISTER
WWW-Authenticate: Digest realm="asterisk",nonce="1743775181/c0f7229ebff20015e2ff74f88ada53c8",opaque="05d02bad0f503c9f",algorithm=MD5,qop="auth"
Server: Asterisk PBX 22.2.0
Content-Length:  0

Fri Apr 04 2025 16:59:42 GMT+0300 (Eastern European Summer Time) | sip.Registerer | Registration transitioned to state Unregistered

Fri Apr 04 2025 16:59:42 GMT+0300 (Eastern European Summer Time) | sip.Registerer | Waiting toggled to false

and asterisk log looks like:

[2025-04-04 16:59:41] VERBOSE[4173] res_http_websocket.c: WebSocket connection from '<my IP adress>:65379' for protocol 'sip' accepted using version '13'
[2025-04-04 16:59:41] NOTICE[3630] res_pjsip/pjsip_distributor.c: Request 'REGISTER' from '<sip:VEKZ_webrtc_user@<server domain>>' failed for '<my IP adress>:65379' (callid: mpbu0vadlqqe9kaai2bs) - No matching endpoint found
[2025-04-04 16:59:42] NOTICE[3630] res_pjsip/pjsip_distributor.c: Request 'REGISTER' from '<sip:VEKZ_webrtc_user@<server domain>>' failed for '<my IP adress>:65379' (callid: mpbu0vadlqqe9kaai2bs) - No matching endpoint found
[2025-04-04 16:59:42] NOTICE[3630] res_pjsip/pjsip_distributor.c: Request 'REGISTER' from '<sip:VEKZ_webrtc_user@<server domain>>' failed for '<my IP adress>:65379' (callid: mpbu0vadlqqe9kaai2bs) - Failed to authenticate

webrtc aor now is without “contact” setting as you said:

[VEKZ_webrtc_endpoint]
type=aor
max_contacts=5
qualify_frequency=60

I think I am missing some setting that should redirect webrtc client to endpoint? so I wont get “No matching endpoint found” error and it would register succesfully

The endpoint from phones and devices is generally found using the user portion of the From. Which is:

However the name of the endpoint is:

Therefore no endpoint is found.