changeset 3:847690ea7f4a

mncc compiles in new environment
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 08 Jun 2024 23:55:06 +0000
parents 053f04687106
children ce450869db09
files .hgignore mncc/Makefile mncc/call_setup.c mncc/main.c
diffstat 4 files changed, 32 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Sat Jun 08 23:12:12 2024 +0000
+++ b/.hgignore	Sat Jun 08 23:55:06 2024 +0000
@@ -2,3 +2,5 @@
 
 \.[oa]$
 ^config\.defs$
+
+^mncc/themwi-mncc$
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mncc/Makefile	Sat Jun 08 23:55:06 2024 +0000
@@ -0,0 +1,19 @@
+CPPFLAGS=-I${includedir}
+PROG=	themwi-mncc
+OBJS=	call_setup.o extsock.o gsm_call.o intswitch.o main.o mncc_recv.o \
+	mncc_sock.o mtsock.o outcall.o
+LIBUTIL=../libutil/libutil.a
+
+include ../config.defs
+
+all:	${PROG}
+
+${PROG}: ${OBJS} ${LIBUTIL}
+	${CC} -o $@ ${OBJS} ${LIBUTIL} -L${libdir} -lnumdb -lnumutil
+
+install:
+	mkdir -p ${DESTDIR}${bindir}
+	install -c -m 755 ${PROG} ${DESTDIR}${bindir}
+
+clean:
+	rm -f *.o ${PROG} errs
--- a/mncc/call_setup.c	Sat Jun 08 23:12:12 2024 +0000
+++ b/mncc/call_setup.c	Sat Jun 08 23:55:06 2024 +0000
@@ -7,14 +7,18 @@
 #include <sys/socket.h>
 #include <stdio.h>
 #include <stdint.h>
+#include <stdbool.h>
 #include <stdlib.h>
 #include <string.h>
 #include <strings.h>
 #include <syslog.h>
+
+#include <themwi/nanp/number_db_v2.h>
+#include <themwi/nanp/number_lookup.h>
+#include <themwi/nanp/number_utils.h>
+
 #include "../include/mncc.h"
 #include "../include/gsm48_const.h"
-#include "../include/number_db_v2.h"
-#include "../libnumdb2/lookup_func.h"
 #include "struct.h"
 #include "gsm_call.h"
 
@@ -23,7 +27,7 @@
 {
 	int len;
 
-	len = grok_number_string(nums->number, 0);
+	len = grok_number_string(nums->number, false);
 	switch (len) {
 	case 4:
 		nums->type = GSM48_TON_NET_SPEC;
@@ -60,8 +64,8 @@
 	struct gsm_mncc *msg;
 {
 	struct gsm_call *call;
-	struct owned_number_rec *own;
-	struct short_number_rec *snum;
+	const struct owned_number_rec *own;
+	const struct short_number_rec *snum;
 	int is_nanp, is_itn, is_local;
 
 	if (preen_msc_provided_number(&msg->calling))
@@ -86,7 +90,7 @@
 	/* route based on destination address */
 	refresh_number_db();
 	is_nanp = is_itn = 0;
-	switch (grok_number_string(msg->called.number, 0)) {
+	switch (grok_number_string(msg->called.number, false)) {
 	case 4:
 		if (msg->called.type != GSM48_TON_UNKNOWN &&
 		    msg->called.type != GSM48_TON_NET_SPEC &&
--- a/mncc/main.c	Sat Jun 08 23:12:12 2024 +0000
+++ b/mncc/main.c	Sat Jun 08 23:55:06 2024 +0000
@@ -12,6 +12,7 @@
 #include <signal.h>
 #include <syslog.h>
 #include <unistd.h>
+#include <themwi/nanp/number_lookup.h>
 #include "struct.h"
 
 extern int mncc_socket;