Commit Graph

2674 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther 45fd07dc33 nat: Attempt to assign the BSC Timeslot based on a free list
Do attempt to not reassign an endpoint immediately but go
to the next free one.
2010-08-29 16:35:26 +08:00
Holger Hans Peter Freyther 39cd32e650 nat: Remove the CRCX value from the nat
Assume that if the MSC has assigned a timeslot/multiplex it will
also be used for the MGCP. So we just assume that it was allocated
on the BSC as well... in the worse case we will send a DLCX downstream
but it should be fine.
2010-08-29 16:35:25 +08:00
Holger Hans Peter Freyther c021fbe603 nat: Reindent the code, no functional change 2010-08-29 16:35:25 +08:00
Holger Hans Peter Freyther f4b3439206 nat: Make the code work in terms of endpoints instead of timeslot/multiplex
We are going to have more than one trunk, so all code hardcoding the
multiplex to zero must go. Avoid this kind of problem by saving the
MGCP endpoint number and comparing that.
2010-08-29 16:35:24 +08:00
Holger Hans Peter Freyther 591003328d nat: Use the bsc_timeslot when talking to the BSC downstream 2010-08-29 16:35:24 +08:00
Holger Hans Peter Freyther 82049d8141 mgcp: Add method to go back from endpoint to multiplex/timeslot 2010-08-29 16:35:23 +08:00
Holger Hans Peter Freyther cb8c35cd51 mgcp: Speculative mgcp fix...
We really have 32 channels per multiplex... so use the right
number... or at least it seems we do have 32.
2010-08-29 16:35:22 +08:00
Harald Welte 9ae28a128a [gprs] Add option parsing to SGSN 2010-08-27 09:26:44 +02:00
Harald Welte 0e6be0e8f8 debian: add init script, /etc/default file and example config files 2010-08-27 09:09:40 +02:00
Harald Welte 2c67f47dba debian: make more dependencies explicit in 'control' file 2010-08-27 09:09:40 +02:00
Holger Hans Peter Freyther 7a2c86b67d vty: Provide a is_config_node for the VTY and use it for the bsc
Right now only bsc_hack and osmo_bsc need to have a custom
config handling as they use the subscr/oml nodes.
2010-08-26 16:55:37 +08:00
Harald Welte 2c869efcd3 Introduce '-D' commandline option to daemonize processes
This uses the osmo_daemonize() function of libosmocore >= 0.1.18,
and is now implemented for bac_nat, osmo-bsc, bsc_hack, osmo-gbproxy
and bsc_mgcp.  This means only osmo-sgsn is missing, which currently
has no option parsing at all.
2010-08-25 19:43:54 +02:00
Harald Welte 305e2906aa debian: don't buld arch-independent packages with executables in them 2010-08-25 13:57:22 +02:00
Harald Welte ba43969832 debian: don't use override_dh_* for lenny compatibility 2010-08-25 13:54:58 +02:00
Harald Welte 5c55c4901d debian: add build dependency to pkg-config 2010-08-25 12:59:29 +02:00
Harald Welte 11e79bdbbb debian: add runtime dependency to libdbd-sqlite3 2010-08-25 12:58:32 +02:00
Harald Welte 3edb60de7e debian: add build dependency to libdbi0-dev 2010-08-25 12:58:32 +02:00
Holger Hans Peter Freyther 4dc025b4a8 bsc_init: Compare it with the right enum type
In both cases the int value was zero, so it actually worked
2010-08-25 12:33:57 +08:00
Harald Welte 640d72ab3b Add 'debian' directory containing debian packaging information 2010-08-24 15:33:04 +02:00
Harald Welte 2a90a25c93 Add gprs_sndcp.h to noinst_HEADERS 2010-08-24 13:59:08 +02:00
Holger Hans Peter Freyther e0009f10ca gsm48: Add method to send a separate facility message...
Send a facility messages with notifySS/CNAP as payload
to the phone... the function is not called from anywhere
in the tree yet but I use it locally.
2010-08-12 01:44:57 +08:00
Harald Welte c1fa794ed5 [GPRS NS] Fix memory leak in gprs_ns_sendmsg() error path
When gprs_ns_sendmsg() succeeds in sending the message, we free()d the
msgb after transmitting it on the socket.  However, if the NS-VC is
blocked or some other error condition exists, we returned an error
code but didn't free the msgb.

This resulted in an error leak which is now being addressed.
2010-08-09 21:15:40 +08:00
Holger Hans Peter Freyther 5508fe3320 mgcp: Add a vty command to free a given endpoint. 2010-08-08 16:39:57 +08:00
Holger Hans Peter Freyther 9e9392d5b3 mgcp: Use transient errors in more cases... 2010-08-08 16:24:48 +08:00
Holger Hans Peter Freyther e378cb1341 mgcp: Reduce the log level to debug for these calls. 2010-08-06 20:22:23 +08:00
Holger Hans Peter Freyther da340638fd nat: Do not report paging to every BTS... 2010-08-06 20:15:40 +08:00
Holger Hans Peter Freyther 7d47601a35 nat: In case the downstream fails on a CRCX, ask it to do a DLCX
If the CRCX is failing, we will send a DLCX downstream and the next
time the callagent tries to do a CRCX we will be more lucky. This is
for the case where we have an endp allocated.
2010-08-06 19:16:34 +08:00
Holger Hans Peter Freyther 39a97e24fb mgcp: Remember if the endpoint was allocated...
Do not use the CI_UNUSED to decide if an endpoint is allocated
but introduce a new flag. This way only the CRCX and free_endp
play with the allocated field.
2010-08-06 18:03:11 +08:00
Holger Hans Peter Freyther 869e38eced mgcp: Add a callback to inform the client that an endpoint got reallocated 2010-08-06 17:54:27 +08:00
Holger Hans Peter Freyther c2ff55475e nat: Use the state information for the callback. 2010-08-06 09:07:20 +08:00
Holger Hans Peter Freyther 5b2726e6b5 nat: Keep the state (CRCX,MDCX,DLCX) of the operation..
This will allow to have additional debug information and to
use the state inside the forwarding code.
2010-08-06 09:07:07 +08:00
Holger Hans Peter Freyther b84b5f61ac nat: Free the endpoint when we get an empty CI.
In case the BSC is sending us an empty/unused CI we have
a bug, but for now let us free the endpoint and figure out
which response we are getting.
2010-08-06 08:34:46 +08:00
Holger Hans Peter Freyther 4634013cde mgcp: Make the CI uint32_t all the way to avoid mismatch 2010-08-06 08:29:37 +08:00
Holger Hans Peter Freyther 9c31cfc3a2 nat: Provide information of when a msg does not contain a CI
When we fail to find a CI in a message that should contain it
then print the message so we can analyze the issue and improve
the code later on.
2010-08-06 08:19:05 +08:00
Holger Hans Peter Freyther 52ccf6a480 mgcp: Fix discovering the RTCP port with the more strict check.
If we have found the BTS and we receive data on the RTCP port
from the IP of the BTS we will set our RTCP port and forward it
to the network and hope it will be useful.
2010-08-06 07:49:57 +08:00
Holger Hans Peter Freyther 0d44eb6a24 mgcp: Determine the proto properly... 2010-08-06 07:49:57 +08:00
Holger Hans Peter Freyther e2170a9f03 bsc_msc: Remove the except code as it is wrong...
Remove wrong code that is luckily not called. We would end up
in a reconnect and attempt to bsc_fd_register the same socket
again. I am removing this part of the code as it is not used
and it would need to know if the fd has ever been registered
or not...
2010-08-06 07:49:57 +08:00
Holger Hans Peter Freyther 7fe2a3d293 mgcp: Add instrumentation code to find a possible port leak/bsc-fd corruption 2010-08-06 07:18:22 +08:00
Holger Hans Peter Freyther 414bf401c7 mgcp: Move the mgcp_free_endp into the right path for the CRCX failure 2010-08-06 07:05:13 +08:00
Holger Hans Peter Freyther 6f36e92cab mgcp: Fix a filedescriptor leak in case the bind is failing. 2010-08-06 03:00:17 +08:00
Holger Hans Peter Freyther 0e01d09500 mgcp: Enable the tap after configuring it... 2010-08-06 02:05:15 +08:00
Holger Hans Peter Freyther 260d6ed02c mgcp: Add a call tap feature to forward audio to another forward port
For debugging it is useful to forward (tee) UDP packets to another
system and use gstreamer to inspect the rtp stream. This is untested
code and might contain bugs.... and of course only tap your own calls.
2010-08-06 01:12:21 +08:00
Holger Hans Peter Freyther 6357a8e311 mgcp: Patch RTP packets again if that is allowed. 2010-08-05 20:08:22 +08:00
Holger Hans Peter Freyther a39ddd5654 mgcp: Get the for network/for bts flag right. 2010-08-05 19:35:44 +08:00
Holger Hans Peter Freyther ea97fbf1a1 mgcp: Be more strict on the source addr/source port of the bts
Once we have discovered the bts we will not accept data from
anything else. The call will drop if the BTS is changing the
ip address of the nat anyway.
2010-08-05 19:35:44 +08:00
Holger Hans Peter Freyther b97c50db0a mgcp: Only discover the bts once, the extra check got lost 2010-08-05 19:35:44 +08:00
Holger Hans Peter Freyther d5e6c2374b nat: Use the mgcp_config_alloc to have defaults initialized
Initialize the net_base properly and benefit from future
config changes but also reset certain defauls that we do
not want at the nat.
2010-08-05 19:17:25 +08:00
Holger Hans Peter Freyther f138f917ec mgcp: Allow to dynamically allocate ports from a range..
Allow to switch to a dynamic port allocator and not reuse
the ports for a long time... This should help with a crazy
network sending two streams at the same time.
2010-08-05 08:08:17 +08:00
Holger Hans Peter Freyther 1be9f2fddc mgcp: Allow to have a different port allocation mode 2010-08-05 07:20:09 +08:00
Holger Hans Peter Freyther 15e7389cf0 mgcp: Prepare to have different port allocation strategies. 2010-08-05 07:10:56 +08:00