comparison mtctest/main.c @ 14:44c1d4d787e9 default tip

themwi-test-mtc: add option to set bearer cap
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 28 Nov 2024 20:37:23 +0000
parents 395c56969bc4
children
comparison
equal deleted inserted replaced
13:c71801aa0039 14:44c1d4d787e9
23 main(argc, argv) 23 main(argc, argv)
24 char **argv; 24 char **argv;
25 { 25 {
26 extern int optind; 26 extern int optind;
27 extern char *optarg; 27 extern char *optarg;
28 char *from; 28 char *from, *bc_extra;
29 int include_bc;
29 fd_set fds; 30 fd_set fds;
30 struct timeval next_rtp_out, timeout; 31 struct timeval next_rtp_out, timeout;
31 int c, max_fd, rtp_out_running; 32 int c, max_fd, rtp_out_running;
32 33
33 from = 0; 34 from = 0;
34 while ((c = getopt(argc, argv, "f:")) != EOF) { 35 include_bc = 0;
36 bc_extra = 0;
37 while ((c = getopt(argc, argv, "f:sS:")) != EOF) {
35 switch (c) { 38 switch (c) {
36 case 'f': 39 case 'f':
37 from = optarg; 40 from = optarg;
41 continue;
42 case 's':
43 include_bc = 1;
44 continue;
45 case 'S':
46 include_bc = 1;
47 bc_extra = optarg;
38 continue; 48 continue;
39 default: 49 default:
40 usage: 50 usage:
41 fprintf(stderr, 51 fprintf(stderr,
42 "usage: %s [-f from-number] to-number\n", 52 "usage: %s [-f from-number] to-number\n",
46 } 56 }
47 if (argc != optind + 1) 57 if (argc != optind + 1)
48 goto usage; 58 goto usage;
49 openlog("themwi-test-mtc", 0, LOG_LOCAL5); 59 openlog("themwi-test-mtc", 0, LOG_LOCAL5);
50 init_setup_msg(from, argv[optind]); 60 init_setup_msg(from, argv[optind]);
61 if (include_bc)
62 set_bearer_cap(bc_extra);
51 obtain_rtp_endp(); 63 obtain_rtp_endp();
52 connect_mtc_socket(); 64 connect_mtc_socket();
53 send_setup_msg(); 65 send_setup_msg();
54 /* main select loop */ 66 /* main select loop */
55 max_fd = mtc_socket; 67 max_fd = mtc_socket;