Commit Graph

3 Commits

Author SHA1 Message Date
Oliver Smith cce4b03bd3 bssap_conn: fix missing length check
Check length of msg_new before trying to encode a copy of the IE into
it. The code path for IE_AOIP_TRASP_ADDR is different since it gets
replaced. With the libosmocore patch in Depends below the
gsm0808_enc_aoip_trasp_addr function checks the length.

Depends: libosmocore I632986b99d841abff0f14c6da65f030175f5c4a1
Fixes: Coverity CID#273004
Change-Id: I1fc4c81e139bab3d7d977ef9467f62d8088884db
2022-08-05 14:08:47 +02:00
Oliver Smith 9b3de0183b Add subscr_conn_fsm
Insert the BSCNAT's MGW into phone calls by replacing the AoIP
transport layer address IE inside BSSMAP Assignment Request and
Assignment Confirm. Accomplish this with a new subscr_conn_fsm that
parses and stores the original ass_req / ass_conf messages, communicates
with the BSCNAT MGW, and then creates new ass_req / ass_conf messages
based on the original ones but with new RTP information.

With this patch it is possible to do a successful voice call with the
following network:

  MS1 --- BTS1 --- BSC1 --.
           |        |     BSCNAT ----------- MSC
           |        |     |   |              |
           '-- MGW-BSC1 --|-- MGW-BSCNAT --- MGW-MSC
                          |   |
  MS2 --- BTS2 --- BSC2 --'   |
           |        |         |
           '-- MGW-BSC2 ------'

Related: SYS#5560
Related: https://osmocom.org/projects/osmo-bscnat/wiki/Ladder_diagrams_for_key_procedures
Change-Id: I7e491aada6f5db0eb35ef2039869c6ba07f9ca3b
2022-06-09 10:13:45 +02:00
Oliver Smith ea079426ef Parse BSSMAP in conn-oriented data
Add functions to parse the BSSMAP part of BSSAP messages, and in theory
do other things than just forwarding the messages depending on the
BSSMAP message type. This will be used in follow-up patches to change
the AoIP transport layer address in Assignment Request and related
messages.

Related: SYS#5560
Change-Id: I3e2599a9a07925afdbe69f7b8dbcec227681dfa2
2022-04-11 11:07:01 +02:00