FreeCalypso > hg > themwi-system-sw
comparison sip-in/sip_uas.c @ 48:8117d8ee44a5
sip-in: beginning of INVITE handling
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 06 Sep 2022 22:07:51 -0800 |
parents | 62f39c7cee15 |
children | 02761f1ae5e5 |
comparison
equal
deleted
inserted
replaced
47:62f39c7cee15 | 48:8117d8ee44a5 |
---|---|
32 struct sockaddr_in *sin; | 32 struct sockaddr_in *sin; |
33 { | 33 { |
34 struct sip_msg_out resp; | 34 struct sip_msg_out resp; |
35 int rc; | 35 int rc; |
36 | 36 |
37 start_response_out_msg(&resp, "405 Method not supported"); | 37 start_response_out_msg(&resp, "501 Method not supported"); |
38 rc = add_resp_basic_headers(&resp, ess, req->req_method); | 38 rc = add_resp_basic_headers(&resp, ess, req->req_method); |
39 if (rc < 0) { | 39 if (rc < 0) { |
40 too_long: syslog(LOG_ERR, "sending 405 error: response length exceeded"); | 40 too_long: syslog(LOG_ERR, "sending 501 error: response length exceeded"); |
41 return; | 41 return; |
42 } | 42 } |
43 rc = out_msg_add_header(&resp, "Allow", "INVITE,ACK,CANCEL,BYE"); | 43 rc = out_msg_add_header(&resp, "Allow", "INVITE,ACK,CANCEL,BYE"); |
44 if (rc < 0) | 44 if (rc < 0) |
45 goto too_long; | 45 goto too_long; |
61 msg->req_method, ess.error_field); | 61 msg->req_method, ess.error_field); |
62 return; | 62 return; |
63 } | 63 } |
64 /* dispatch by method */ | 64 /* dispatch by method */ |
65 if (!strcmp(msg->req_method, "INVITE")) | 65 if (!strcmp(msg->req_method, "INVITE")) |
66 method_tbi(msg, &ess, sin); | 66 handle_sip_invite(msg, &ess, sin); |
67 else if (!strcmp(msg->req_method, "ACK")) | 67 else if (!strcmp(msg->req_method, "ACK")) |
68 method_tbi(msg, &ess, sin); | 68 method_tbi(msg, &ess, sin); |
69 else if (!strcmp(msg->req_method, "CANCEL")) | 69 else if (!strcmp(msg->req_method, "CANCEL")) |
70 method_tbi(msg, &ess, sin); | 70 method_tbi(msg, &ess, sin); |
71 else if (!strcmp(msg->req_method, "BYE")) | 71 else if (!strcmp(msg->req_method, "BYE")) |