osmo-msc/openbsc/include/openbsc
Pablo Neira Ayuso b769f3ce0b osmux: add osmux circuit ID management and resolve NAT problems
This patch includes several osmux fixes that are interdependent:

1) This adds Osmux circuit ID, this is allocated from the bsc-nat. This
   announces the circuit ID in the CRCX MGCP message. This aims to resolve
   the lack of uniqueness due to the use of endp->ci, which is local to
   the bsc. This ID is notified via X-Osmux: NUM where NUM is the osmux
   circuit ID.

2) The dummy load routines are now used to setup osmux both in bsc and
   bsc-nat to resolve source port NAT issues as suggested by Holger. The
   source port that is used from the bsc is not known until the first
   voice message is sent to the bsc-nat, therefore enabling osmux from
   the MGCP plane breaks when a different source port is used.

3) Add refcnt to struct osmux_handle, several endpoints can be using the
   same input RTP osmux handle to perform the batching. Remove it from the
   osmux handle list once nobody is using it anymore to clean it up.

4) Add a simple Osmux state-machine with three states. The initial state
   is disabled, then if the bsc-nat requests Osmux, both sides enters
   activating. The final enabled state is reached once the bsc-nat sees
   the dummy load message that tells what source port is used by the bsc.

5) The osmux input handle (which transforms RTP messages to one Osmux batch)
   is now permanently attached to the endpoint when Osmux is set up from the
   dummy load path, so we skip a lookup for each message. This simplifies
   osmux_xfrm_to_osmux().

After this patch, the workflow to setup Osmux is the following:

                    bsc                   bsc-nat
                     |                       |
                     |<------ CRCX ----------|
                     |      X-Osmux: 3       | (where 3 is the Osmux circuit ID
                     |                       |  that the bsc-nat has allocated)
                     |------- resp --------->|
                     |      X-Osmux: 3       | (the bsc confirm that it can
                     |                       |  use Osmux).
                     .                       .
                     |                       |
         setup osmux |----- dummy load ----->| setup osmux
                     |      Osmux CID: 3     |

In two steps:

1st) Allocate the Osmux Circuit ID (CID): The bsc-nat allocates an unique
     Osmux CID that is notified to the bsc through the 'X-Osmux:' extension.
     The bsc-nat annotates this circuit ID in the endpoint object. The bsc
     replies back with the 'X-Osmux:' to confirm that it agrees to use Osmux.
     If the bsc doesn't want to use Osmux, it doesn't include the extension
     so the bsc-nat knows that it has to use to RTP.

2nd) The dummy load is used to convey the Osmux CID. This needs to happen
     at this stage since the bsc-nat needs to know what source port the bsc
     uses to get this working since the bsc may use a different source
     port due to NAT. Unfortunately, this can't be done from the MGCP signal
     plane since the real source port is not known that the bsc uses is not
     known.

This patch also reverts the MDCX handling until it is clear that we need
this special handling for this case.
2014-08-28 12:08:29 +02:00
..
Makefile.am gprs: Attempt to fix distcheck by adding the header file 2014-08-25 16:15:04 +02:00
abis_nm.h ctrl/abis: When the max_power_reduction changes, send it to the BTS 2014-03-26 18:08:22 +01:00
abis_om2000.h OM2000: First attempt in automatically configuring most MOs 2011-03-06 22:12:24 +01:00
abis_rsl.h dyn PDCH: Cleanup of rsl_chan_activate_lchan() and users 2014-08-04 08:59:16 +02:00
arfcn_range_encode.h si: Fix range1024 encoding 2014-01-16 12:04:30 +01:00
auth.h Authentication: use ENUM instead of magic numbers 2010-12-23 18:09:51 +01:00
bsc_api.h bsc: Add a ctrl command to send a ussdNotify for a call 2014-08-08 21:17:36 +02:00
bsc_msc.h bsc: Fix compilation on FreeBSD 2014-05-09 04:38:58 +02:00
bsc_nat.h mgcp: add voice muxer support 2014-05-22 14:39:16 +02:00
bsc_nat_callstats.h nat: Move the callstats to a new header file due sccp usage 2013-04-22 09:07:39 +02:00
bsc_nat_sccp.h nat: Remember the original dest local reference in the parsed struct 2013-09-03 15:04:43 +02:00
bsc_rll.h misc: Move from u_int to uint types of stdint.h 2011-04-18 17:31:39 +02:00
bss.h hsl: Remove the support for the HSL bts from OpenBSC 2013-07-03 16:19:41 +02:00
chan_alloc.h rsl: Rename the reason to release_mode and use the enum value 2012-12-23 20:18:18 +01:00
crc24.h crc24: Include stdint.h as a possible compile fix 2011-04-19 20:06:26 +02:00
ctrl.h move libctrl from openbsc to libosmoctrl (libosmocore.git) 2014-08-21 15:34:28 +02:00
db.h nitb/ctrl: Implement a command to list all active subscribers 2014-03-23 16:22:55 +01:00
debug.h sms: Use the DLSMS instead of the DSMS category throughout our code 2012-11-21 21:33:03 +01:00
e1_config.h fix some "implicit declaration" warnings in libbsc 2011-09-06 09:32:14 +02:00
gb_proxy.h gbproxy: Move peer definitions to gb_proxy_peer.c 2014-08-24 16:16:40 +02:00
gprs_gb_parse.h gbproxy: Refactor gb_proxy.c into several files 2014-08-24 16:16:40 +02:00
gprs_gmm.h src: use new library libosmogsm and new path to headers in libosmocore 2011-03-23 18:17:56 +01:00
gprs_llc.h gprs: Separate LLC parsing from LLC state handling 2014-06-04 16:29:30 +02:00
gprs_sgsn.h gprs: Fix compiler warnings in sgsn_main.c 2014-04-04 12:51:28 +02:00
gprs_utils.h gbproxy: Refactor gb_proxy.c into several files 2014-08-24 16:16:40 +02:00
gsm_04_08.h bsc: Move gsm48_tx_mm_serv_ack/rej to gsm_04_08_utils.c 2013-11-01 17:12:37 +01:00
gsm_04_08_gprs.h gprs: This comes from libosmocore, remove it here 2011-10-14 23:28:07 +02:00
gsm_04_11.h sms: Increment the RP Message Reference for each transaction 2014-02-20 11:35:56 +01:00
gsm_04_80.h src: use new library libosmogsm and new path to headers in libosmocore 2011-03-23 18:17:56 +01:00
gsm_data.h move gsm_bts_num() to gsm_data_shared.[ch] 2014-08-24 12:47:12 +02:00
gsm_data_shared.h port over to libosmocore include/osmocom/gsm/meas_rep.h 2014-08-25 09:20:33 +02:00
gsm_subscriber.h db: Remove the struct gsm_network from the database layer 2013-10-13 13:44:54 +02:00
handover.h handover: Fix the handover signalling for IP based BTSes 2012-12-26 10:32:02 +01:00
handover_decision.h fix some "implicit declaration" warnings in osmo-nitb 2011-09-06 09:32:13 +02:00
ipaccess.h move libctrl from openbsc to libosmoctrl (libosmocore.git) 2014-08-21 15:34:28 +02:00
meas_rep.h port over to libosmocore include/osmocom/gsm/meas_rep.h 2014-08-25 09:20:33 +02:00
mgcp.h mgcp: Change API to remove memory management from the name 2014-07-22 15:00:52 +02:00
mgcp_internal.h osmux: add osmux circuit ID management and resolve NAT problems 2014-08-28 12:08:29 +02:00
mgcp_transcode.h mgcp: Make the internal state of the transcoder accessible 2014-07-22 13:12:19 +02:00
misdn.h src: port openBSC over libosmo-abis 2011-08-19 22:38:35 +02:00
mncc.h mncc: Use helper function to check if an MNCC frame is data (speech/traffic) 2014-03-20 22:36:16 +01:00
mncc_int.h Add VTY command to specify default speech codec 2011-09-03 18:23:20 +02:00
nat_rewrite_trie.h nat: Allow to use the prefix lookup to rewrite numbers 2013-07-31 16:36:40 +02:00
network_listen.h [ipaccess-config] fix bugs in generating the PHYSICAL CONFIG attribute 2010-07-22 21:54:19 +02:00
openbscdefines.h License change: We are now AGPLv3+ instead of GPLv2+ 2011-01-01 15:39:34 +01:00
osmo_bsc.h bsc: Add a ctrl command to send a ussdNotify for a call 2014-08-08 21:17:36 +02:00
osmo_bsc_grace.h bsc: Allow to page a BTS that is excluded from the RF lock 2013-01-28 15:41:27 +01:00
osmo_bsc_rf.h ctrl: Remember last 'rf_locked' control command 2013-09-11 20:27:08 +02:00
osmo_msc.h bsc_msc: Remove use_count from the subscriber connection 2010-06-28 18:01:47 +08:00
osmo_msc_data.h ussd: Send USSD on call setup on MSC errors 2013-09-11 20:18:42 +02:00
osmux.h osmux: add osmux circuit ID management and resolve NAT problems 2014-08-28 12:08:29 +02:00
paging.h bsc: Allow to page a BTS that is excluded from the RF lock 2013-01-28 15:41:27 +01:00
rest_octets.h si: Another round of PCS related fixes 2013-03-10 17:39:50 +01:00
rrlp.h fix some "implicit declaration" warnings in osmo-nitb 2011-09-06 09:32:13 +02:00
rs232.h move openbsc into its own subdirectory 2009-06-10 05:40:52 +08:00
rtp.h rtp: Share the rtp header between the proxy and the mgcp code 2014-07-07 19:24:21 +02:00
rtp_proxy.h Use 'defines' for length and duration of RTP payload 2014-01-26 08:49:35 +01:00
sgsn.h sgsn: Add "auth-policy" VTY command to enable/disable ACL 2013-07-21 15:44:28 +08:00
signal.h bsc: Introduce an authenticated signal for the MSC connection 2013-01-15 11:27:28 +01:00
silent_call.h silent_call: Use the gsm_subscriber_connection instead of lchan->conn 2010-06-21 16:40:09 +08:00
sms_queue.h sms: Allow setting amount of failures through the vty. 2010-12-26 09:40:30 +01:00
socket.h src: use namespace prefix osmo_fd* and osmo_select* 2011-05-06 12:11:23 +02:00
system_information.h Move system information related defines and code to libosmocore 2011-05-24 15:02:20 +02:00
token_auth.h fix some "implicit declaration" warnings in osmo-nitb 2011-09-06 09:32:13 +02:00
transaction.h sms: Kill the linkid as we are using SAPI=3 all the time 2012-12-01 11:49:33 +01:00
trau_mux.h trau: Fix compiler warning about decoded_trau_frame 2014-02-20 11:19:32 +01:00
trau_upqueue.h fix some "implicit declaration" warnings in libtrau 2011-09-06 09:32:14 +02:00
ussd.h src: use new library libosmogsm and new path to headers in libosmocore 2011-03-23 18:17:56 +01:00
vty.h vty: Use vty_install_default() instead of bsc_install_default() 2013-10-30 15:19:00 +01:00