aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc/osmo_bsc_sccp.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-09-02 17:28:40 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-09-05 12:25:32 +0200
commit56cb7299071c8472a240a293036be3074f3eb4e0 (patch)
tree062373e9fa982a75bd088584360e65806baac230 /openbsc/src/osmo-bsc/osmo_bsc_sccp.c
parent0169971a59e9822c094e82f3e4a28f2763ea0f34 (diff)
bsc: Add a "IPA PING" to the SCCP CR messages
We want to reduce the background traffic and might set the ping interval to be in the range of minutes. But this means that if the TCP connection is frozen several "SCCP CR CM Service Requests" will be stuck in the send queue without ever being answered. I could have used the logic of not receiving the "SCCP CC" to close the connection but instead I am introducing an overload to schedule the ping as part of the normal SCCP connection establishment. The VTY write case has been manually verified, I have also looked at a single trace to see that the SCCP CR and the IPA PING is transfered in the same ethernet frame.
Diffstat (limited to 'openbsc/src/osmo-bsc/osmo_bsc_sccp.c')
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_sccp.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c
index 3dd0a5236..33c737f52 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c
@@ -1,7 +1,7 @@
/* Interaction with the SCCP subsystem */
/*
- * (C) 2009-2011 by Holger Hans Peter Freyther <zecke@selfish.org>
- * (C) 2009-2011 by On-Waves
+ * (C) 2009-2014 by Holger Hans Peter Freyther <zecke@selfish.org>
+ * (C) 2009-2014 by On-Waves
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
@@ -146,6 +146,11 @@ static void msc_sccp_write_ipa(struct sccp_connection *conn, struct msgb *msg,
if (conn) {
struct osmo_bsc_sccp_con *bsc_con = conn->data_ctx;
msc_con = bsc_con->msc->msc_con;
+ if (bsc_con->send_ping) {
+ bsc_con->send_ping = 0;
+ msc_queue_write_with_ping(msc_con, msg, IPAC_PROTO_SCCP);
+ return;
+ }
} else {
msc_con = ctx;
}
@@ -189,7 +194,7 @@ int bsc_queue_for_msc(struct osmo_bsc_sccp_con *conn, struct msgb *msg)
}
enum bsc_con bsc_create_new_connection(struct gsm_subscriber_connection *conn,
- struct osmo_msc_data *msc)
+ struct osmo_msc_data *msc, int send_ping)
{
struct osmo_bsc_sccp_con *bsc_con;
struct sccp_connection *sccp;
@@ -224,6 +229,8 @@ enum bsc_con bsc_create_new_connection(struct gsm_subscriber_connection *conn,
sccp->data_cb = msc_outgoing_sccp_data;
sccp->data_ctx = bsc_con;
+ bsc_con->send_ping = send_ping;
+
/* prepare the timers */
bsc_con->sccp_it_timeout.cb = sccp_it_timeout;
bsc_con->sccp_it_timeout.data = bsc_con;