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.
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c
index 3dd0a52..33c737f 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 @@
 	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 @@
 }
 
 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 @@
 	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;