FreeCalypso > hg > themwi-interim
comparison mncc/call_setup.c @ 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 |
comparison
equal
deleted
inserted
replaced
2:053f04687106 | 3:847690ea7f4a |
---|---|
5 | 5 |
6 #include <sys/types.h> | 6 #include <sys/types.h> |
7 #include <sys/socket.h> | 7 #include <sys/socket.h> |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <stdbool.h> | |
10 #include <stdlib.h> | 11 #include <stdlib.h> |
11 #include <string.h> | 12 #include <string.h> |
12 #include <strings.h> | 13 #include <strings.h> |
13 #include <syslog.h> | 14 #include <syslog.h> |
15 | |
16 #include <themwi/nanp/number_db_v2.h> | |
17 #include <themwi/nanp/number_lookup.h> | |
18 #include <themwi/nanp/number_utils.h> | |
19 | |
14 #include "../include/mncc.h" | 20 #include "../include/mncc.h" |
15 #include "../include/gsm48_const.h" | 21 #include "../include/gsm48_const.h" |
16 #include "../include/number_db_v2.h" | |
17 #include "../libnumdb2/lookup_func.h" | |
18 #include "struct.h" | 22 #include "struct.h" |
19 #include "gsm_call.h" | 23 #include "gsm_call.h" |
20 | 24 |
21 preen_msc_provided_number(nums) | 25 preen_msc_provided_number(nums) |
22 struct gsm_mncc_number *nums; | 26 struct gsm_mncc_number *nums; |
23 { | 27 { |
24 int len; | 28 int len; |
25 | 29 |
26 len = grok_number_string(nums->number, 0); | 30 len = grok_number_string(nums->number, false); |
27 switch (len) { | 31 switch (len) { |
28 case 4: | 32 case 4: |
29 nums->type = GSM48_TON_NET_SPEC; | 33 nums->type = GSM48_TON_NET_SPEC; |
30 nums->plan = GSM48_NPI_PRIVATE; | 34 nums->plan = GSM48_NPI_PRIVATE; |
31 break; | 35 break; |
58 void | 62 void |
59 process_mo_call_setup(msg) | 63 process_mo_call_setup(msg) |
60 struct gsm_mncc *msg; | 64 struct gsm_mncc *msg; |
61 { | 65 { |
62 struct gsm_call *call; | 66 struct gsm_call *call; |
63 struct owned_number_rec *own; | 67 const struct owned_number_rec *own; |
64 struct short_number_rec *snum; | 68 const struct short_number_rec *snum; |
65 int is_nanp, is_itn, is_local; | 69 int is_nanp, is_itn, is_local; |
66 | 70 |
67 if (preen_msc_provided_number(&msg->calling)) | 71 if (preen_msc_provided_number(&msg->calling)) |
68 msg->fields |= MNCC_F_CALLING; | 72 msg->fields |= MNCC_F_CALLING; |
69 else | 73 else |
84 return; | 88 return; |
85 } | 89 } |
86 /* route based on destination address */ | 90 /* route based on destination address */ |
87 refresh_number_db(); | 91 refresh_number_db(); |
88 is_nanp = is_itn = 0; | 92 is_nanp = is_itn = 0; |
89 switch (grok_number_string(msg->called.number, 0)) { | 93 switch (grok_number_string(msg->called.number, false)) { |
90 case 4: | 94 case 4: |
91 if (msg->called.type != GSM48_TON_UNKNOWN && | 95 if (msg->called.type != GSM48_TON_UNKNOWN && |
92 msg->called.type != GSM48_TON_NET_SPEC && | 96 msg->called.type != GSM48_TON_NET_SPEC && |
93 msg->called.type != GSM48_TON_SHORT_CODE) | 97 msg->called.type != GSM48_TON_SHORT_CODE) |
94 break; | 98 break; |