diff smpp-send/build_pdu.c @ 225:243ed87880a1

smpp-send: implement sending via local socket
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 05 Aug 2023 12:52:33 -0800
parents f11c3e40c87a
children
line wrap: on
line diff
--- a/smpp-send/build_pdu.c	Sat Aug 05 12:27:36 2023 -0800
+++ b/smpp-send/build_pdu.c	Sat Aug 05 12:52:33 2023 -0800
@@ -16,6 +16,7 @@
 extern u_char prio_flag, reg_deliv, replace_flag;
 
 extern int input_lineno;
+extern char *trx_socket;
 
 void
 build_submit_sm(payload, payload_len, udhi)
@@ -86,5 +87,8 @@
 	pdu[2] = pdu_len >> 8;
 	pdu[3] = pdu_len;
 	/* local datagram socket output to be implemented */
-	hex_dump_output(pdu, pdu_len);
+	if (trx_socket)
+		send_pdu_via_socket(pdu, pdu_len);
+	else
+		hex_dump_output(pdu, pdu_len);
 }