Project

General

Profile

Feature #2631

Updated by neels over 6 years ago

Break that direct link between '23@mgw' endpoint name and the 23rd item in an array of endpoints. 

 A client -should should be able to name their endpoints arbitrarily, say the MSC has "1@msc" and the BSC has "1@bsc" or even something completely random and/or not related to integer digits-. digits. Upon CRCX, we create an endpoint in an llist, manage it -by by whichever name the client gave it-, it, by looking up the name in the llist. 

 (Optimizations applied (later) might be to have some fixed size of unused endpoints instead of allocating single llist items, and to use a hashed list for faster endpoint lookup. But for starters, allocating the few endpoints we will be using one by one and iterating all of them to find a given name is far sufficient.) 

 A practical example is MSC and BSC using the same OsmoMGW in a network-in-the-box installation. In the current osmo-mgw, I want to tell the MSC to use a given range of endpoints, and the BSC to use another range, so that they don't accidentally claim the same endpoints for separate purposes. But how to pick the ranges? Say I am ambitious and just to be future compatible, I pick 1..1024 for the MSC and 1025..2048 for the BSC. Now the MGW would maintain 2k unused endpoint structs, regardless of how many are actually in use, out of a cosmetic choice of identifier tokens. The MGW would allocate all of these unused endpoints and iterate over all of them during every mgcp_keepalive_cb(). 

 This is a leftover from osmo-bsc_mgcp's tactics of immediately binding all of the RTP ports, where it indeed makes sense to also have all of them allocated; and of that "port magic" where the endpoint ID directly corresponds to a specific port number. Let's move away from that. 

Back

Add picture from clipboard (Maximum size: 48.8 MB)