Commit Graph

3097 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther 9f239a2a0f mgcp: Parse a Digital Trunk endpoint name. 2011-01-06 19:35:10 +01:00
Holger Hans Peter Freyther 6adac17a10 mgcp: Include a MGCP Response String in the response
Switch to a \r\n at the end of the query. Both \n and \r\n
are valid according to the spec but this makes us match
responses of other equipment.
2011-01-06 19:35:10 +01:00
Holger Hans Peter Freyther 49b3ed2226 subscr: Stop stopping paging requests behind the back of subscr
The transaction layer was stopping paging requests that might or
might not have been owned by the transaction. This makes the subscr
code get stuck delivering requests. This code is mostly a band aid
and just makes sure that we will kick the queue if it is needed.
2011-01-06 14:52:53 +01:00
Holger Hans Peter Freyther 182c81f04e subscr: Remember if we need to call subscr_put_channel at the end.
Remember if this channel got opened due a paging response and in
that case when we close it down we will call subscr_put_channel
that will try to page the subscriber again. This highlights the
lack of a good subscriber management in the MSC code.
2011-01-06 14:52:53 +01:00
Holger Hans Peter Freyther 90c0aff174 paging: Handle the possible OOM message as well. 2011-01-06 14:52:53 +01:00
Holger Hans Peter Freyther 52ffb922c4 sms: Improve the logging of the paging callback. 2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther 451eb29e37 subscr: Add a vty option to kick the queue. 2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther 763b42a92a subscr: Dump the pending requests to help with debugging state. 2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther 68c3bf6de8 subscr: Store the state of a subscr request for inspection. 2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther c02b12086c subscr: Fix subscr leaks in the KI code. 2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther fc857414ae subscr: Make it possible to clear pending requests for a subscriber 2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther ebdd3cbd89 subscr: Show the number of pending requests on this subscriber. 2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther ffccb77df0 subscr: Stop all paging requests if one is failing.
If one paging request is timing out the others will timeout soon
as well. With the current code the next timeout would expire the
next request in the queue. We will now stop all paging requests
and then issue a next paging request. So for both paging success
and failure we will now stop all the other requests.

This is mostly a workaround, one should count on how many
BTSes we are paging and wait for all failures before we remove
the item from the queue.
2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther f72b3d51fc subscr: Kick the queue in case of a paging timeout
Kick the queue in case the paging was timing out. No one is going
to call subscr_put_channel for us so we will do it on the subscriber.

There is also another problem with multiple BTS in the LAC and paging
timeout. We will need to remember how many BTSes we have paged.
2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther c29043ea24 msc: Attempt to fix a bug with 'stuck' SMS due RF failure on auth
If we have a RF failure between the paging response and the auth
success we will not inform the subscriber layer of the failed paging
and instead just 'drop' the SMS. In case we have not completed the
auth and close the channel we will now send an auth failure.
2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther 701076e9d3 sms: Add new SMS requests to the end of the list. 2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther 96e9f08101 sms: Argh... reset the pending after we have cleared the queue. 2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther 79eff7eeff sms: Fix crash by saving the gsm_network
The conn might be released during the loop and then conn->bts
is a null pointer and we end up crashing. Store the gsm_network
in a local variable and access this one.
2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther 583e9aef33 sms: Show the amount of failures and the SMS we want to send.
Improve the debugging possibilities and print the failed attempts
and the sms that was attempted to be delivered. this should help
with debugging the code.
2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther dc53af6721 sms: Fix the log message and end with a new newline. 2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther 725966d9b4 subscr: Make the subscr_put_channel work with the subscr
The active channel might or might not be gone when the transaction
has been released. Instead of passing an invalid subscriber conn
we will pass the subscr that is ref-counted and guranteed to be
valid at this point. subscr_put_channel could search the connections
for an active connection if that is ever needed.
2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther 8e3eb584a8 mncc: Do not print the BTS at all as it might not be present
In contrast to the previous believe we may not have a conn here
as we are still paging for the sub. Instead of printing the BTS
print the lac where we think the subscriber is located.
2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther b56a6bbc55 mncc: bts can be NULL, attempt to find the bts from the transaction
Follow trans->conn->lchan to the BTS instead of using the BTS that
is guranteed to be NULL in the codepath we have entered here. The
trans->conn should still be there, and the lchan should be valid as
well as we have reordered the clear statements.
2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther 50c5ff7b94 mncc: Do not use bts->nr as it might be NULL. 2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther ebd50a6fd2 bsc: Clear the hand-over in case the new_lchan is failing
When the new_lchan for handover is failing we should stop the
handover operation. This is fixing a crash that we get a timeout
on the lchan and have no conn set to it. Introduce a flag to
the bsc_clear_handover to not free the lchan. In case the ho_lchan
is failing we do not want to call lchan_release as it would
reset the state.
2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther f1ba09b2e6 misc: Remove unused variable from the function. 2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther 1cc7184bc9 misc: Fix compiler warning about incompatible pointers 2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther 02d45c00f5 misc: Fix warning about the cast. 2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther f4152d1025 misc: Remove unused variable from the db. 2011-01-06 14:52:50 +01:00
Holger Hans Peter Freyther 54146271b6 misc: Forward declare the struct gsm_bts_trx_ts to avoid warning. 2011-01-06 14:52:50 +01:00
Holger Hans Peter Freyther 913bc032b9 mncc: Move the cc_tx_to_mncc code into the libbsc.a
The trau_mux likes to call cc_tx_to_mncc for each received
frame from the E1 link. Using a signal for each audio frame
is messy as well. The best thing I could think of is to put
this into the BSC to deref the pointer. The other option would
be to include the gsm_data.h in the mncc.h header and have
the method as inline.
2011-01-06 14:52:50 +01:00
Holger Hans Peter Freyther 59234a3eb2 mncc: Switch the header file from u_int to uint
Include stdint.h to have the C99 data types.
2011-01-06 14:52:50 +01:00
Holger Hans Peter Freyther 6c4d2443b4 rtp: Move the RTP Proxy code out of RSL into the BSC/MSC domain
Instead of creating the sockets in the RSL code we will do this
in the CRCX_ACK, MDCX_ACK, DLCX_IND signal handler of gsm_04_08.
Introduce a handover signal so we can repatch the RTP sockets in
the gsm_04_08 as well.
2011-01-06 14:31:16 +01:00
Harald Welte 04d362f79d fix spelling mistake in log message 2011-01-01 17:28:55 +01:00
Harald Welte 6349b7f15e re-order the sequence of events in bsc_api:handle_release()
This should make sure conn->lchan is valid throughout the release
cause, especially make trau_mux_unmap() happy that conn->lchan
still exists.
2011-01-01 17:28:49 +01:00
Harald Welte 624e89d3f7 [db] Fix double-quoting in libdbi backend 2011-01-01 17:28:43 +01:00
Harald Welte b854b29e32 MNCC: avoid segfault in DEBUGP due to non-existing conn->lchan 2011-01-01 17:28:38 +01:00
Harald Welte f0901f0067 [SGSN] Fix processing of RA Update Request regarding TLLI
In case we get a RA UPD REQ on a new cell (both served by the same
SGSN), the LLC stack should not allocate a ne LLE/LLME, as the latter
would reset the V(u)sent / V(u)recv to zero and make the MS discard
our responses.

Instead, whenever the LLC stack sees a foreign TLLI, it should always
convert it to the local TLLI before doing any lookup for a LLE/LLME.
2011-01-01 17:28:29 +01:00
Harald Welte 91c59c8cb5 MNCC: fix copy+paste mistake in log message and change it to DEBUG 2011-01-01 17:23:43 +01:00
Harald Welte eb76c7a93f mncc_sock: Fix potential segfault in case MNCC app dies
We create a loop by not setting trans->callref = 0 before calling
trans_free(), as the latter would again send a MNCC_REL_IND up
the stack.

Also: Fix memory leak in case we try to read from mncc_sock
but socket is just gone.
2011-01-01 17:23:43 +01:00
Harald Welte 0d6f930785 mncc_sock: Use proper logging directives and levels, don't printf. 2011-01-01 17:23:43 +01:00
Harald Welte 02d9966053 MNCC: Introduce bsc_hack argument '-m' for enabling MNCC socket 2011-01-01 17:23:42 +01:00
Harald Welte ea057d9350 mncc_sock: Add new 'mncc handler' function
This adds mncc_sock_from_cc() as a handler function for CC messages
to be passed to the MNCC interface.  If there is no MNCC socket
registered, we immediately release any CC related messages.

Together with flushing all established CC transaction at MNCC socket
close time, this ensures that all resources are released and no
new resources can be established until the MNCC applicaiton has
re-attached.
2011-01-01 17:23:42 +01:00
Harald Welte 29b64e9708 MNCC: pass the actual 'struct msgb' down the mncc_recv() callback
this is required as we no longer have a dequeue-handler that can take
care of free()ing the message after passing it to the MNCC handler.
2011-01-01 17:23:42 +01:00
Harald Welte 04dc88fb9d GSM 04.08 / MNCC interface: verbuse logging of incoming MNCC primitives 2011-01-01 17:23:42 +01:00
Harald Welte 371efe5955 mncc_sock: Clear all calls if MNCC application (LCR) disconnects 2011-01-01 17:23:42 +01:00
Harald Welte 49a2ddeec0 mncc_sock: Add an assert() in case our queue peek trick goes wrong 2011-01-01 17:23:42 +01:00
Harald Welte e8e432dd59 MNCC: remove 'upqueue'
The MNCC messages now again get directly handled by the net->mncc_recv()
callback.  If the callee wants to put them in a queue, it' his business
to do that.
2011-01-01 17:23:42 +01:00
Harald Welte fea236e27c MNCC: move cc_tx_to_mncc() from gsm_data.h into mncc.c 2011-01-01 17:23:41 +01:00
Harald Welte 31bbbf4e52 MNCC socket: Export MNCC interface via unix domain socket
Using this code we will soon be able to use LCR or other MNCC
applications via a unix domain socket.

The code is not actually used yet after this patch.
2011-01-01 17:23:41 +01:00