[Home]

Summary:ASTERISK-29242: pjsip: Documentation for transport handling is short / partly wrong
Reporter:Michael Maier (micha)Labels:
Date Opened:2021-01-12 00:47:31.000-0600Date Closed:
Priority:MinorRegression?No
Status:Open/NewComponents:Documentation
Versions:18.0.1 18.1.0 Frequency of
Occurrence
Related
Issues:
Environment:CentOS 7 x86_64, pjsipAttachments:
Description:I did some research on the meaning of transports and what they are used for. I used this documentation [here|https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Configuration_res_pjsip#Asterisk18Configuration_res_pjsip-endpoint_transport] and [here|https://github.com/asterisk/asterisk/blob/master/configs/samples/pjsip.conf.sample] - the latter list some example transports and states:
"; You can have more than one of any type of transport, as long as it doesn't
; use the same resources (bind address, port, etc) as the others."

The statement, that there can't be different transports using same bind address and port seems to be wrong as I can define (and use) pretty much transports using the same bindaddr like 0.0.0.0 (you even can omit the port completely if you define a method(?) - I think the port is derived by the standard port of the given method). If you use the port "0", no bind seems to be done (at the beginning) at all (at least you can't see it in netstat).

You should write something about the usage of a transport when used for a trunk, i.e. an endpoint, which registers itself to an ISP e.g.
If you do not specify any transport for this trunk, the first appropriate transport would be used automatically according documentation (in FreePBX, it's impossible to not define any transport for a trunk - you always have to define one).
You should write, that all trunks e.g. are using the same connection to the ISP, if you register more than one number (yes, that's not seldom), if they are using the same transport. If you want asterisk to use another local port for the n-th trunk configuration to the same ISP (and therefore an own connection per registered number), you have to define n equal transports, which only differ in their name (there are ISPs which can't handle correctly n registered numbers using the same connection and I doubt asterisk can - because I faced strange timeout problems under certain conditions e.g.).

Could you please adjust the existing documentation to clarify those points? Especially, what exactly happens if you use port 0.

(The asterisk versions I mentioned above are just examples because I must set some version)
Comments:By: Asterisk Team (asteriskteam) 2021-01-12 00:47:33.781-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].

By: Benjamin Keith Ford (bford) 2021-01-12 09:39:33.421-0600

We appreciate the difficulties you are facing, however this does not appear to be a bug report. We do have an issue in the queue to update PJSIP documentation, however there is no timeframe on when it will be worked. If you wish to submit a patch that updates the documentation, you can find information on how to do that by going to the below address.

https://wiki.asterisk.org/wiki/display/AST/Gerrit+Usage



By: Michael Maier (micha) 2021-01-20 05:43:32.936-0600

I don't think it's a good idea if someone writes documentation who isn't enough familiar with the underlying code and concepts as a whole. It's ok for me if you plan to update the current documentation. For me it's important to especially enhance the transport related documentation regarding trunk connections - what's the role of a transport here, if you don't need any listener at all (a (tcp/tls) trunk (extension), which registers itself to a VoIP service doesn't need a listener)?

By: Joshua C. Colp (jcolp) 2021-01-20 05:45:29.200-0600

I've acknowledged this issue, but I have no time frame on when it would get looked into.

By: Michael Maier (micha) 2021-01-20 09:26:21.813-0600

No problem - fine with me!
Thanks!

By: Alexander Traud (traud) 2021-08-26 03:35:18.211-0500

Micheal, is ASTERISK-29111 related?

By: Michael Maier (micha) 2021-08-26 14:04:10.041-0500

Well, they are both about transport - but the goals seem to be completely different to me. If I got you correctly, your final goal is to automatically find an existing transport for a trunk register (based on NAPTR e.g.). This means, there is no given / configured dependency between register and transport.

My goal is the complete opposite: each Register gets its own and individual transport.
What's the use case?
- Asterisk resides on a machine with many different interfaces and networks
- Providing security / availability by network design - no fail2ban necessary at all
- One of the interfaces is a dynamic interface providing a dynamic global IP (via pppoe e.g.)
- Asterisk gets connected by internal phones and connects itself via Register to several trunks to SIP providers using RFC 5626.
- Asterisk Registers several numbers to the same SIP provider (-> same destination for several trunks)
- The trunks have to use TLS

If you would let Asterisk decide which device / transport to use, it most probably would use the pppoe interface for Registration to the trunk. But this would be pretty bad, because it would open a completely unnecessary listener to the internet and Asterisk must be restarted to handle the changed interface after pppoe restart.
Therefore it's better to use an internal interface and configure NAT (see [here|https://www.ip-phone-forum.de/threads/asterisk-pjsip-und-nat-nicht-so-einfach-wie-man-glaubt.310575/post-2434183]).
Another problem is: You would route all trunks to the same SIP provider through the same connection, which is bad, too, because if one of the trunks is unregistered, the SIP provider (at least Deutsche Telekom) will drop the complete connection, which breaks all other trunks using the same connection, too.

To solve all the requirements, you have to define several transports (which can reside on the same interface). Each trunk now is getting its own transport. This ensures, that each trunk gets its own RFC 5626 flow and each trunk acts completely independent of all other trunks - even if they are using the same destination server.

I hope I was able to explain the goal how the transport can be used, too and that this should be part of the documentation.