REGISTER not sending Authorization

Hi everyone, this is my first ever post,

I got a weird problem here: sip REGISTER is sent without “Authorization” field.
I did this stuff for long now, but never saw something like that.

My sip.conf user configuration is as follows:

[NUMBER]
username=NUMBER
secret=PASSWORD
type=peer
srvlookup=yes
realm=HOSTNAME
insecure=port,invite
host=HOSTNAME
qualify=yes
fromdomain=HOSTNAME
fromuser=HOSTNAME
sendrpid=no

and sent sip REGISTER is the following:

REGISTER sip:HOSTNAME SIP/2.0
Via: SIP/2.0/UDP 10.0.61.20:5060;branch=z9hG4bK0f88f855;rport
Max-Forwards: 70
From: <sip:NUMBER@HOSTNAME>;tag=as45bc4612
To: <sip:NUMBER@HOSTNAME>
Call-ID: 3fc7f04f7f4504794d4f3c697d228afb@[::1]
CSeq: 103 REGISTER
User-Agent: FPBX-2.10.1(1.8.17.0)
Expires: 120
Contact: <sip:NUMBER@10.0.61.20:5060>
Content-Length: 0

*NUMBER,HOSTNAME and PASSWORD are aliases of actual values.

As you can see “Authorization” field with login digests is missing, even though “username” and “secret” are there in configuration file.
I’d like to debug it, but I don’t know where to start…any idea?

Thanks in advance.

Isn’t this normal?

In majority of situation this is the case (for instance IP Phone connecting to Asterisk)

  1. IP Phone sends SIP Register with no Authentication
  2. Asterisk sends Not Authorized SIP message (or something similar) in reply
  3. IP Phone sends SIP Register with Authentication
  4. If all is OK, Asterisk sends OK SIP message in reply

Yes indeed, you are right, but even on step 3 “Authorization” is not sent, so what comes from this is:

  1. IP Phone sends SIP Register with no Authentication
  2. Asterisk sends Not Authorized SIP message (or something similar) in reply
  3. IP Phone sends SIP Register again with no Authentication
  4. Asterisk sends another Not Authorized SIP message
    and so on.
    that’s what is puzzling me…

For example, I cought a snap of few seconds of cli log, and as you can see there are several REGISTER tryies, but all missing “Authorization” digest:

REGISTER sip:HOSTNAME SIP/2.0
Via: SIP/2.0/UDP 10.0.61.20:5060;branch=z9hG4bK39189de5;rport
Max-Forwards: 70
From: <sip:NUMBER@HOSTNAME>;tag=as7f332259
To: <sip:NUMBER@HOSTNAME>
Call-ID: 5a3f7a416c0dde1278b446d9577df3b3@[::1]
CSeq: 3330 REGISTER
User-Agent: FPBX-2.10.1(1.8.17.0)
Expires: 120
Contact: <sip:NUMBER@10.0.61.20:5060>
Content-Length: 0


---

<--- SIP read from UDP:HOST_IP:5060 --->
SIP/2.0 401 Unauthorized
Call-ID: 5a3f7a416c0dde1278b446d9577df3b3@[0:0:0:0:0:0:0:1]
CSeq: 3330 REGISTER
From: <sip:NUMBER@HOSTNAME>;tag=as7f332259
To: <sip:NUMBER@HOSTNAME>;tag=00-08100-02761e60-1897c6272
Via: SIP/2.0/UDP 10.0.61.20:5060;received=87.248.59.125;rport=39108;branch=z9hG4bK39189de5
WWW-Authenticate: Digest realm="HOSTNAME",nonce="02761e1167003a8c14a70b3b4ac295f6",opaque="02759ce027aa9d5",stale=false,algorithm=MD5
Server: Cirpack/v4.56k (gw_sip)
Content-Length: 0

<------------->

--- (9 headers 0 lines) ---
Retransmitting #7 (NAT) to HOST_IP:5060:
REGISTER sip:HOSTNAME SIP/2.0
Via: SIP/2.0/UDP 10.0.61.20:5060;branch=z9hG4bK39189de5;rport
Max-Forwards: 70
From: <sip:NUMBER@HOSTNAME>;tag=as7f332259
To: <sip:NUMBER@HOSTNAME>
Call-ID: 5a3f7a416c0dde1278b446d9577df3b3@[::1]
CSeq: 3330 REGISTER
User-Agent: FPBX-2.10.1(1.8.17.0)
Expires: 120
Contact: <sip:NUMBER@10.0.61.20:5060>
Content-Length: 0

---
REGISTER 10 headers, 0 lines
Reliably Transmitting (NAT) to HOST_IP:5060:
REGISTER sip:HOSTNAME SIP/2.0
Via: SIP/2.0/UDP 10.0.61.20:5060;branch=z9hG4bK427fd345;rport
Max-Forwards: 70
From: <sip:NUMBER@HOSTNAME>;tag=as378b679a
To: <sip:NUMBER@HOSTNAME>
Call-ID: 5a3f7a416c0dde1278b446d9577df3b3@[::1]
CSeq: 3331 REGISTER
User-Agent: FPBX-2.10.1(1.8.17.0)
Expires: 120
Contact: <sip:NUMBER@10.0.61.20:5060>
Content-Length: 0


---
Really destroying SIP dialog '5a3f7a416c0dde1278b446d9577df3b3@[::1]' Method: REGISTER

<--- SIP read from UDP:HOST_IP:5060 --->
SIP/2.0 100 Trying
Call-ID: 5a3f7a416c0dde1278b446d9577df3b3@[0:0:0:0:0:0:0:1]
CSeq: 3331 REGISTER
From: <sip:NUMBER@HOSTNAME>;tag=as378b679a
To: <sip:NUMBER@HOSTNAME>
Via: SIP/2.0/UDP 10.0.61.20:5060;received=87.248.59.125;rport=39108;branch=z9hG4bK427fd345
Content-Length: 0

<------------->
--- (7 headers 0 lines) ---

<--- SIP read from UDP:HOST_IP:5060 --->
SIP/2.0 401 Unauthorized
Call-ID: 5a3f7a416c0dde1278b446d9577df3b3@[0:0:0:0:0:0:0:1]
CSeq: 3331 REGISTER
From: <sip:NUMBER@HOSTNAME>;tag=as378b679a
To: <sip:NUMBER@HOSTNAME>;tag=00-08056-0276201e-4ee1eeb07
Via: SIP/2.0/UDP 10.0.61.20:5060;received=87.248.59.125;rport=39108;branch=z9hG4bK427fd345
WWW-Authenticate: Digest realm="HOSTNAME",nonce="02761fff7fe026ef1b8094fa55967df0",opaque="02759ce027aa9d5",stale=false,algorithm=MD5
Server: Cirpack/v4.56k (gw_sip)
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---
Retransmitting #1 (NAT) to HOST_IP:5060:
REGISTER sip:HOSTNAME SIP/2.0
Via: SIP/2.0/UDP 10.0.61.20:5060;branch=z9hG4bK427fd345;rport
Max-Forwards: 70
From: <sip:NUMBER@HOSTNAME>;tag=as378b679a
To: <sip:NUMBER@HOSTNAME>
Call-ID: 5a3f7a416c0dde1278b446d9577df3b3@[::1]
CSeq: 3331 REGISTER
User-Agent: FPBX-2.10.1(1.8.17.0)
Expires: 120
Contact: <sip:NUMBER@10.0.61.20:5060>
Content-Length: 0


---

<--- SIP read from UDP:HOST_IP:5060 --->
SIP/2.0 401 Unauthorized
Call-ID: 5a3f7a416c0dde1278b446d9577df3b3@[0:0:0:0:0:0:0:1]
CSeq: 3331 REGISTER
From: <sip:NUMBER@HOSTNAME>;tag=as378b679a
To: <sip:NUMBER@HOSTNAME>;tag=00-08056-0276201e-4ee1eeb07
Via: SIP/2.0/UDP 10.0.61.20:5060;received=87.248.59.125;rport=39108;branch=z9hG4bK427fd345
WWW-Authenticate: Digest realm="HOSTNAME",nonce="02761fff7fe026ef1b8094fa55967df0",opaque="02759ce027aa9d5",stale=false,algorithm=MD5
Server: Cirpack/v4.56k (gw_sip)
Content-Length: 0

<------------->

--- (9 headers 0 lines) ---
Retransmitting #2 (NAT) to HOST_IP:5060:
REGISTER sip:HOSTNAME SIP/2.0
Via: SIP/2.0/UDP 10.0.61.20:5060;branch=z9hG4bK427fd345;rport
Max-Forwards: 70
From: <sip:NUMBER@HOSTNAME>;tag=as378b679a
To: <sip:NUMBER@HOSTNAME>
Call-ID: 5a3f7a416c0dde1278b446d9577df3b3@[::1]
CSeq: 3331 REGISTER
User-Agent: FPBX-2.10.1(1.8.17.0)
Expires: 120
Contact: <sip:NUMBER@10.0.61.20:5060>
Content-Length: 0


---

<--- SIP read from UDP:HOST_IP:5060 --->
SIP/2.0 401 Unauthorized
Call-ID: 5a3f7a416c0dde1278b446d9577df3b3@[0:0:0:0:0:0:0:1]
CSeq: 3331 REGISTER
From: <sip:NUMBER@HOSTNAME>;tag=as378b679a
To: <sip:NUMBER@HOSTNAME>;tag=00-08056-0276201e-4ee1eeb07
Via: SIP/2.0/UDP 10.0.61.20:5060;received=87.248.59.125;rport=39108;branch=z9hG4bK427fd345
WWW-Authenticate: Digest realm="HOSTNAME",nonce="02761fff7fe026ef1b8094fa55967df0",opaque="02759ce027aa9d5",stale=false,algorithm=MD5
Server: Cirpack/v4.56k (gw_sip)
Content-Length: 0

<------------->

[...]

Hi,
Are you using any softphone or IP phone or any simulator. We have tested this scenario in our site and it works fine. The client should support MD5 algorithm and openSSL etc to send Authorization header in response to 401 Unauthorized from Asterisk

Thanks

Hi, actually it’s an Asterisk PBX on a dedicated HP Proliant micro-server, trying to register the VoIP trunk.
Inspired by your comment I checked for “Authorization requirements”: OpenSSL is installed and MD5 is available as well. Also tested same parameters on another machine and they work, so cannot be server-side problem.
So the machine has something wrong, I say I would debug it, but I don’t know where to start…

Hi,

Is it like an endpoint behind Asterisk trying to register to or via a server Cirpack. Could you send a network level architecture diagram and traces on asterisk. Have you configured the SIP trunk as per asterisk’s format. please check. when you are saying it is working in another set up , do you mean asterisk in other set up is able to register the trunk with the server(peer)

Thanks

Actually here we are talking about a very basic network environment: Asterisk PBX machine itself is trying to register a remote VoIP public trunk on our provider registrar server, through Internet. So basically there are PBX – router – WAN – router – Registrar.

The other machine I used for testing is architecturally the same as for either software and hardware, just on a totally different geographic location and WAN, and it is able to register the same trunk by same parameters.

Asked provider about this and came out that our Asterisk PBX is trying to register to their server but is not providing any “Authorization” digest, therefore Registrar keep rejecting it because of lack of authentication. Thus this topic.

I hope to have put some light on the situation answering your polite questions.

Can you please post the SIP Trunk definition in sip.conf?

It’s that in the first thread post, that is:

[NUMBER]
username=NUMBER
secret=PASSWORD
type=peer
srvlookup=yes
realm=HOSTNAME
insecure=port,invite
host=HOSTNAME
qualify=yes
fromdomain=HOSTNAME
fromuser=HOSTNAME
sendrpid=no

The remote system is broken. Call-IDs are opaque strings, but it has rewritten an IPV6 address in the call-id with an alternative form of the same address.

Unless there is some special exception for IPV6 address literals, that is not allowed.

Thank you for your point david55.
So, do you mean that local system does not understand that

turned to

by the remote system? Or I missed something about your meanings?

RFC 3261

[quote]8.1.1.4 Call-ID

The Call-ID header field acts as a unique identifier to group
together a series of messages. It MUST be the same for all requests
and responses sent by either UA in a dialog. It SHOULD be the same
in each registration from a UA.[color=#FF0000]simply compared byte-by-byte[/color].
[/quote]

[quote]20.8 Call-ID

The Call-ID header field uniquely identifies a particular invitation
or all registrations of a particular client. A single multimedia
conference can give rise to several calls with different Call-IDs,
for example, if a user invites a single individual several times to
the same (long-running) conference. Call-IDs are case-sensitive and
are [color=#FF0000]simply compared byte-by-byte.[/color][/quote]

The two strings you quote are not byte for byte identical, so they are not the same call-id.

The part after the ‘@’ has no meaning beyond being part of the call-id. It is not an IPV6, or any other address literal, so it is not subject to IPV6 address literal equivalences.

The target UAS is broken.

(RFC 6157 makes no mention of call-id, which tends to support the assumption that the base RFC is not overridden for IPv6.)

Good shot david55! That’s a very relevant suggestion.
I am in test with provider already.
That would explain all the timeouts on registration too.
I will let you know the updates.

Just an update: this is not a dead thread.
I am still waiting for reply by our provider.
Updates will be posted. Thanks.

david55 the more days pass the more you are right.
ISP now is telling me to put IPv4-style host part in Call-ID because their server is not IPv6 certified so it translates mistakenly the Call-ID.
In order to try this way, could I at this point set in any way that host part as IPv4? Even just for testing.

Hello
i think i’ve the same problem on a trunk registering

on a asterisknow Asterisk 11.7.0 - Timed out
on an old trixbox Asterisk 1.4.22-4 registering ok

Have you find a solution

Many thanks for any help

------------->
— (9 headers 0 lines) —
Retransmitting #3 (no NAT) to 91.121.129.20:5060:
REGISTER sip:sip.ovh.fr SIP/2.0
Via: SIP/2.0/UDP 192.XXX.X.XX:5060;branch=z9hG4bK605909d9
Max-Forwards: 70
From: sip:0033XXXXXXX@sip.ovh.fr;tag=as2e8c68d5
To: sip:0033XXXXXXX@sip.ovh.fr
Call-ID: 53b5774722a1d2026873af8008a4e839@[::1]
CSeq: 2827 REGISTER
User-Agent: FPBX-2.11.0(11.7.0)
Expires: 120
Contact: sip:0033XXXXXXX@192.XXX.X.XX:5060
Content-Length: 0


<— SIP read from UDP:91.121.129.20:5060 —>
SIP/2.0 401 Unauthorized
Call-ID: 53b5774722a1d2026873af8008a4e839@[0:0:0:0:0:0:0:1]
CSeq: 2827 REGISTER
From: sip:0033XXXXXXX@sip.ovh.fr;tag=as2e8c68d5
To: sip:0033XXXXXXX@sip.ovh.fr;tag=00-07917-00af5349-456ee7071
Via: SIP/2.0/UDP 192.XXX.X.XX:5060;received=109.XXX.XXX.XXX;rport=5060;branch=z9hG4bK605909d9
WWW-Authenticate: Digest realm=“sip.ovh.fr”,nonce=“00af5265550a8cb80e5d316a725e3ad0”,opaque=“00a807924a58ec0”,stale=false,algorithm=MD5
Server: Cirpack/v4.56 (gw_sip)
Content-Length: 0