In 180 ring missing contact info

Yes, but after disabling ALG you need to put the external IP adres in the configs. Otherwise the server sends the wrong IP (unreachable) adres in the SIP messages.

Top of my pjsip.conf:

bindport = 5081


type = transport
protocol = udp
bind =

external_media_address = x.x.x.x
external_signaling_address = x.x.x.x

local_net =

x.x.x.x being my external IP

I also find it very strange you have it working with proxy, ALG disabled and your local IP in the headers. That shouldn’t work so I still suspect there is a ALG in there somewhere that’s messing things up.

(Just try the external IP in the configs first.)

Hi, thank you again to the suggestions
However, I have exactly the same problem, I never receive the ack, but I have the public IP

The same problem Dreaded "incoming calls drop after 30 seconds" - #10 by Stewart1 - General Help - FreePBX Community Forums and I believe that I proved, with my proxy, that for some reason freephoneline drop the packet if the contact doesn’t include the user.
I agree that the user should not take into consideration in that packet, and the RFC state that is optional, but why don’t give the possibility to use it?

The answer is, because noone has implemented it.

I understand that the provider is using it in the wrong way, but it will be great to be added in asterisk and/or pjsip for 0.00001% of the users :frowning: This will not be against the RFC however probably not so much use it, but in the same time can help some. If someone knows how to make a little patch I will apply to my asterisk. Sorry but I had an average knoledge of asterisk more than 10 years ago (I believe it was <=1.6) know I only transfer the configuration :frowning:

I haven’t said such a thing can’t go in or that it wouldn’t, just that it doesn’t currently work that way, and noone has written anything to do it. It’s not something I’m working on.

I hope that this can be taken into consideration to be added

Isn’t this up to the pjproject at ?
Although pjproject is bundled with asterisk, the source is downloaded from there during compilation with some patches (unless I totally misunderstood the process).

(Without any knowledge of C and pjproject my guess is that you could need to adjust it in sip_dialog.c > create_uas_dialog.)

It’s Asterisk functionality, it is what constructs Contact headers.

This my mod to get it work

--- ../1/asterisk-16.30.1/res/res_pjsip.c	2023-07-07 15:00:32.000000000 -0400
+++ res/res_pjsip.c	2023-08-04 16:21:02.930673143 -0400
@@ -962,9 +962,11 @@
 	contact.ptr = pj_pool_alloc(rdata->tp_info.pool, PJSIP_MAX_URL_SIZE);
 	contact.slen = pj_ansi_snprintf(contact.ptr, PJSIP_MAX_URL_SIZE,
-			"<%s:%s%.*s%s:%d%s%s>",
+			"<%s:%s%s%s%.*s%s:%d%s%s>",
 			uas_use_sips_contact(rdata) ? "sips" : "sip",
 			(type & PJSIP_TRANSPORT_IPV6) ? "[" : "",
+			(!ast_strlen_zero(endpoint->contact_user))?endpoint->contact_user:"",
+			(!ast_strlen_zero(endpoint->contact_user))?"@":"",
 			(type & PJSIP_TRANSPORT_IPV6) ? "]" : "",

Haha, just tried something similar but my change was this:


I don’t think it would matter which ‘user’ you pass and it can even be something nonsense (like ‘dummy’) because it doesn’t get used anyway. Sending a real user would even be a security issue. (I’m not sure what your endpoint->contact_user containt at the moment)

BTW. Seeing the Contact header from the INVITE from the calling server, it also doesn’t have the a ‘user’ included, so why would it demand it from the other side. Really buggy server.

And also… …/1/asterisk-16.30.1/res/res_pjsip.c ???
I thought you where on 20.4.0 ?

1 Like

In one of my test, it was to go back to 16 (in the previous server I was using 16 with chan_sip), but it is the same mod and I didn’t try to pass a wrong contact_user, if they test it I believe/hope they need it
Thank all to have pushed me to look in the code

I can confirm, I modified the contact_user to use a wrong one, and my 200 was not ack
Therefore, it is the confirmation that it is used, and it must be the right one

Sorry but I cannot contact the provider since they don’t offer any kind of support

Mmm, that’s weird. I’m not sure to what (user)info they would check it against. 180/183 RINGING would have the same dummy contact. Unless it’s their login-username which is used there in endpoint->contact_user.

But I’m glad it works now.
It’s up to the developers to see if they make an option for this.
(although I’m not sure if you would need to file it in the issue section for this to happen)

Since I need it :D, I believe that it can be inserted since it is not against the RFC, it is considered optional, therefore, the user should decide :smiley:

Everything goes through Github, and patches need to be under a contributor license agreement to be included. We won’t just take patches from this forum for example and include them.

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