Android client fails to register

I got the “Hello, World” sample to work with a Linphone client. My Zoiper is being used with another service and I am limited to one account.

I then got ambitious and tried to set up a SIP trunk using VoIP.ms. I used a sample configuration for pjslip provided by VoIP.ms

pjsip.conf

type = registration
transport = transport-udp
outbound_auth = voipms
client_uri = sip:127304@losangeles.voip.ms:5060
server_uri = sip:losangeles.voip.ms:5060

[voipms]
type = auth
auth_type = userpass
username = 127304
password = [redacted]
[voipms]
type = aor
contact = sip:127304@losangeles.voip.ms

[voipms]
type = endpoint
transport = transport-udp
context = mycontext
disallow = all
allow = ulaw
from_user = 127304
auth = voipms
outbound_auth = voipms
aors = voipms
rtp_symmetric = yes
rewrite_contact = yes
send_rpid = yes

[voipms]
type = identify
endpoint = voipms
match = losangeles.voip.ms

The registration fails with the following messages:

[Apr 27 10:57:19] NOTICE[4018]: res_pjsip/pjsip_distributor.c:662 log_failed_request: Request 'REGISTER' from '"VoIP.ms" <sip:127304@54.86.164.204>' failed for '96.9.90.28:56624' (callid: OrRMisvO7t) - No matching endpoint found
[Apr 27 10:57:19] NOTICE[4018]: res_pjsip/pjsip_distributor.c:662 log_failed_request: Request 'REGISTER' from '"VoIP.ms" <sip:127304@54.86.164.204>' failed for '96.9.90.28:56624' (callid: OrRMisvO7t) - Failed to authenticate

This is my first attempt so I am a complete newbie.

dig says:

;; ANSWER SECTION:
losangeles.voip.ms.	300	IN	A	96.44.149.186

which is nothing like 54.86.164.204.

Also ITSPs don’t, in general register, and you don’t have anything but your ITSP configured and the error message suggests that the the registration is from the ITSP. I assume something that you have not configured is trying to register and masquerade as the ITSP.

losangeles.voip.ms is the address of the SIP trunk provider. My Asterisk server is running on AWS at 54.86.164.204.

I’m not sure what an ITSP is. Is that the softphone?

BTW, I got the sample configuration from VoIP.ms. I have been using them for years and they are quite reliable.

Sorry, I copied the wrong address from the error message I should have said that 96.9.90.28 is rather different from 96.44.149.186.

I still have the problem that an ITSP would never send REGISTER to a user, as it generally wouldn’t now the user’s address (except for the register the other way), and also, in practice, ITSPs never try to identify themselves.

It looks to me as though those registrations are coming from Cambodia, so I assume they are either the result of misconfiguration of the Cambodian system, or, more likely, represents attempted telephone fraud.

Any SIP UAS that is open to all SIP traffic will be attacked within minutes of going online.

I am in Cambodia. I have been using Zoiper with voip.ip and it always requires registration.

The ip address in Cambodia is the public address of my ISP. I am using their wifi.

In terms of the subject line, nothing will succeed in registering, because your configuration doesn’t support any peers other than the ITSP, and that peer is not dynamic.

When I configured the “Hello, World” example, it registered.

What does “no matching enpoint found” mean?

It means that no type=identify section could be matched with the details of the incoming request.

Note that there is the possibility of a catch-all endpoint. The documentation says this:

; Anonymous Calls
;
; By default anonymous inbound calls via PJSIP are not allowed. If you want to
; route anonymous calls you’ll need to define an endpoint named “anonymous”.
; res_pjsip_endpoint_identifier_anonymous.so handles that functionality so it
; must be loaded. It is not recommended to accept anonymous calls.

This isn’t a call. It is a softphone connecting to an Asterisk server

Also, why would a PBX not accept anonymous inbound calls? As a business, I would want to do that

You are very unusual business. In practice, even though SIP allows point to point call setup, businesses only allow calls to come via their service provider, or from devices supplied to their employees. In the latter case, many would only accept those calls over a local network or a VPN.

The risk with allowing anonymous SIP calls is that there is no filtering of the request format, so if you get your configuration wrong, the caller can make outgoing chargeable calls; there are a lot of people out there trying to do that, and you will have received calls from them within minutes of being exposed to the internet. Also, the lack of control of the format means that they can exploit any vulnerabilities in your system that depend on malformed requests.

The lack of control means that it is easy to fake caller IDs and make fraudulent calls, that, for example, appear to have originated from within your company.

Anonymous here doesn’t mean that the caller ID is missing, but rather that the immediate upstream source is unknown to you. chan_sip uses the term “guest”.

You have nothing in pjsip.conf to accept calls from that address.

From which address

DENNIS M. GRAY

Cambodia: +855 86 212 479

USA VoIP +1 805 467 6070

(Rings anywhere)

I’m trying to register with the server, not make or receive a call yet

DENNIS M. GRAY

Cambodia: +855 86 212 479

USA VoIP +1 805 467 6070

(Rings anywhere)

From 96.9.90.28, as shown in the error message.

Then don’t turn on the phones.

Also, having Cambodian phones hanging off a, presumably US virtual server, doesn’t seem an efficient use of internet resources, unless you don’t make any internal calls and only have calls with people in the US.

Never mind

DENNIS M. GRAY

Cambodia: +855 86 212 479

USA VoIP +1 805 467 6070

(Rings anywhere)

The power has been out for a long time

Yes. Most of my calls will be US calls. This is an experiment for learning at the moment.

DENNIS M. GRAY

Cambodia: +855 86 212 479

USA VoIP +1 805 467 6070

(Rings an ywhere)

Hi!

What happens if you add the following two lines to your registration section?

line=yes
endpoint=voipms

For the hack of it, you could add this to your configuration:

[voipms]
type=identify
match=losangeles.voip.ms
endpoint=voipms