Registered endpoint becomes unreachable

Hi community,

I am currently trying to enable phone dial-in to a video conferencing system. For this purpose, a service registers an endpoint in Asterik (named after the conference pin) as soon as a conference is started. This works, however after a few seconds, the endpoint becomes ‘unreachable’.

Here is the SIP trace. Does anyone see the problem?

<— Received SIP request (614 bytes) from TCP: —> [56/1942]
REGISTER sip:;transport=tcp SIP/2.0
Via: SIP/2.0/TCP;rport;branch=z9hG4bKcS82tDt5y3QjB
Max-Forwards: 70
From: sip:11919@;tag=D4p1K7tKXNF2j
To: sip:11919@
Call-ID: 44e2ce1c-ba8d-490d-96f9-a38a9028609c
CSeq: 48560034 REGISTER
Contact: sip:auto_to_user@;transport=tcp;gw=conf_11919
Expires: 3600
User-Agent: FreeSWITCH-mod_sofia/1.10.7-release+git~20211024T163933Z~883d2cb662~64bit
Supported: timer, path, replaces
Content-Length: 0

-- Added contact 'sip:auto_to_user@;transport=tcp;gw=conf_11919' to AOR '11919' with expiration of 3600 seconds

<— Transmitting SIP response (486 bytes) to TCP: —>
SIP/2.0 200 OK
Via: SIP/2.0/TCP;rport=45445;received=;branch=z9hG4bKcS82tDt5y3QjB
Call-ID: 44e2ce1c-ba8d-490d-96f9-a38a9028609c
From: sip:11919@;tag=D4p1K7tKXNF2j
To: sip:11919@;tag=z9hG4bKcS82tDt5y3QjB
CSeq: 48560034 REGISTER
Date: Wed, 02 Mar 2022 13:27:33 GMT
Contact: sip:auto_to_user@;transport=tcp;gw=conf_11919;expires=3599
Expires: 3600
Server: Asterisk PBX 18.10.0
Content-Length: 0

<— Transmitting SIP request (505 bytes) to TCP: —>
OPTIONS sip:auto_to_user@;transport=tcp;gw=conf_11919 SIP/2.0
Via: SIP/2.0/TCP;rport;branch=z9hG4bKPjaac2eeb2-512f-4518-8c5f-61948dbca419;alias
From: sip:11919@;tag=7aa49f1c-b928-45f7-931b-6aef10d20ffe
To: sip:auto_to_user@;gw=conf_11919
Contact: sip:11919@;transport=TCP
Call-ID: ee8c5fef-3e57-47d7-acd6-e39c2009a26e
CSeq: 27195 OPTIONS
Max-Forwards: 70
User-Agent: Asterisk PBX 18.10.0
Content-Length: 0

-- Contact 11919/sip:auto_to_user@;transport=tcp;gw=conf_11919 is now Unreachable.  RTT: 0.000 msec

<— Received SIP request (554 bytes) from TCP: —>
OPTIONS sip:;transport=tcp SIP/2.0
Via: SIP/2.0/TCP;rport;branch=z9hG4bKD21Uv8a9Uce5p
Max-Forwards: 70
From: sip:;tag=eDgtN2BQty5me
To: sip:
Call-ID: 7fd2ef87-14cf-123b-e087-fa163e1adcb8
CSeq: 48557710 OPTIONS
User-Agent: FreeSWITCH-mod_sofia/1.10.7-release+git~20211024T163933Z~883d2cb662~64bit
Supported: timer, path, replaces
Allow-Events: talk, hold, conference, refer
Content-Length: 0

The REGISTER contains the following Contact:


Asterisk is attempting to connect to it in order to send an OPTIONS request to check that it is reachable. This is failing, so it becomes unreachable.
If the Contact is incorrect then you either need to fix it on the remote side, or you can set “rewrite_contact” to “yes” to have the Contact rewritten to the source IP address and port instead.

Thanks for the quick answer. I’m sure I’m just being silly, but I’m stuck.

I think once that I don’t have the possibility to set rewrite_contact, because the endpoint is generated automatically with a name unknown to me in advance (00000-99999). Or where could I put this?

Or for the remote solution, what would a correct contact look like, for example a user that exists on the Freeswitch server that sends the registrations?

Well, things are configured because an endpoint is needed to allow it to REGISTER, alongside an AOR. So you’d specify “rewrite_contact” on that endpoint.

As for what it should be - I don’t know. The request came from It’s quite possible the Contact should be that, instead.

I don’t understand what you mean by this. What is automatically generating the endpoint? Is it generating it in Asterisk, or remotely? As long as the 11919 is consistent, you don’t need to know what the other end calls the end point. If it isn’t consistent, you can’t know what is trying to register. If something is automatically populating pjsip.conf, you need to get support from the people who supplied that something.

Also, as FreeSwitch is also a PABX, I would expect to have a single end point, rather than one for every possible number at the other side.

Are you sure you cannot use static IP addresses, and avoid registration entirely?

Thanks again for the responses david and jcolp!

This backend service is generating the endpoints Astregbackend.

Whenever a conference is created, a service makes the Freeswitch server register the conference with my Asterisk server. On the Asterisk Server, another service creates these endpoints.

Whenever a User calls a number in the Sip-Trunk to which our Asterisk has registered itself, he/she is asked to type a 5-digit number, which is the conference PIN as well as the endpoint used by Asterisk. Then the dialplan should route the user to the respective conference. Therefore, I think I cannot use static IP addresses, as there may be multiple conferences.

This isn’t a normal use of Asterisk. There doesn’t seem to be a lot of documentation and this also seems to be in the context of another piece of software. There are hints that it might be using Asterisk Realtime Architecture, but if it is using pjsip.conf, and I understand it correctly, it is generating 100,000 endpoints, which I’m pretty sure will stress Asterisk.

Unless it is both using pjsip.conf, and they have been invoking suitable templates, I think you are going to have to modify their code. I can’t think of any case where the right place to get support from isn’t the creators of the third party software.

They seem to be suggesting 11 digits numbers, and I think there is no way that wouldn’t run Asterisk out of memory if you used pjsip.conf, and it is generating the whole range. I don’t see it saying anything about a parameter that control sparseness.

The endpoints are only generated, when a conference is started. Also, yes, a Redis-Server is used to store the endpoints, aors and auths of the conferences.

But you are right, maybe this is the wrong place to search for answers. I am still really thankful for your responses and time! I will try to figure it out :slight_smile:

Not a term that I’ve ever heard used, let alone in the context of Asterisk.

Sorry, a simple key-value store. Server was totally the wrong word

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