FreeCalypso > hg > themwi-system-sw
annotate sip-in/invite_dup.c @ 146:54c2f271380d
sip-in: implement play-along responses to re-INVITEs
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 08 Oct 2022 19:53:23 -0800 |
parents | 4b685a5d9bd4 |
children |
rev | line source |
---|---|
48
8117d8ee44a5
sip-in: beginning of INVITE handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
145
4b685a5d9bd4
sip-in code: split invite.c into 3 separate C modules
Mychaela Falconia <falcon@freecalypso.org>
parents:
117
diff
changeset
|
2 * Here we process SIP INVITE retransmissions and/or re-INVITEs |
146
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
3 * for existing calls. Our new approach is that we shall generate |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
4 * the same stateless response without caring if it's a retransmission |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
5 * or a re-INVITE, using CSeq and Via from the (re-)INVITE packet |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
6 * we are responding to. Our previous approach was to reject all |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
7 * re-INVITE requests, but it turns out that we have to support them |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
8 * in order to satisfy BulkVS and other calling servers that use |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
9 * session timers. |
48
8117d8ee44a5
sip-in: beginning of INVITE handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 */ |
8117d8ee44a5
sip-in: beginning of INVITE handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 |
8117d8ee44a5
sip-in: beginning of INVITE handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 #include <sys/types.h> |
8117d8ee44a5
sip-in: beginning of INVITE handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 #include <sys/socket.h> |
109
9b87894704eb
sip-in: first step toward final call clearing
Mychaela Falconia <falcon@freecalypso.org>
parents:
108
diff
changeset
|
14 #include <sys/time.h> |
48
8117d8ee44a5
sip-in: beginning of INVITE handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 #include <netinet/in.h> |
146
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
16 #include <arpa/inet.h> |
48
8117d8ee44a5
sip-in: beginning of INVITE handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 #include <stdio.h> |
60
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
18 #include <stdint.h> |
48
8117d8ee44a5
sip-in: beginning of INVITE handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 #include <stdlib.h> |
8117d8ee44a5
sip-in: beginning of INVITE handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 #include <string.h> |
8117d8ee44a5
sip-in: beginning of INVITE handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 #include <strings.h> |
8117d8ee44a5
sip-in: beginning of INVITE handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 #include <syslog.h> |
8117d8ee44a5
sip-in: beginning of INVITE handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 #include "../libsip/parse.h" |
8117d8ee44a5
sip-in: beginning of INVITE handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 #include "../libsip/uas_basic.h" |
55
f1d59210f7b2
sip-in INVITE processing: grok SDP
Mychaela Falconia <falcon@freecalypso.org>
parents:
51
diff
changeset
|
25 #include "../libsip/sdp.h" |
48
8117d8ee44a5
sip-in: beginning of INVITE handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 #include "../libsip/out_msg.h" |
60
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
27 #include "call.h" |
48
8117d8ee44a5
sip-in: beginning of INVITE handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 |
146
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
29 extern struct in_addr sip_bind_ip; |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
30 extern unsigned sip_bind_port; |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
31 |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
32 static |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
33 fill_reinvite_resp(msg, call, ess) |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
34 struct sip_msg_out *msg; |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
35 struct call *call; |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
36 struct uas_parse_hdrs *ess; |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
37 { |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
38 char cseq_str[32]; |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
39 int rc; |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
40 |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
41 rc = out_msg_add_header(msg, "From", call->invite_from); |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
42 if (rc < 0) |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
43 return rc; |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
44 rc = out_msg_add_header(msg, "To", call->invite_to); |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
45 if (rc < 0) |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
46 return rc; |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
47 rc = out_msg_add_header(msg, "Call-ID", call->sip_call_id); |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
48 if (rc < 0) |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
49 return rc; |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
50 sprintf(cseq_str, "%u INVITE", ess->cseq_num); |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
51 rc = out_msg_add_header(msg, "CSeq", cseq_str); |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
52 if (rc < 0) |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
53 return rc; |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
54 return out_msg_add_header(msg, "Via", ess->via); |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
55 } |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
56 |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
57 static |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
58 fill_reinvite_resp_200(msg, call, ess) |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
59 struct sip_msg_out *msg; |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
60 struct call *call; |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
61 struct uas_parse_hdrs *ess; |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
62 { |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
63 char contact_str[80]; |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
64 struct sdp_gen sdp; |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
65 int rc; |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
66 |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
67 start_response_out_msg(msg, "200 CONNECT"); |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
68 rc = fill_reinvite_resp(msg, call, ess); |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
69 if (rc < 0) |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
70 return rc; |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
71 sprintf(contact_str, "<sip:%s:%u;transport=udp>", |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
72 inet_ntoa(sip_bind_ip), sip_bind_port); |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
73 rc = out_msg_add_header(msg, "Contact", contact_str); |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
74 if (rc < 0) |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
75 return rc; |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
76 rc = out_msg_add_header(msg, "Content-Type", "application/sdp"); |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
77 if (rc < 0) |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
78 return rc; |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
79 bzero(&sdp, sizeof sdp); |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
80 sdp.conn_ip = call->pstn_rtp_local.sin_addr; |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
81 sdp.conn_port = ntohs(call->pstn_rtp_local.sin_port); |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
82 sdp.codec_mask = call->use_pcma ? SDP_CODEC_MASK_PCMA |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
83 : SDP_CODEC_MASK_PCMU; |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
84 sdp.session_id = (sdp.conn_port << 16) | call->sdp_addend; |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
85 sdp.owner_ip = sip_bind_ip; |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
86 return out_msg_finish_sdp(msg, &sdp); |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
87 } |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
88 |
145
4b685a5d9bd4
sip-in code: split invite.c into 3 separate C modules
Mychaela Falconia <falcon@freecalypso.org>
parents:
117
diff
changeset
|
89 void |
60
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
90 invite_existing_call(req, ess, sin, call) |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
91 struct sip_pkt_rx *req; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
92 struct uas_parse_hdrs *ess; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
93 struct sockaddr_in *sin; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
94 struct call *call; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
95 { |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
96 struct sip_msg_out resp; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
97 int rc; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
98 |
146
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
99 switch (call->sip_state) { |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
100 case SIP_STATE_INVITE_PROC: |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
101 start_response_out_msg(&resp, "100 Proceeding"); |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
102 rc = fill_reinvite_resp(&resp, call, ess); |
60
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
103 if (rc < 0) { |
146
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
104 msg_size_err: syslog(LOG_ERR, |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
105 "Call in%06u: msg size error on re-INVITE response", |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
106 call->in_tag_num); |
60
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
107 return; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
108 } |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
109 out_msg_finish(&resp); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
110 sip_tx_packet(&resp, sin); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
111 return; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
112 case SIP_STATE_RINGING: |
108
0d6435808bcd
sip-in: implement 100rel for 180 Ringing response
Mychaela Falconia <falcon@freecalypso.org>
parents:
107
diff
changeset
|
113 case SIP_STATE_RINGING_REL: |
0d6435808bcd
sip-in: implement 100rel for 180 Ringing response
Mychaela Falconia <falcon@freecalypso.org>
parents:
107
diff
changeset
|
114 start_response_out_msg(&resp, "180 Ringing"); |
146
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
115 rc = fill_reinvite_resp(&resp, call, ess); |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
116 if (rc < 0) |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
117 goto msg_size_err; |
108
0d6435808bcd
sip-in: implement 100rel for 180 Ringing response
Mychaela Falconia <falcon@freecalypso.org>
parents:
107
diff
changeset
|
118 out_msg_finish(&resp); |
0d6435808bcd
sip-in: implement 100rel for 180 Ringing response
Mychaela Falconia <falcon@freecalypso.org>
parents:
107
diff
changeset
|
119 sip_tx_packet(&resp, sin); |
0d6435808bcd
sip-in: implement 100rel for 180 Ringing response
Mychaela Falconia <falcon@freecalypso.org>
parents:
107
diff
changeset
|
120 return; |
60
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
121 case SIP_STATE_INVITE_200: |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
122 case SIP_STATE_CONNECTED: |
146
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
123 rc = fill_reinvite_resp_200(&resp, call, ess); |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
124 if (rc < 0) |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
125 goto msg_size_err; |
60
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
126 sip_tx_packet(&resp, sin); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
127 return; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
128 case SIP_STATE_INVITE_ERR: |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
129 start_response_out_msg(&resp, call->invite_fail); |
146
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
130 rc = fill_reinvite_resp(&resp, call, ess); |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
131 if (rc < 0) |
54c2f271380d
sip-in: implement play-along responses to re-INVITEs
Mychaela Falconia <falcon@freecalypso.org>
parents:
145
diff
changeset
|
132 goto msg_size_err; |
60
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
133 out_msg_finish(&resp); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
134 sip_tx_packet(&resp, sin); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
135 return; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
136 default: |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
137 /* silently discard */ |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
138 return; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
139 } |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
57
diff
changeset
|
140 } |