diff sip-out/call_setup.c @ 259:9f96e5b14755

sip-out: implement E911 special handling
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 15 Aug 2023 11:28:30 -0800
parents 63252528a56c
children e4a93ad611f3
line wrap: on
line diff
--- a/sip-out/call_setup.c	Tue Aug 15 10:54:16 2023 -0800
+++ b/sip-out/call_setup.c	Tue Aug 15 11:28:30 2023 -0800
@@ -117,6 +117,7 @@
 		}
 		to_sip_user[0] = '+';
 		strcpy(to_sip_user+1, msg->called.number);
+		special_rt = 0;
 	} else {
 		rc = route_special_number(msg->called.number, &dest,
 					  &special_rt);
@@ -141,6 +142,12 @@
 				GSM48_CC_CAUSE_BEARER_CA_UNAVAIL);
 		return;
 	}
+	/* E911 special handling */
+	if (special_rt && special_rt->flags & SPECIAL_NUM_FLAG_E911) {
+		rc = e911_call_preen(msg);
+		if (!rc)
+			goto call_barred;
+	}
 	/* TMGW must be up and running */
 	rc = connect_tmgw_socket();
 	if (rc < 0) {