MNCC<->SIP bridge; attaches to OsmoMSC to interface with external SIP VoIP telephony https://osmocom.org/projects/osmo-sip-conector
Go to file
Holger Hans Peter Freyther 49880ddf74 mncc: Fix use after free on mncc socket disconnection
When the MNCC socket breaks down we would release all callds but when
there is no remote call the call would be released before

	if (call->remote)
		...

is being executed leading to a use after free. Fix it by copying the
legs first and assuming the call will be gone after that.

==3618== Invalid read of size 4
==3618==    at 0x804A18A: app_mncc_disconnected (app.c:49)
==3618==    by 0x804B52D: close_connection (mncc.c:255)
==3618==    by 0x804BCFA: mncc_rtp_send.constprop.13 (mncc.c:145)
==3618==    by 0x804CC86: check_setup (mncc.c:435)
==3618==    by 0x804CC86: mncc_data (mncc.c:795)
==3618==    by 0x42FCF94: osmo_fd_disp_fds (select.c:167)
==3618==    by 0x804D1F2: evpoll (evpoll.c:92)
==3618==    by 0x4205053: ??? (in /lib/i386-linux-gnu/libglib-2.0.so.0.4200.1)
==3618==    by 0x4205478: g_main_loop_run (in /lib/i386-linux-gnu/libglib-2.0.so.0.4200.1)
==3618==    by 0x8049AA6: main (main.c:171)
==3618==  Address 0x47f3258 is 64 bytes inside a block of size 76 free'd
==3618==    at 0x402A3A8: free (vg_replace_malloc.c:473)
==3618==    by 0x42E7FD1: ??? (in /usr/lib/i386-linux-gnu/libtalloc.so.2.1.5)
==3618==    by 0x804A3FD: call_leg_release (call.c:87)
==3618==    by 0x804A186: app_mncc_disconnected (app.c:48)
==3618==    by 0x804B52D: close_connection (mncc.c:255)
==3618==    by 0x804BCFA: mncc_rtp_send.constprop.13 (mncc.c:145)
==3618==    by 0x804CC86: check_setup (mncc.c:435)
==3618==    by 0x804CC86: mncc_data (mncc.c:795)
==3618==    by 0x42FCF94: osmo_fd_disp_fds (select.c:167)
==3618==    by 0x804D1F2: evpoll (evpoll.c:92)
==3618==    by 0x4205053: ??? (in /lib/i386-linux-gnu/libglib-2.0.so.0.4200.1)
==3618==    by 0x4205478: g_main_loop_run (in /lib/i386-linux-gnu/libglib-2.0.so.0.4200.1)
==3618==    by 0x8049AA6: main (main.c:171)
==3618==

Change-Id: I1889013ed315f896e4295358f6daf76ce523dc2a
2017-03-06 21:10:07 +00:00
contrib contrib: Add Dockerfile to build and configure a FreeSWITCH 2017-03-05 17:01:21 +01:00
debian debian: Add dh-autoreconf required by the debian packaging 2016-03-31 20:04:54 +02:00
doc/examples vty: Work on configuration of the MNCC to SIP gateway 2016-03-21 15:39:41 +01:00
src mncc: Fix use after free on mncc socket disconnection 2017-03-06 21:10:07 +00:00
tests distcheck/tests: Add the referenced osmoappdesc.py for testing 2016-04-24 22:28:35 +02:00
.gitignore Initial commit for a MNCC to SIP gateway (and maybe auth GW too) 2016-03-21 09:54:37 +01:00
COPYING Initial commit for a MNCC to SIP gateway (and maybe auth GW too) 2016-03-21 09:54:37 +01:00
Makefile.am distcheck/tests: Add the referenced osmoappdesc.py for testing 2016-04-24 22:28:35 +02:00
README.asciidoc Write down some of the limitations of the current setup 2016-03-26 16:31:00 +01:00
configure.ac configure: check for pkg-config presence 2016-10-01 01:07:11 +02:00
git-version-gen Initial commit for a MNCC to SIP gateway (and maybe auth GW too) 2016-03-21 09:54:37 +01:00
osmoappdesc.py distcheck/tests: Add the referenced osmoappdesc.py for testing 2016-04-24 22:28:35 +02:00

README.asciidoc

Osmo SIP Connector
==================

Simple utility to map MNCC to SIP and SIP to MNCC. The VTY interface
can be used to make configurations. The code doesn't have any RTP or
transcoding support.

Call identities can be either the MSISDN or the IMSI of the subscriber.


Requirements of Equipment
^^^^^^^^^^^^^^^^^^^^^^^^^

* DTMF need to be sent using SIP INFO messages. DTMF in RTP is not
supported.

* BTS+PBX and SIP connector+PBX  must be in the same network (UDP must be
able to flow directly between these elements)

* No handover support.

* IP based BTS (e.g. Sysmocom sysmoBTS but no Siemens BS11)

* No emergency calls

Limitations
^^^^^^^^^^^

* PT of RTP needs to match the one used by the BTS. E.g. AMR needs to use
the same PT as the BTS. This is because rtp_payload2 is not yet supported
by the osmo-bts software.

* AMR SDP file doesn't include the mode-set params and allowed codec modes.
This needs to be configured in some way.