factor out gen of USSD notify and release complete to libosmocore
Both libmsc and libbsc will need distinct gsm0480_send_ussdNotify() and
gsm0480_send_releaseComplete() functions, since there will be distinct
subscriber connection structs.
Rename to msc_send_ussd_notify() and msc_send_ussd_release_complete(), and add
the same in libbsc with bsc_ prefix in new file gsm_04_80_utils.c.
In preparation of this patch, the message generation part of these functions
has been added to libosmocore as gsm0480_create_ussd_notify() and
gsm0480_create_ussd_release_complete(). Use these.
Adjust all libmsc and libbsc callers according to use the msc_* or bsc_*
implementation, respectively.
Change-Id: I33a84e3c28576ced91d2ea24103123431f551173
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_api.c b/openbsc/src/osmo-bsc/osmo_bsc_api.c
index d31e6c1..7a3ef70 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_api.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_api.c
@@ -205,8 +205,8 @@
gsm48_tx_mm_serv_ack(conn);
LOGP(DMSC, LOGL_INFO, "Sending USSD message: '%s'\n", text);
- gsm0480_send_ussdNotify(conn, 1, text);
- gsm0480_send_releaseComplete(conn);
+ bsc_send_ussd_notify(conn, 1, text);
+ bsc_send_ussd_release_complete(conn);
}
/*
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
index 3010b55..40e1960 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
@@ -598,8 +598,8 @@
* the release complete when we get a returnResultLast
* for this invoke id.
*/
- gsm0480_send_releaseComplete(conn);
- gsm0480_send_ussdNotify(conn, alert, text_str);
+ bsc_send_ussd_release_complete(conn);
+ bsc_send_ussd_notify(conn, alert, text_str);
cmd->reply = "Found a connection";
break;
}
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_filter.c b/openbsc/src/osmo-bsc/osmo_bsc_filter.c
index 14e0b71..66c6406 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_filter.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_filter.c
@@ -246,8 +246,8 @@
int bsc_send_welcome_ussd(struct gsm_subscriber_connection *conn)
{
- gsm0480_send_ussdNotify(conn, 1, conn->sccp_con->msc->ussd_welcome_txt);
- gsm0480_send_releaseComplete(conn);
+ bsc_send_ussd_notify(conn, 1, conn->sccp_con->msc->ussd_welcome_txt);
+ bsc_send_ussd_release_complete(conn);
return 0;
}
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_grace.c b/openbsc/src/osmo-bsc/osmo_bsc_grace.c
index e6194ab..6409a3a 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_grace.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_grace.c
@@ -112,8 +112,8 @@
if (lchan->state != LCHAN_S_ACTIVE)
return -1;
- gsm0480_send_ussdNotify(conn, 0, text);
- gsm0480_send_releaseComplete(conn);
+ bsc_send_ussd_notify(conn, 0, text);
+ bsc_send_ussd_release_complete(conn);
return 0;
}
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c
index 86b27be..2fafed6 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c
@@ -285,8 +285,8 @@
return;
/* send USSD notification */
- gsm0480_send_ussdNotify(conn, 1, conn->sccp_con->msc->ussd_msc_lost_txt);
- gsm0480_send_releaseComplete(conn);
+ bsc_send_ussd_notify(conn, 1, conn->sccp_con->msc->ussd_msc_lost_txt);
+ bsc_send_ussd_release_complete(conn);
}
static void bsc_notify_and_close_conns(struct bsc_msc_connection *msc_con)