[asterisk-bugs] [JIRA] (ASTERISK-29111) res_pjsip_outbound_registration: Documentation for TCP/TLS transports.
Alexander Traud (JIRA)
noreply at issues.asterisk.org
Wed Oct 7 04:41:36 CDT 2020
Alexander Traud created ASTERISK-29111:
------------------------------------------
Summary: res_pjsip_outbound_registration: Documentation for TCP/TLS transports.
Key: ASTERISK-29111
URL: https://issues.asterisk.org/jira/browse/ASTERISK-29111
Project: Asterisk
Issue Type: Bug
Security Level: None
Components: Resources/res_pjsip_outbound_registration
Affects Versions: 16.13.0
Reporter: Alexander Traud
Severity: Minor
The general documentation [states|https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+Configuration_res_pjsip#Asterisk16Configuration_res_pjsip-endpoint_transport]:
bq. Not specifying a transport will select the first configured transport in pjsip.conf which is compatible with the URI we are trying to contact.
The specific documentation of registrations [states|https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+Configuration_res_pjsip_outbound_registration#Asterisk16Configuration_res_pjsip_outbound_registration-registration_transport]:
bq. A transport configured in pjsip.conf. As with other res_pjsip modules, this will use the first available transport of the appropriate type if unconfigured.
The terms ‘appropriate’ and ‘compatible’ are not explained.
I created (just) a TCP transport and a SIP registration. The registration did not specify the transport. This created the error:
bq. Could not create an object of type 'registration' with id '…' from configuration file 'pjsip.conf'
No additional information was printed what caused this error.
The call stack is:
sorcery_config_internal_load
⤷ ast_sorcery_objectset_apply
⤷ sip_outbound_registration_apply
⤷ sip_outbound_registration_regc_alloc
⤷ sip_dialog_create_contact
There, the state is:
{code}
selector = { type = PJSIP_TPSELECTOR_NONE, disable_connection_reuse = 0, u = {transport = 0x0, listener = 0x0, ptr = 0x0}}){code}
which sets:
{code}type = PJSIP_TRANSPORT_UNSPECIFIED{code}which then simply returns a {{-1}}. The current source code expects UDP and TLS transports only. This is not explained in the documentation. Currently, to use a TCP transport, that must be specified within a registration. Consequently, as a follow-up issue, the IP version gets fixed and the TCP client is not automatically dual-stack capable anymore.
However, a similar issue exists with TLS transports: I have to use the URI scheme SIPs in the {{server_uri}} otherwise just UDP transports are matched. Again, this is not explained in the documentation. And if there is no UDP transport at all, the same error above, again without any further explanation is printed.
Consequently:
# The source code has to be updated to print a reason where/why it failed. I am a long-term contributor. To follow that call-stack five layers deeper compared to where the error message was created, took even me some time.
# The documentation has to be updated to explain ‘appropriate’ and ‘compatible’.
There is another issue: PJSIP supports DNS-NAPTR. That should be leveraged to select the transport (UDP, TCP, and TLS) automatically.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list