comparison sip-manual-out/main.c @ 121:5dc0190a624e

sip-manual-out: add -r option for testing 100rel
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 29 Sep 2022 14:21:10 -0800
parents c62d0f28da6f
children 07e4cc5f824c
comparison
equal deleted inserted replaced
120:c62d0f28da6f 121:5dc0190a624e
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 unsigned max_forwards = 70;
29 int declare_100rel_supp;
29 30
30 send_invite_req() 31 send_invite_req()
31 { 32 {
32 struct sip_msg_out msg; 33 struct sip_msg_out msg;
33 struct sdp_gen sdp; 34 struct sdp_gen sdp;
42 if (rc < 0) 43 if (rc < 0)
43 goto msg_size_err; 44 goto msg_size_err;
44 rc = add_contact_header(&msg); 45 rc = add_contact_header(&msg);
45 if (rc < 0) 46 if (rc < 0)
46 goto msg_size_err; 47 goto msg_size_err;
48 if (declare_100rel_supp) {
49 rc = out_msg_add_header(&msg, "Supported", "100rel");
50 if (rc < 0)
51 goto msg_size_err;
52 }
47 rc = out_msg_add_header(&msg, "Content-Type", "application/sdp"); 53 rc = out_msg_add_header(&msg, "Content-Type", "application/sdp");
48 if (rc < 0) 54 if (rc < 0)
49 goto msg_size_err; 55 goto msg_size_err;
50 bzero(&sdp, sizeof sdp); 56 bzero(&sdp, sizeof sdp);
51 sdp.conn_ip = dummy_rtp_endp.sin_addr; 57 sdp.conn_ip = dummy_rtp_endp.sin_addr;
67 extern char *optarg; 73 extern char *optarg;
68 char *logfile; 74 char *logfile;
69 int opt, rc; 75 int opt, rc;
70 76
71 logfile = 0; 77 logfile = 0;
72 while ((opt = getopt(argc, argv, "l:m:")) != EOF) { 78 while ((opt = getopt(argc, argv, "l:m:r")) != EOF) {
73 switch (opt) { 79 switch (opt) {
74 case 'l': 80 case 'l':
75 logfile = optarg; 81 logfile = optarg;
76 continue; 82 continue;
77 case 'm': 83 case 'm':
78 max_forwards = atoi(optarg); 84 max_forwards = atoi(optarg);
85 continue;
86 case 'r':
87 declare_100rel_supp = 1;
79 continue; 88 continue;
80 default: 89 default:
81 usage: 90 usage:
82 fprintf(stderr, 91 fprintf(stderr,
83 "usage: %s [options] dest-conf from-num to-num\n", 92 "usage: %s [options] dest-conf from-num to-num\n",