Could not create dialog to invalid URI?

Hello, I want to make an outbound call, but it doesn’t work. I always get the info “all lines are busy. Please call again later”. I don’t know what to do to solve the problem. I use a trunk from sipgate (de) (basic). I can make inbound call, but outbound doesn’t work,

res_pjsip.c: Endpoint ‘3330858e0’: Could not create dialog to invalid URI ‘3330858e0’. Is endpoint registered and reachable?
204 [2021-02-17 16:11:32] ERROR[31907] chan_pjsip.c: Failed to create outgoing session to endpoint ‘3330858e0’
205 [2021-02-17 16:11:32] WARNING[17437][C-00000059] app_dial.c: Unable to create channel of type ‘PJSIP’ (cause 3 - No route to destination)

Do someone know how what to do and how to solve this problem?
I am grateful for any advice
Peter.

You not giving us much context (working before? Any changes made, etc.), but from the Asterisk site:

Could not create dialog to invalid URI

A URI is constructed out of a scheme and a hostname at a minimum. If you specify merely a hostname, such as “asterisk.org”, this will be considered invalid as PJSIP requires a scheme to be specified and does not automatically assume that it is sip. You would need to add “sip:” to the front resulting in “sip:asterisk.org” to turn it into a SIP URI. Note that there may be other log messages which convey this issue, so be sure to check both your console log at startup and at runtime to see if this is potentially a problem.

Output of a call example would help.

I believe there is some buggy code somewhere that is mangling the URI that PJSIP is expecting. I’m seeing this as well. More specifically, I believe something is wrong in the reconnection logic. For example, if I reset the state table on my firewall (pfSense), I get these invalid URI errors and I’m unable to make calls over these trunks. However, if I go into the Trunk configuration and just click “save”, this kicks off a new connection, presumably with different connection logic and thus a corrected URI and everything works fine. Running fwconsole restart also seems to fix it as well.

[2021-02-22 12:58:35] ERROR[26520] res_pjsip.c: Endpoint 'us-west-or.sip.flowroute.com': Could not create dialog to invalid URI 'us-west-or.sip.flowroute.com'.  Is endpoint registered and reachable?
[2021-02-22 12:58:35] ERROR[26520] chan_pjsip.c: Failed to create outgoing session to endpoint 'us-west-or.sip.flowroute.com'

In other cases, I see the URI being formed as sip:us-west-or.sip.flowroute.com which is correct. So I believe this is something broken somewhere.

If the endpoint is literally named ‘us-west-or.sip.flowroute.com’ then the message can be confusing, because you may be expecting it as a URI when in really it’s just the endpoint name.

What’s more likely happening is that Asterisk is sending SIP OPTIONS requests and not getting a response, which would show up in “pjsip show contacts”.

As well if UDP is in use, there is no connection as it is connectionless so there is no logic to “reconnect”.

1 Like

Is this logging logic not this?

[2021-02-22 12:58:35] ERROR[26520] res_pjsip.c: Endpoint '<endpoint name>': Could not create dialog to invalid URI '<endpoint uri>'. Is endpoint registered and reachable?

In my case, yes the name is the “same” as the server address, but it still seems odd if the logic above is correct to ever see this error.

If there is no reachable URI then the log message will have both the endpoint name in the endpoint name and endpoint URI place. It could be improved, certainly.

As a test I changed the server address for this trunk to sip:us-west-or.sip.flowroute.com and with this the trunk never comes up and I see this error

[2021-02-22 12:58:35] ERROR[26520] res_pjsip.c: Endpoint 'us-west-or.sip.flowroute.com': Could not create dialog to invalid URI 'sip:sip:us-west-or.sip.flowroute.com'. Is endpoint registered and reachable?

This seems to contradict what you’re saying?

In that case it appears that the server URI was written with sip: in front, so it may certainly be that something caused it to be missing in your original statement.

The fact you’re using it for the endpoint name confuses things. Not the code that is, but it makes it difficult to say precisely.

Yea I can certainly change the names and produce clearer logging.

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