diff sip-in/call_list.c @ 62:75b7a7b61824

sip-in: got as far as sending MNCC_SETUP_REQ to themwi-mncc
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 17 Sep 2022 18:43:08 -0800
parents 02761f1ae5e5
children e5aee661e3b2
line wrap: on
line diff
--- a/sip-in/call_list.c	Sat Sep 17 16:43:30 2022 -0800
+++ b/sip-in/call_list.c	Sat Sep 17 18:43:08 2022 -0800
@@ -26,3 +26,30 @@
 			return call;
 	return 0;
 }
+
+struct call *
+find_call_by_mncc_callref(callref)
+	uint32_t callref;
+{
+	struct call *call;
+
+	for (call = call_list; call; call = call->next)
+		if (call->mncc_active && call->mncc_callref == callref)
+			return call;
+	return 0;
+}
+
+allocate_mncc_callref(call)
+	struct call *call;
+{
+	static uint32_t next_callref;
+
+	for (;;) {
+		next_callref++;
+		if (!find_call_by_mncc_callref(next_callref)) {
+			call->mncc_active = 1;
+			call->mncc_callref = next_callref;
+			return(0);
+		}
+	}
+}