comparison sip-manual-out/main.c @ 120:c62d0f28da6f

sip-manual-out: make Max-Forwards configurable
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 29 Sep 2022 14:13:43 -0800
parents 056616f7e8ab
children 5dc0190a624e
comparison
equal deleted inserted replaced
119:056616f7e8ab 120:c62d0f28da6f
23 extern struct sockaddr_in dummy_rtp_endp; 23 extern struct sockaddr_in dummy_rtp_endp;
24 24
25 struct sockaddr_in sip_dest_sin; 25 struct sockaddr_in sip_dest_sin;
26 char from_uri[128], to_uri[128], call_id[128]; 26 char from_uri[128], to_uri[128], call_id[128];
27 struct timeval cur_event_time; 27 struct timeval cur_event_time;
28 unsigned max_forwards = 70;
28 29
29 send_invite_req() 30 send_invite_req()
30 { 31 {
31 struct sip_msg_out msg; 32 struct sip_msg_out msg;
32 struct sdp_gen sdp; 33 struct sdp_gen sdp;
66 extern char *optarg; 67 extern char *optarg;
67 char *logfile; 68 char *logfile;
68 int opt, rc; 69 int opt, rc;
69 70
70 logfile = 0; 71 logfile = 0;
71 while ((opt = getopt(argc, argv, "l:")) != EOF) { 72 while ((opt = getopt(argc, argv, "l:m:")) != EOF) {
72 switch (opt) { 73 switch (opt) {
73 case 'l': 74 case 'l':
74 logfile = optarg; 75 logfile = optarg;
76 continue;
77 case 'm':
78 max_forwards = atoi(optarg);
75 continue; 79 continue;
76 default: 80 default:
77 usage: 81 usage:
78 fprintf(stderr, 82 fprintf(stderr,
79 "usage: %s [options] dest-conf from-num to-num\n", 83 "usage: %s [options] dest-conf from-num to-num\n",