Commit Graph

18 Commits

Author SHA1 Message Date
Harald Welte 485138706d MGCP: Force-send a DLCX to all connections of before any new CRCX
There are some situations in which osmo-bsc releases a call without
sending a DLCX to the media gateway.  The 'laforge/fsm' has a more
proper solution to the problem, this is an interim hack which just
sends an unsolicited DLCX before the CRCX.

Change-Id: I1a78721d3d0a2f4a99cfddade2d06732f0388c30
2017-12-27 19:08:25 +01:00
Philipp Maier 57d4fe7157 mgcp: validate rtp connection data in MGW response (ip/port)
Currently the pasing results from the RTP ip/port are fed into
inet_addr without checking the results.

Check the return code of inet_addr to be sure that the IP-Address
got properly decoded.

Change-Id: I1d0aa7e9b8480e1bef57269e3904399cb99815bb
2017-12-20 11:57:19 +01:00
Philipp Maier 75f2c8d47f mgcp: cancel transactions on timeout
when a transaction to the MGW times out, then the context
information is freed. Unfortunately the client is not informed
about this and will try to execute the callback anyway.

explicitly cancel the transaction in order to prevent access
to already freed data structures.

Change-Id: I40794dff7d10e2b6a96863a2da7e9fbd5662a1bf
2017-12-20 11:48:18 +01:00
Harald Welte ea0c3203db osmo-bsc: Move user plane/voice related bits into sub-structure
This clarifies which members of the struct are for what.

Change-Id: I618822e6f2d48adce25f9df5c25acbce7c858412
2017-12-19 18:58:51 +01:00
Philipp Maier eb79614f4e mgcp: cosmetic fixups
- use unique enum/struct fsm struct names
- use macro to shift bits in FSM description
- use OSMO_STRINGIFY to generate the state names
- remove duplicate logging of states and events
- remove unnecessary space in log strings
- prefix hexadecimal enpoint ids with
- remove unnecessary log messages
- rename bsc_mgcp_cause_codes_str to bsc_mgcp_cause_codes_names

Change-Id: I663e03046cde3c786af72d15681bf7497330d7f9
2017-12-10 14:22:41 +00:00
Philipp Maier f4d0889abb cosmetic: use fsm pointer from parameter list
the parameter list of osmo-fsm callbacks contains a pointer
to the fsm instance. Use this pointer instead of reaching
out for mgcp_ctx->fsm.

Change-Id: I05ff62e7e2de64c2dbf5ea2736f5e58faf16df0b
2017-12-01 13:36:30 +01:00
Philipp Maier a89e163e4c cosmetic: correct sourcecode formatting
add missing line break

Change-Id: Ia117e4099046fefcf35ccb94400554062e667869
2017-12-01 13:36:30 +01:00
Philipp Maier e941f88ea1 cosmetic: add missing log prefix
the log messages have prefixes that mark important phases (CRCX/BTS,
etc...). Some lines lack the prefix.

Add missing prefixes.

Change-Id: Iea5ea9e54f4b5c998b1d5fe18a98a94abd7b728b
2017-12-01 13:36:30 +01:00
Philipp Maier 7eeb84271d cosmetic: do not cast void pointer
remove the casting of void *data, just assign directly

Change-Id: I2e37630e315b3602da2f14e2364bb76be9dd2894
2017-12-01 13:36:30 +01:00
Philipp Maier 06c3f8d3cb mgcp: do not fail silently on snprintf()
The snprintf() that is used to compose the fsm name on an assignment
request may cause a silent failure. The buffer is large enough to
take the string under all circumstances. If snprintf() fails, this
would mean we have some other serious problem.

use OSMO_ASSERT in case the snprintf() fails, so the failure
gets noticed.

Change-Id: I3c36df8cfd0880c524244048a993cd136be41f56
2017-12-01 13:36:30 +01:00
Philipp Maier 3ada5397d7 mgcp: add missing switch case
In the beginning of the CRCX phase for the network does not distinguish
between EV_MDCX_BTS_RES and EV_TEARDOWN, so a Teardown due to an error
could be misinterpreted as a successful MGW response.

Add missing case statement to distinguish CV_MDCX_BTS_RES from
EV_TEARDOWN.

Change-Id: I9bf49df167d94b33ad65d8b9382a01f160b5aec0
2017-12-01 13:36:30 +01:00
Philipp Maier fa85d18807 mgcp: use mgw assigned connection identifiers
osmo-mgw assigns connection identifiers which are returned with
the response to the CRCX.

store the assigned connection identifiers and use them to identify
the connections.

Depends: osmo-mgw Iab6a6038e7610c62f34e642cd49c93d11151252c

Closes: OS#2648
Change-Id: Ib379a6f40875bb8f2cf29038a5b5b7a40a21adab
2017-12-01 13:36:30 +01:00
Philipp Maier 2c3bf45449 mgcp: use hexadecimal digits in endpoint names
The current implementation of osmo-mgw parses the numerical
digit inside the endpoint name as hexadecimal number.

also use hexadecimal numbers in endpoint names.

Change-Id: I64a970d300b7290d50ec84b0640d5a321d903f5e
2017-12-01 13:36:30 +01:00
Philipp Maier 4aa2bac0bc mgcp: remove unused variable
The function handle_error asserts mgcp_ctx->conn to be non null,
but it does not access it otherwise.

remove unused variable conn

Change-Id: I09851c957395d1ddb2f9471b99ffc091bc250404
2017-11-12 14:22:46 +00:00
Philipp Maier 2a4c077fca mgcp: add missing out state
Even in the very early ST_CRCX_BTS phase, the error handler may
decide to go to ST_CALL in order to initate the termination of
a possibly half open connection.

Add ST_CALL to the out state list in ST_CRCX_BTS

Change-Id: Ic67aa7c67a4e98a38bff156be3ebf612012eb842
2017-11-12 14:22:46 +00:00
Philipp Maier 7cbea54544 cosmetic: replace term MGCP-GW with MGW
The term MGCP-GW is deprecated, use now MGW

Change-Id: Ibccda7e95c42267ce5f44e9fc4256a0083b6f68f
2017-11-12 14:22:46 +00:00
Philipp Maier 9b7678d65c cosmetic: reorder case list
the switch statement in fsm_send_assignment_complete() has the
default case at the beginning.

Move the default case to the end to match common coding style
rules

Change-Id: I360842fe899b95972c44da3cb74a3dc51b379fdc
2017-11-12 14:22:46 +00:00
Philipp Maier 39c609b7c9 mgcp: use osmo-mgw to switch RTP streams
osmo-bsc currently negotiates the RTP stream directly with the
BTS and reports back the RTP IP/Port on the BTS. This works fine
for a single BTS, but for Handover the port/ip pointing to the
MSC side must not change, so an entity in between the BTSs and
the MSC is required.

Integrate the mgcp-client and use osmo-mgw to switch the RTP
streams.

Depends: osmo-mgw Ib5fcc72775bf72b489ff79ade36fb345d8d20736
Depends: osmo-mgw I44b338b09de45e1675cedf9737fa72dde72e979a
Depends: osmo-mgw I29c5e2fb972896faeb771ba040f015592487fcbe

Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a
2017-11-07 20:57:51 +00:00