FreeCalypso > hg > themwi-system-sw
comparison liboutrt/route_e164.c @ 265:e4a93ad611f3
liboutrt: add prefix length output arg to route_e164_number()
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 13 Nov 2023 15:09:10 -0800 |
parents | 333dbb7ce704 |
children |
comparison
equal
deleted
inserted
replaced
264:cdc807117841 | 265:e4a93ad611f3 |
---|---|
14 | 14 |
15 extern struct out_routes_header outrt_hdr; | 15 extern struct out_routes_header outrt_hdr; |
16 extern struct sip_out_dest *outrt_dest_array; | 16 extern struct sip_out_dest *outrt_dest_array; |
17 extern struct inn_route *outrt_inn_array; | 17 extern struct inn_route *outrt_inn_array; |
18 | 18 |
19 route_e164_number(target_num, destp) | 19 route_e164_number(target_num, destp, prefix_len_ret) |
20 char *target_num; | 20 char *target_num; |
21 struct sip_out_dest **destp; | 21 struct sip_out_dest **destp; |
22 int *prefix_len_ret; | |
22 { | 23 { |
23 unsigned inn_index; | 24 unsigned inn_index; |
24 struct inn_route *rec; | 25 struct inn_route *rec; |
25 struct sip_out_dest *dest; | 26 struct sip_out_dest *dest; |
26 char *pp, *tp; | 27 char *pp, *tp; |
35 } | 36 } |
36 if (*pp) | 37 if (*pp) |
37 continue; | 38 continue; |
38 dest = outrt_dest_array + rec->sip_dest_id; | 39 dest = outrt_dest_array + rec->sip_dest_id; |
39 *destp = dest; | 40 *destp = dest; |
41 if (prefix_len_ret) | |
42 *prefix_len_ret = pp - rec->prefix; | |
40 return 1; | 43 return 1; |
41 } | 44 } |
42 return 0; | 45 return 0; |
43 } | 46 } |