changeset 19:9ff041d85da5

proto-smsc-daemon: allow HLR GSUP server other than 127.0.0.1
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 16 Dec 2023 22:23:23 +0000
parents 9c2c1444dca9
children 2230a763713f
files doc/Proto-SMSC-testing smsc-daemon/main.c
diffstat 2 files changed, 16 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/doc/Proto-SMSC-testing	Mon Nov 13 12:47:12 2023 -0800
+++ b/doc/Proto-SMSC-testing	Sat Dec 16 22:23:23 2023 +0000
@@ -59,12 +59,14 @@
 
 3) Run proto-smsc-daemon like this:
 
-proto-smsc-daemon Example-SMSC mo-sms-log /tmp/sendmt_socket
+proto-smsc-daemon 127.0.0.1 Example-SMSC mo-sms-log /tmp/sendmt_socket
 
-The first argument is the IPA name this proto-SMSC should give itself (needs to
-match OsmoHLR config), the second argument is the name of a log file that will
-be opened for writing, and the third argument is the pathname to which a local
-UNIX domain socket will be bound.
+The first argument is the IP address of your OsmoHLR instance (more precisely,
+the IP address at which OsmoHLR GSUP server can be reached; standard GSUP port
+is required), the second argument is the IPA name this proto-SMSC should give
+itself (needs to match OsmoHLR config), the third argument is the name of a log
+file that will be opened for writing, and the fourth argument is the pathname
+to which a local UNIX domain socket will be bound.
 
 Any time an MS sends MO SMS to this proto-SMSC, the message will be written
 into the line-oriented log file which you named as the second argument to
--- a/smsc-daemon/main.c	Mon Nov 13 12:47:12 2023 -0800
+++ b/smsc-daemon/main.c	Sat Dec 16 22:23:23 2023 +0000
@@ -79,19 +79,21 @@
 
 int main(int argc, char **argv)
 {
-	char *server_host = "127.0.0.1";
+	const char *server_host;
 	uint16_t server_port = OSMO_GSUP_PORT;
 	void *ctx = talloc_named_const(NULL, 0, "proto-smsc");
 
 	osmo_init_logging2(ctx, &smsc_log_info);
 
-	if (argc < 3 || argc > 4) {
-		fprintf(stderr, "usage: %s ipa-name logfile [local-socket]\n",
+	if (argc < 4 || argc > 5) {
+		fprintf(stderr,
+			"usage: %s hlr-ip ipa-name logfile [local-socket]\n",
 			argv[0]);
 		exit(1);
 	}
-	set_ipa_name(argv[1]);
-	open_log_file(argv[2]);
+	server_host = argv[1];
+	set_ipa_name(argv[2]);
+	open_log_file(argv[3]);
 
 	build_ipa_dev();
 	g_gc = osmo_gsup_client_create2(ctx, &gsup_ipa_dev, server_host,
@@ -100,8 +102,8 @@
 		fprintf(stderr, "error: osmo_gsup_client_create2() failed\n");
 		exit(1);
 	}
-	if (argv[3])
-		setup_local_socket(argv[3]);
+	if (argv[4])
+		setup_local_socket(argv[4]);
 
 	while (1) {
 		osmo_select_main(0);