FreeCalypso > hg > themwi-system-sw
comparison sip-manual-out/uas.c @ 148:b51247739897
sip-manual-out: attempt to play along with re-INVITEs
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 08 Oct 2022 23:52:08 -0800 |
parents | 94b5831c017f |
children |
comparison
equal
deleted
inserted
replaced
147:94b5831c017f | 148:b51247739897 |
---|---|
28 if (rc < 0) { | 28 if (rc < 0) { |
29 too_long: fprintf(stderr, | 29 too_long: fprintf(stderr, |
30 "sending 501 error: response length exceeded\n"); | 30 "sending 501 error: response length exceeded\n"); |
31 return; | 31 return; |
32 } | 32 } |
33 rc = out_msg_add_header(&resp, "Allow", "BYE"); | 33 rc = out_msg_add_header(&resp, "Allow", "INVITE,ACK,BYE"); |
34 if (rc < 0) | 34 if (rc < 0) |
35 goto too_long; | 35 goto too_long; |
36 out_msg_finish(&resp); | 36 out_msg_finish(&resp); |
37 sip_tx_packet(&resp, sin); | 37 sip_tx_packet(&resp, sin); |
38 } | 38 } |
50 printf("SIP %.16s request: bad or missing %s header\n", | 50 printf("SIP %.16s request: bad or missing %s header\n", |
51 msg->req_method, ess.error_field); | 51 msg->req_method, ess.error_field); |
52 return; | 52 return; |
53 } | 53 } |
54 /* dispatch by method */ | 54 /* dispatch by method */ |
55 if (!strcmp(msg->req_method, "BYE")) | 55 if (!strcmp(msg->req_method, "INVITE")) |
56 handle_invite_req(msg, &ess, sin); | |
57 else if (!strcmp(msg->req_method, "ACK")) | |
58 printf("Received ACK request, swallowing it\n"); | |
59 else if (!strcmp(msg->req_method, "BYE")) | |
56 handle_bye_req(msg, &ess, sin); | 60 handle_bye_req(msg, &ess, sin); |
57 else if (!strcmp(msg->req_method, "ACK")) | |
58 printf("Received unexpected ACK, swallowing it\n"); | |
59 else | 61 else |
60 unsupported_method(msg, &ess, sin); | 62 unsupported_method(msg, &ess, sin); |
61 } | 63 } |