summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg2010-12-23 15:32:10 +0100
committerAndreas Eversberg2011-02-20 11:33:20 +0100
commit740846314923a61f9608ac0b59830ed459537b90 (patch)
tree9c4d42519bf3d679b5ee735753e39e5864f6f86e
parentGSM: Define mncc_send() as it is no longer available from OpenBSC headers (diff)
downloadlcr-740846314923a61f9608ac0b59830ed459537b90.tar.gz
lcr-740846314923a61f9608ac0b59830ed459537b90.tar.xz
lcr-740846314923a61f9608ac0b59830ed459537b90.zip
GSM BS: Release all calls in case the connection to OpenBSC disappears
-rw-r--r--gsm_bs.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/gsm_bs.cpp b/gsm_bs.cpp
index 8bb647f..829d58a 100644
--- a/gsm_bs.cpp
+++ b/gsm_bs.cpp
@@ -862,6 +862,10 @@ int mncc_send(struct gsm_network *instance, int msg_type, void *data)
/* close MNCC socket */
static int mncc_fd_close(struct lcr_fd *lfd)
{
+ class Port *port;
+ class Pgsm_bs *pgsm_bs = NULL;
+ struct lcr_msg *message;
+
printf("mncc_sock: closing\n");
close(lfd->fd);
unregister_fd(lfd);
@@ -871,7 +875,20 @@ static int mncc_fd_close(struct lcr_fd *lfd)
while (mncc_q_dequeue())
;
- /* FIXME: free all the calls that were running through the MNCC interface */
+ /* free all the calls that were running through the MNCC interface */
+ port = port_first;
+ while(port) {
+ if ((port->p_type & PORT_CLASS_GSM_MASK) == PORT_CLASS_GSM_BS) {
+ pgsm_bs = (class Pgsm_bs *)port;
+ message = message_create(pgsm_bs->p_serial, ACTIVE_EPOINT(pgsm_bs->p_epointlist), PORT_TO_EPOINT, MESSAGE_RELEASE);
+ message->param.disconnectinfo.cause = 27; // temp. unavail.
+ message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
+ message_put(message);
+ pgsm_bs->new_state(PORT_STATE_RELEASE);
+ trigger_work(&pgsm_bs->p_m_g_delete);
+ }
+ port = port->next;
+ }
/* FIXME: start a re-connect timer */