SIP/2.0 484 Address Incomplete error during outgoing call

Hello,
I have a problem with one of my SIP Trunk Providers.
The provider requires an outbound proxy. Below is the PJSIP configuration on my Asterisk:

[mycompany]
type=registration
transport=transport-udp
outbound_auth=mycompany
server_uri=sip:voip.vivavox.it
client_uri=sip:myusername@voip.vivavox.it
contact_user=myusername
retry_interval=60
expiration=3600
line=yes
endpoint=mycompany

[mycompany]
type=auth
auth_type=userpass
username=myusername
password=mypassword
realm=voip.vivavox.it

[mycompany]
type=aor
contact=sip:voip.vivavox.it
;outbound_proxy=sip:voip.vivavox.it

[mycompany]
type=endpoint
context=mycompany-sip
aors=mycompany
disallow=all
allow=alaw
allow=ulaw
direct_media=no
from_user=myusername
outbound_auth=mycompany 
language=it
outbound_proxy=sip:voip.vivavox.it

[mycompany]
type=identify
match=voip.vivavox.it
endpoint=mycompany

Here are the SIP messages exchanged between my Asterisk server (on public IP no NAT) and the provider’s server

2022/03/09 22:34:33.706323 80.211.XXX.XXX:5060 -> 83.211.XXX.XXX:5060
INVITE sip:voip.vivavox.it SIP/2.0
Via: SIP/2.0/UDP 80.211.XXX.XXX:5060;rport;branch=z9hG4bKPja0da9f47-7e59-4bd0-bd2e-d4692daee656
From: <sip:myusername@80.211.XXX.XXX>;tag=b0ed0940-248e-4f2a-aeb5-0f8f4ddc0078
To: <sip:number_called@voip.vivavox.it>
Contact: <sip:myusername@80.211.XXX.XXX:5060>
Call-ID: 952467c9-7ff0-42fa-b6ee-e3acc48160a2
CSeq: 30308 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REFER, MESSAGE
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Route: <sip:number_called@voip.vivavox.it>
Max-Forwards: 70
User-Agent: Asterisk PBX 16.2.1~dfsg-2ubuntu1
Content-Type: application/sdp
Content-Length:   263

v=0
o=- 1157458627 1157458627 IN IP4 80.211.XXX.XXX
s=Asterisk
c=IN IP4 80.211.XXX.XXX
t=0 0
m=audio 16834 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
a=ptime:20
a=maxptime:150
a=sendrecv

2022/03/09 22:34:33.715829 83.211.XXX.XXX:5060 -> 80.211.XXX.XXX:5060
SIP/2.0 484 Address Incomplete
Via: SIP/2.0/UDP 80.211.XXX.XXX:5060;received=80.211.XXX.XXX;rport=5060;branch=z9hG4bKPja0da9f47-7e59-4bd0-bd2e-d4692daee656
From: <sip:myusername@80.211.XXX.XXX>;tag=b0ed0940-248e-4f2a-aeb5-0f8f4ddc0078
To: <sip:number_called@voip.vivavox.it>;tag=2285.eaca5c9583318dcb094d6c412c7d8d8d
Call-ID: 952467c9-7ff0-42fa-b6ee-e3acc48160a2
CSeq: 30308 INVITE
Server: Milano Naz SPS 01
Content-Length: 0


2022/03/09 22:34:33.716073 80.211.XXX.XXX:5060 -> 83.211.XXX.XXX:5060
ACK sip:voip.vivavox.it SIP/2.0
Via: SIP/2.0/UDP 80.211.XXX.XXX:5060;rport;branch=z9hG4bKPja0da9f47-7e59-4bd0-bd2e-d4692daee656
From: <sip:myusername@80.211.XXX.XXX>;tag=b0ed0940-248e-4f2a-aeb5-0f8f4ddc0078
To: <sip:number_called@voip.vivavox.it>;tag=2285.eaca5c9583318dcb094d6c412c7d8d8d
Call-ID: 952467c9-7ff0-42fa-b6ee-e3acc48160a2
CSeq: 30308 ACK
Route: <sip:number_called@voip.vivavox.it>
Max-Forwards: 70
User-Agent: Asterisk PBX 16.2.1~dfsg-2ubuntu1
Content-Length:  0

I cannot understand this type of problem.
Thank you in advance for your help.

You want to enable loose routing on the outbound proxy by having it be the following:

outbound_proxy=sip:voip.vivavox.it\;lr

Though if the contact is the same, you don’t actually need to set an outbound proxy.

If you use an outbound proxy for the endpoint, you also need one for the address of record. This and your contact setting may be responsible for the incomplete looking request URI (INVITE request_uri).

It’s usually difficult to see what the correct settings are, since one does not know how all the fields are evaluated by the service provider. These guys usually have some recommended configurations, which one should read.

I am not sure whether the loose routing parameter is actually required these days, as it now seems to be the standard instead of working with hop lists. At least I have a couple of service providers, where it doesn’t matter whether you specify lr, lr+hide, or nothing.

The loose routing option is necessary, because, without it, the proxy/UAS is required to follow the old rules.

The reason the request URI contains no phone number is because the old rules have been followed by Asterisk.

Friends thank you very much to all of you,
Thank you for the quick and numerous information you have provided me with.
Now I am reencountering a 407 Proxy Authentication. The provider is not giving me much help at the moment. The documentation states that an outbound proxy must be indicated.

My changes, following your valuable information, are the following:

[mycompany]
type=registration
transport=transport-udp
outbound_auth=mycompany
server_uri=sip:voip.vivavox.it
client_uri=sip:myphonenumebr_username@voip.vivavox.it
;contact_user=myphonenumebr_username
retry_interval=60
expiration=3600
line=yes
endpoint=mycompany

[mycompany]
type=auth
auth_type=userpass
username=myphonenumebr_username
password=mypassword
realm=voip.vivavox.it

[mycompany]
type=aor
contact=sip:voip.vivavox.it
outbound_proxy=sip:voip.vivavox.it\;lr 


[mycompany]
type=endpoint
context=mycompany-sip
aors=mycompany
disallow=all
allow=alaw
allow=ulaw
direct_media=no
from_user=myphonenumebr_username
outbound_auth=mycompany
language=it
outbound_proxy=sip:voip.vivavox.it\;lr

[mycompany]
type=identify
match=voip.vivavox.it
endpoint=mycompany

I added in aor section outbound_proxy, according to what I understood from your observations. Am I doing it wrong?

The exchange of SIP messages at the moment are:

2022/03/10 09:26:05.293815 80.211.XXX.XXX:5060 -> 83.211.XXX.XXX:5060
INVITE sip:NUMBER_TO_CALL@voip.vivavox.it SIP/2.0
Via: SIP/2.0/UDP 80.211.XXX.XXX:5060;rport;branch=z9hG4bKPj83db64d4-a279-4f98-811c-4ab1eaf30e14
From: <sip:MYPHONE_NUMBER_USERNAME@80.211.XXX.XXX>;tag=5b51d2fd-ce72-4656-861c-9d848d62d4f1
To: <sip:NUMBER_TO_CALL@voip.vivavox.it>
Contact: <sip:MYPHONE_NUMBER_USERNAME@80.211.XXX.XXX:5060>
Call-ID: 5b384a1d-aedc-468e-a6bc-d56799eb40ef
CSeq: 24837 INVITE
Route: <sip:voip.vivavox.it;lr>
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REFER, MESSAGE
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 16.2.1~dfsg-2ubuntu1
Content-Type: application/sdp
Content-Length:   263

v=0
o=- 1573364767 1573364767 IN IP4 80.211.XXX.XXX
s=Asterisk
c=IN IP4 80.211.XXX.XXX
t=0 0
m=audio 14422 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
a=ptime:20
a=maxptime:150
a=sendrecv

2022/03/10 09:26:05.303481 83.211.XXX.XXX:5060 -> 80.211.XXX.XXX:5060
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 80.211.XXX.XXX:5060;received=80.211.XXX.XXX;rport=5060;branch=z9hG4bKPj83db64d4-a279-4f98-811c-4ab1eaf30e14
From: <sip:MYPHONE_NUMBER_USERNAME@80.211.XXX.XXX>;tag=5b51d2fd-ce72-4656-861c-9d848d62d4f1
To: <sip:NUMBER_TO_CALL@voip.vivavox.it>
Call-ID: 5b384a1d-aedc-468e-a6bc-d56799eb40ef
CSeq: 24837 INVITE
Server: Milano Naz SPS 01
Content-Length: 0


2022/03/10 09:26:05.304788 83.211.XXX.XXX:5060 -> 80.211.XXX.XXX:5060
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 80.211.XXX.XXX:5060;received=80.211.XXX.XXX;rport=5060;branch=z9hG4bKPj83db64d4-a279-4f98-811c-4ab1eaf30e14
From: <sip:MYPHONE_NUMBER_USERNAME@80.211.XXX.XXX>;tag=5b51d2fd-ce72-4656-861c-9d848d62d4f1
To: <sip:NUMBER_TO_CALL@voip.vivavox.it>;tag=2285.1130194a3a7c2d2041d79aa1a74c5c8a
Call-ID: 5b384a1d-aedc-468e-a6bc-d56799eb40ef
CSeq: 24837 INVITE
Proxy-Authenticate: Digest **realm="voip.eutelia.it",** nonce="6229c4697076d54623813a04d8afeda774731bab", qop="auth"
Server: Milano Naz SPS 01
Content-Length: 0


2022/03/10 09:26:05.304992 80.211.XXX.XXX:5060 -> 83.211.XXX.XXX:5060
ACK sip:NUMBER_TO_CALL@voip.vivavox.it SIP/2.0
Via: SIP/2.0/UDP 80.211.XXX.XXX:5060;rport;branch=z9hG4bKPj83db64d4-a279-4f98-811c-4ab1eaf30e14
From: <sip:MYPHONE_NUMBER_USERNAME@80.211.XXX.XXX>;tag=5b51d2fd-ce72-4656-861c-9d848d62d4f1
To: <sip:NUMBER_TO_CALL@voip.vivavox.it>;tag=2285.1130194a3a7c2d2041d79aa1a74c5c8a
Call-ID: 5b384a1d-aedc-468e-a6bc-d56799eb40ef
CSeq: 24837 ACK
**Route: <sip:voip.vivavox.it;lr>**

I am taking advantage of your expertise to ask you some questions to fill in some of my gaps, but if and if alone, it doesn’t take too long.

  1. What is lost routing?
  2. @EkFudrek what do you mean by; “If you use an outbound proxy for the endpoint, you also need one for the address of record. This and your contact setting may be responsible for the incomplete looking request URI (INVITE request_uri).” I returned to type=aor contact=sip: voip.vivavox.it instead of contact: my_phone_number (username).

After setting outbound_proxy = sip: voip.vivavox.it;lr in the INVITE message I observe the Route header as follows:
Route: <sip: voip.vivavox.it;lr> is normal, correct?

If I have not misunderstood the advice, I added the outbound proxy in the type = aro section.

Thank you very much, you have all been, as always, very kind, and your availability is genuinely commendable.

I apologize and thank you again for your help.

Loose routing, not lost routing. It is what the lr parameter sets, and is described in RFC 3261.

The realm in your auth section doesn’t match the realm in the Proxy-Authenticate.

In fact, there is no need to even set a realm for this case. If not set then Asterisk will use what the remote side uses automatically.

The comment referred to you initial post where you commented out the outbound_proxy for the address of record.

As far as the 407 goes, it is usually not an error. If your provider thinks that you should drop your pants, you should do so. You either get a “401 Unauthorized” or a “407 Proxy…” and they’ll add a WWW-Authenticate header. Asterisk simply registers again with an Authorization header. Then you should see a 200.

Dear all,
I am perplexed. Certainly, I am not very expert, but it is the only SIP provider I cannot correctly configure the SIP Trunk …

This configuration is my latest version of the psjsip definition. Hoping I understand your considerations and advice. But I have obtained SIP / 2.0 407 Proxy Authentication Required

[mycompany]
type = registration
transport = transport-udp
outbound_auth = mycompany
server_uri = sip: voip.vivavox.it
client_uri = sip: myphonenumer_username@voip.vivavox.it
; contact_user = myphonenumer_username
retry_interval = 60
expiration = 3600
line = yes
endpoint = mycompany

[mycompany]
type = auth
auth_type = userpass
username = myphonenumer_username
password = mypassword
**; realm = voip.vivavox.it**

[mycompany]
type = aor
contact = sip: voip.vivavox.it
**outbound_proxy = sip: voip.vivavox.it\;lr**

[mycompany]
type = endpoint
context = mycompany-sip
aors = mycompany
disallow = all
allow = alaw
allow = ulaw
direct_media = no
from_user = myphonenumer_username
outbound_auth = mycompany
language = it
**outbound_proxy = sip: voip.vivavox.it\;lr**

[mycompany]
type = identify
match = voip.vivavox.it
endpoint = mycompany

I ask you, again sorry, could you possibly give me the points that you think might be wrong?

The service provider says the outbound proxy needs to be set. I believe this is because, as a reseller, they rely on another provider’s infrastructure. What I had noticed is that if I do not put the outbound proxy and the realm that is answered at the first authentication on the proxy (realm = voip.eutelia.it and not voip.vivavox.it), my Asterisk PBX, according to my level of knowledge, he answered by adding the Proxy-Authentication Header, but in any case, the outgoing call attempt failed.

Returning to the last configuration, I reported at the beginning of this post I get the following:

  1. At the asterisk level CLI: res_pjsip_outbound_authenticator_digest.c: 190 digest_create_request_with_auth: Endpoint: ‘mycompany’: Authentication credentials not accepted by server.

While at the SIP signaling level between my Asterisk server and the provider I get the following:

2022/03/10 13: 50: 08.432326 80.211.XXX.XXX:5060 -> 80.211.XXX.XXX:5060
INVITE sip: number_called@voip.vivavox.it SIP / 2.0
Via: SIP / 2.0 / UDP 80.211.XXX.XXX:5060;rport;branch=z9hG4bKPjabf0465e-4a86-44a0-a026-14c071d56554
From: <sip: myphonenumber_username@80.211.XXX.XXX>; tag = f2528f8a-c2b4-402b-95a6-9052d4474ddd
To: <sip: number_called@voip.vivavox.it>
Contact: <sip: myphonenumber_username@80.211.XXX.XXX: 5060>
Call-ID: 7e857623-b43a-41c2-9547-a81be6ae92ff
CSeq: 3879 INVITE
Route: <sip: voip.vivavox.it; lr>
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REFER, MESSAGE
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 16.2.1 ~ dfsg-2ubuntu1
Content-Type: application / sdp
Content-Length: 261

v = 0
o = - 687758508 687758508 IN IP4 80.211.XXX.XXX
s = Asterisk
c = IN IP4 80.211.XXX.XXX
t = 0 0
m = audio 10 490 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
a = ptime: 20
a = maxptime: 150
a = sendrecv

2022/03/10 13: 50: 08.441835 80.211.XXX.XXX:5060 -> 80.211.XXX.XXX:5060
SIP / 2.0 100 Trying
Via: SIP / 2.0 / UDP 80.211.XXX.XXX:5060;received=80.211.XXX.XXX;rport=5060;branch=z9hG4bKPjabf0465e-4a86-44a0-a026-14c071d56554
From: <sip: myphonenumber_username@80.211.XXX.XXX>; tag = f2528f8a-c2b4-402b-95a6-9052d4474ddd
To: <sip: number_called@voip.vivavox.it>
Call-ID: 7e857623-b43a-41c2-9547-a81be6ae92ff
CSeq: 3879 INVITE
Server: Milan Naz SPS 04
Content-Length: 0


2022/03/10 13: 50: 08.443245 80.211.XXX.XXX:5060 -> 80.211.XXX.XXX:5060
SIP / 2.0 407 Proxy Authentication Required
Via: SIP / 2.0 / UDP 80.211.XXX.XXX:5060;received=80.211.XXX.XXX;rport=5060;branch=z9hG4bKPjabf0465e-4a86-44a0-a026-14c071d56554
From: <sip: myphonenumber_username@80.211.XXX.XXX>; tag = f2528f8a-c2b4-402b-95a6-9052d4474ddd
To: <sip: number_called@voip.vivavox.it>; tag = 2285.9e825287920ff0977b92f8af2e6f4571
Call-ID: 7e857623-b43a-41c2-9547-a81be6ae92ff
CSeq: 3879 INVITE
Proxy-Authenticate: Digest realm = "voip.eutelia.it", nonce = "622a024c61e77efb1f8db2cba003a9b79cb42eaa", qop = "auth"
Server: Milan Naz SPS 04
Content-Length: 0


2022/03/10 13: 50: 08.443437 80.211.XXX.XXX:5060 -> 80.211.XXX.XXX:5060
ACK sip: number_called@voip.vivavox.it SIP / 2.0
Via: SIP / 2.0 / UDP 80.211.XXX.XXX:5060;rport;branch=z9hG4bKPjabf0465e-4a86-44a0-a026-14c071d56554
From: <sip: myphonenumber_username@80.211.XXX.XXX>; tag = f2528f8a-c2b4-402b-95a6-9052d4474ddd
To: <sip: number_called@voip.vivavox.it>; tag = 2285.9e825287920ff0977b92f8af2e6f4571
Call-ID: 7e857623-b43a-41c2-9547-a81be6ae92ff
CSeq: 3879 ACK
Route: <sip: voip.vivavox.it;lr>

I ask the question again, but is it normal that the sequence of characters “; lr” is inserted in the Route header?
Route: <sip: voip.vivavox.it;lr>

I thank you for the patience and the spirit of collaboration that you have offered me.
Thank you so much!

These should not be the same! The second one should be an address that you do not not need to redact.

There should not be a space between “:” and “v”

Hi @david551,
I was wrong when replacing it with “XXX.XXX”. The correct header is as follows:
2022/03/10 14: 28: 10.601752 80.211.XXX.XXX:5060 → 83.211.XXX.XXX:5060.

For your second observation, again, there must be a formatting error when copying and pasting from vi.

There are no spaces in the configuration file.

Thanks a lots!

It’s a bit difficult to analyse your problem, since there is only little information. In praxis one would start with something and then dig deeper.

Since you are trying to place calls, does the registration process work? If you start with asterisk -rvvv, are there any lost contact messages after a while?

BTW, I checked the vivavox.it webpage and there is nada technical information. In such a situation, one could also imagine another provider, :innocent: .

Hello @EkFudrek ,
You’re right! Actually, that is a backup line on which I have telephone credit. Honestly, I wish it worked since I paid! :slight_smile:
Registration is successful and stable, incoming calls work regularly. But, unfortunately, there is no way to make it work for outgoing calls. They told me they sent my warning to second-tier support, but nothing. In fact, there is only a tiny guide to use it with Zoiper, but we Asterikno lovers and users, this is certainly not what we want to do with a sip trunk!
I don’t know I could do a lower level capture?

Thank you very much for sharing my problems. :raised_back_of_hand:

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