comparison utils/themwi-update-outrt.c @ 255:b0bf167bb846

themwi-update-outrt: add route-to-e911 option
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 15 Aug 2023 00:23:03 -0800
parents de7c64c4d6fd
children b997de027717
comparison
equal deleted inserted replaced
254:beb6aaecfe63 255:b0bf167bb846
326 "out-routes line %d: no inn-route for map-to number\n", 326 "out-routes line %d: no inn-route for map-to number\n",
327 lineno); 327 lineno);
328 exit(1); 328 exit(1);
329 } 329 }
330 rec->sip_dest_id = dest_id; 330 rec->sip_dest_id = dest_id;
331 rec->flags = 0;
331 special_num_count++; 332 special_num_count++;
332 } 333 }
333 334
334 static void 335 static void
335 handle_special_num_route_to(num_code, cp) 336 handle_special_num_route_to(num_code, cp, is_e911)
336 char *num_code, *cp; 337 char *num_code, *cp;
337 { 338 {
338 struct special_num_route *rec; 339 struct special_num_route *rec;
339 char *dest_name; 340 char *dest_name;
340 int dest_id; 341 int dest_id;
364 } 365 }
365 rec = special_num_records + special_num_count; 366 rec = special_num_records + special_num_count;
366 strcpy(rec->special_num, num_code); 367 strcpy(rec->special_num, num_code);
367 strcpy(rec->sip_user, num_code); 368 strcpy(rec->sip_user, num_code);
368 rec->sip_dest_id = dest_id; 369 rec->sip_dest_id = dest_id;
370 rec->flags = is_e911 ? SPECIAL_NUM_FLAG_E911 : 0;
369 special_num_count++; 371 special_num_count++;
370 } 372 }
371 373
372 static void 374 static void
373 handle_special_num(cp) 375 handle_special_num(cp)
399 if (*cp) 401 if (*cp)
400 *cp++ = '\0'; 402 *cp++ = '\0';
401 if (!strcmp(handling_kw, "map-to")) 403 if (!strcmp(handling_kw, "map-to"))
402 handle_special_num_map_to(num_code, cp); 404 handle_special_num_map_to(num_code, cp);
403 else if (!strcmp(handling_kw, "route-to")) 405 else if (!strcmp(handling_kw, "route-to"))
404 handle_special_num_route_to(num_code, cp); 406 handle_special_num_route_to(num_code, cp, 0);
407 else if (!strcmp(handling_kw, "route-to-e911"))
408 handle_special_num_route_to(num_code, cp, 1);
405 else 409 else
406 goto inv_syntax; 410 goto inv_syntax;
407 } 411 }
408 412
409 static void 413 static void