13.11.2/PJSIP: Identify endpoint for inbound calls

It appears as if the documentation on that matter on the wiki here https://wiki.asterisk.org/wiki/display/AST/PJSIP+Configuration+Sections+and+Relationships is not quite correct. It states:

However I even went as far as to look at the source code, and the only thing it ever seems to match upon is the “From:” header, not the “To:” header.

Given the fact that the endpoint identifiers in pjsip are modular, I still think there should be a way to match on IP address first and “To:” header second to identify the correct endpoint for inbound calls in a scenario where you register multiple DIDs with the same ITSP. A similar issue has been discussed here https://community.asterisk.org/t/sip-header-did-help/66528/2, so maybe it’s not as uncommon as I thought? Personally I feel that neither the use of the ‘line’ parameter, nor reyling on some header parsing magic in the dialplan appears to be the correct approach to solving this kind of problem.