FreeCalypso > hg > themwi-system-sw
annotate sip-out/invite.c @ 159:c8e9b295e88f
mtctest: add time reporting for DTMF events
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 12 Oct 2022 12:11:06 -0800 |
parents | 51cf5ea7f320 |
children | bfa9f0c0f0ac |
rev | line source |
---|---|
156
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * In this module we handle responses to INVITE. |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 */ |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 #include <sys/types.h> |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #include <sys/socket.h> |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #include <sys/time.h> |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 #include <netinet/in.h> |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 #include <stdio.h> |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 #include <stdint.h> |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 #include <stdlib.h> |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 #include <string.h> |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 #include <strings.h> |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 #include <syslog.h> |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 #include "../include/gsm48_const.h" |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 #include "../include/out_routes.h" |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 #include "../libsip/parse.h" |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 #include "../libsip/sdp.h" |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 #include "../libsip/out_msg.h" |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 #include "call.h" |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 extern char *get_single_header(); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 extern char *extract_to_tag(); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 |
157
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
25 extern unsigned sip_linger_invite_err; |
156
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 extern unsigned sip_linger_response_err; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 static |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 check_sdp_present(msg) |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 struct sip_pkt_rx *msg; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 { |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 char *hval; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 if (!msg->msg_body_len) |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 return 0; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 hval = get_single_header(msg, "Content-Type", "c", (int *) 0); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 if (!hval) |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 return 0; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 if (!strcasecmp(hval, "application/sdp")) |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 return 1; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 else |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 return 0; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 } |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 static |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 extract_sdp(call, msg) |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 struct call *call; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 struct sip_pkt_rx *msg; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 { |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 struct sdp_parse sdp_parse; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 int rc, use_pcma; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 rc = parse_incoming_sdp(msg->msg_body, msg->msg_body_len, &sdp_parse); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 if (rc < 0) |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 return rc; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 switch (sdp_parse.codec_mask) { |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 case SDP_CODEC_MASK_PCMU: |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 case SDP_CODEC_MASK_BOTH: |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 use_pcma = 0; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 break; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 case SDP_CODEC_MASK_PCMA: |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 case SDP_CODEC_MASK_BOTH | SDP_CODEC_MASK_PCMA_PREF: |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 use_pcma = 1; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 break; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 default: |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 return -2; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 } |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 call->pstn_rtp_remote.sin_family = AF_INET; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 call->pstn_rtp_remote.sin_addr = sdp_parse.ip_addr; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 call->pstn_rtp_remote.sin_port = htons(sdp_parse.audio_port); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 call->use_pcma = use_pcma; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 return 0; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 } |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 static void |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 handle_1xx(call, msg, tag, sin) |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 struct call *call; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 struct sip_pkt_rx *msg; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 char *tag; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 struct sockaddr_in *sin; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 { |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 int rc; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 switch (call->sip_state) { |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 case SIP_STATE_INV_SENT: |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 call->sip_state = SIP_STATE_100_RCVD; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 /* FALL THRU */ |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 case SIP_STATE_100_RCVD: |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 if (msg->status_code == 180) |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 call->overall_state = OVERALL_STATE_RINGING; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 if (check_sdp_present(msg) && |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 call->mgw_state == MGW_STATE_ALLOCATED) { |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 rc = extract_sdp(call, msg); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 if (rc < 0) { |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 syslog(LOG_ERR, "bad SDP in %03u response", |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 msg->status_code); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 call->overall_state = OVERALL_STATE_TEARDOWN; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98 disconnect_mncc(call, GSM48_CAUSE_LOC_PRN_S_LU, |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 GSM48_CC_CAUSE_BEARER_CA_UNAVAIL); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 disconnect_tmgw(call); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 initiate_sip_cancel(call); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 return; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 } |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 tmgw_send_mdcx_connect(call, 1); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 } else if (msg->status_code == 180) |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 mncc_signal_alerting(call); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 return; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 case SIP_STATE_ACCEPT_100: |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 initiate_sip_cancel(call); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 return; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 } |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 } |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 static |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 send_ack(call, tag, sin) |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
116 struct call *call; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
117 char *tag; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118 struct sockaddr_in *sin; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 { |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
120 struct sip_msg_out msg; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
121 int rc; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
122 |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
123 rc = start_request_out_msg(&msg, "ACK", call->to_uri); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
124 if (rc < 0) |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
125 return rc; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
126 rc = add_req_boilerplate(&msg, call, "1 ACK", tag); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
127 if (rc < 0) |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
128 return rc; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
129 out_msg_finish(&msg); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
130 sip_tx_packet(&msg, sin); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
131 return 0; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
132 } |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
133 |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
134 static void |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
135 handle_200(call, msg, tag, sin) |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
136 struct call *call; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
137 struct sip_pkt_rx *msg; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
138 char *tag; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
139 struct sockaddr_in *sin; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
140 { |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
141 int rc; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
142 |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
143 switch (call->sip_state) { |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
144 case SIP_STATE_INV_SENT: |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
145 case SIP_STATE_100_RCVD: |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
146 rc = send_ack(call, tag, sin); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
147 if (rc < 0) { |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
148 syslog(LOG_CRIT, |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
149 "ACK to %03u response exceeds msg size!", |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
150 msg->status_code); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
151 call->overall_state = OVERALL_STATE_TEARDOWN; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
152 disconnect_mncc(call, GSM48_CAUSE_LOC_PRN_S_LU, |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
153 GSM48_CC_CAUSE_DEST_OOO); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
154 disconnect_tmgw(call); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
155 call->sip_state = SIP_STATE_ENDED; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
156 sip_mark_end_time(call, sip_linger_response_err); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
157 return; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
158 } |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
159 if (tag) |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
160 strcpy(call->to_tag, tag); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
161 call->sip_state = SIP_STATE_CONNECTED; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
162 if (!check_sdp_present(msg)) { |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
163 syslog(LOG_ERR, "error: %03u response has no SDP", |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
164 msg->status_code); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
165 call->overall_state = OVERALL_STATE_TEARDOWN; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
166 disconnect_mncc(call, GSM48_CAUSE_LOC_PRN_S_LU, |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
167 GSM48_CC_CAUSE_DEST_OOO); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
168 disconnect_tmgw(call); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
169 initiate_bye(call); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
170 return; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
171 } |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
172 rc = extract_sdp(call, msg); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
173 if (rc < 0) { |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
174 syslog(LOG_ERR, "bad SDP in %03u response", |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
175 msg->status_code); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
176 call->overall_state = OVERALL_STATE_TEARDOWN; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
177 disconnect_mncc(call, GSM48_CAUSE_LOC_PRN_S_LU, |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
178 GSM48_CC_CAUSE_BEARER_CA_UNAVAIL); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
179 disconnect_tmgw(call); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
180 initiate_bye(call); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
181 return; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
182 } |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
183 call->overall_state = OVERALL_STATE_CONNECTED; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
184 switch (call->mgw_state) { |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
185 case MGW_STATE_ALLOCATED: |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
186 case MGW_STATE_IBT_CONN: |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
187 tmgw_send_mdcx_connect(call, 0); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
188 return; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
189 case MGW_STATE_MDCX_IBT: |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
190 return; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
191 default: |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
192 syslog(LOG_CRIT, |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
193 "FATAL: invalid MGW state 0x%x on INVITE %03u response", |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
194 call->mgw_state, msg->status_code); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
195 exit(1); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
196 } |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
197 case SIP_STATE_CONNECTED: |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
198 case SIP_STATE_BYE_SENT: |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
199 if (tag && call->to_tag[0] && strcmp(call->to_tag, tag)) { |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
200 syslog(LOG_ERR, |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
201 "received %u response with different To tag, ignoring", |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
202 msg->status_code); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
203 return; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
204 } |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
205 send_ack(call, call->to_tag, sin); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
206 return; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
207 case SIP_STATE_CANCEL_SENT: |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
208 case SIP_STATE_ACCEPT_100: |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
209 case SIP_STATE_ACCEPT_200: |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
210 rc = send_ack(call, tag, sin); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
211 if (rc < 0) { |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
212 syslog(LOG_CRIT, |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
213 "ACK to %03u response exceeds msg size!", |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
214 msg->status_code); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
215 call->sip_state = SIP_STATE_ENDED; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
216 sip_mark_end_time(call, sip_linger_response_err); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
217 return; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
218 } |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
219 if (tag) |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
220 strcpy(call->to_tag, tag); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
221 initiate_bye(call); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
222 return; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
223 case SIP_STATE_ENDED: |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
224 return; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
225 default: |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
226 syslog(LOG_CRIT, |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
227 "FATAL: invalid SIP state 0x%x on INVITE %03u response", |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
228 call->sip_state, msg->status_code); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
229 exit(1); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
230 } |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
231 } |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
232 |
158
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
233 static int |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
234 sip_error_to_gsm_cause(sip_status_code) |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
235 unsigned sip_status_code; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
236 { |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
237 /* mapping taken from osmo-sip-connector */ |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
238 switch (sip_status_code) { |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
239 case 400: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
240 return GSM48_CC_CAUSE_TEMP_FAILURE; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
241 case 401: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
242 case 402: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
243 case 403: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
244 return GSM48_CC_CAUSE_CALL_REJECTED; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
245 case 404: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
246 return GSM48_CC_CAUSE_UNASSIGNED_NR; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
247 case 405: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
248 return GSM48_CC_CAUSE_SERV_OPT_UNAVAIL; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
249 case 406: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
250 return GSM48_CC_CAUSE_CHAN_UNACCEPT; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
251 case 407: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
252 return GSM48_CC_CAUSE_CALL_REJECTED; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
253 case 408: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
254 return GSM48_CC_CAUSE_RECOVERY_TIMER; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
255 case 410: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
256 return GSM48_CC_CAUSE_NUMBER_CHANGED; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
257 case 413: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
258 case 414: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
259 return GSM48_CC_CAUSE_INTERWORKING; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
260 case 415: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
261 return GSM48_CC_CAUSE_SERV_OPT_UNIMPL; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
262 case 416: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
263 return GSM48_CC_CAUSE_INVAL_TRANS_ID; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
264 case 420: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
265 case 421: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
266 case 423: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
267 return GSM48_CC_CAUSE_INTERWORKING; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
268 case 480: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
269 return GSM48_CC_CAUSE_USER_NOTRESPOND; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
270 case 481: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
271 return GSM48_CC_CAUSE_TEMP_FAILURE; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
272 case 482: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
273 case 483: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
274 return GSM48_CC_CAUSE_PRE_EMPTION; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
275 case 484: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
276 return GSM48_CC_CAUSE_INV_NR_FORMAT; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
277 case 485: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
278 return GSM48_CC_CAUSE_NO_ROUTE; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
279 case 486: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
280 return GSM48_CC_CAUSE_USER_BUSY; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
281 case 488: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
282 return GSM48_CC_CAUSE_INCOMPAT_DEST; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
283 case 500: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
284 return GSM48_CC_CAUSE_TEMP_FAILURE; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
285 case 501: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
286 return GSM48_CC_CAUSE_SERV_OPT_UNIMPL; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
287 case 502: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
288 return GSM48_CC_CAUSE_DEST_OOO; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
289 case 503: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
290 return GSM48_CC_CAUSE_RESOURCE_UNAVAIL; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
291 case 504: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
292 return GSM48_CC_CAUSE_RECOVERY_TIMER; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
293 case 505: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
294 case 513: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
295 return GSM48_CC_CAUSE_INTERWORKING; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
296 case 600: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
297 return GSM48_CC_CAUSE_USER_BUSY; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
298 case 603: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
299 return GSM48_CC_CAUSE_CALL_REJECTED; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
300 case 604: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
301 return GSM48_CC_CAUSE_NO_ROUTE; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
302 case 606: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
303 return GSM48_CC_CAUSE_INCOMPAT_DEST; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
304 default: |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
305 return GSM48_CC_CAUSE_NORMAL_UNSPEC; |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
306 } |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
307 } |
51cf5ea7f320
sip-out: map INVITE errors to GSM cause values
Mychaela Falconia <falcon@freecalypso.org>
parents:
157
diff
changeset
|
308 |
156
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
309 static void |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
310 handle_error(call, msg, tag, sin) |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
311 struct call *call; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
312 struct sip_pkt_rx *msg; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
313 char *tag; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
314 struct sockaddr_in *sin; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
315 { |
157
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
316 int rc; |
156
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
317 |
157
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
318 rc = send_ack(call, tag, sin); |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
319 if (rc < 0) |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
320 syslog(LOG_CRIT, "ACK to %03u response exceeds msg size!", |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
321 msg->status_code); |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
322 switch (call->sip_state) { |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
323 case SIP_STATE_INV_SENT: |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
324 case SIP_STATE_100_RCVD: |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
325 call->overall_state = OVERALL_STATE_TEARDOWN; |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
326 disconnect_mncc(call, GSM48_CAUSE_LOC_NET_BEYOND, |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
327 sip_error_to_gsm_cause(msg->status_code)); |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
328 disconnect_tmgw(call); |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
329 call->sip_state = SIP_STATE_ENDED; |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
330 sip_mark_end_time(call, sip_linger_invite_err); |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
331 return; |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
332 case SIP_STATE_CANCEL_SENT: |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
333 case SIP_STATE_ACCEPT_100: |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
334 case SIP_STATE_ACCEPT_200: |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
335 call->sip_state = SIP_STATE_ENDED; |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
336 sip_mark_end_time(call, sip_linger_invite_err); |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
337 return; |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
338 case SIP_STATE_CONNECTED: |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
339 case SIP_STATE_BYE_SENT: |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
340 case SIP_STATE_ENDED: |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
341 return; |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
342 default: |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
343 syslog(LOG_CRIT, |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
344 "FATAL: invalid SIP state 0x%x on INVITE %03u response", |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
345 call->sip_state, msg->status_code); |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
346 exit(1); |
7643b779dbea
sip-out: handle INVITE errors, except for cause mapping
Mychaela Falconia <falcon@freecalypso.org>
parents:
156
diff
changeset
|
347 } |
156
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
348 } |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
349 |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
350 void |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
351 handle_invite_response(call, msg, sin) |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
352 struct call *call; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
353 struct sip_pkt_rx *msg; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
354 struct sockaddr_in *sin; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
355 { |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
356 char *tag; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
357 |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
358 tag = extract_to_tag(msg, call->to_uri); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
359 if (tag) { |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
360 if (!*tag) { |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
361 syslog(LOG_ERR, |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
362 "To tag in INVITE %03u response is null", |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
363 msg->status_code); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
364 tag = 0; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
365 } else if (strlen(tag) > MAX_SIP_TO_TAG) { |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
366 syslog(LOG_ERR, |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
367 "To tag in INVITE %03u response exceeds length limit", |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
368 msg->status_code); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
369 tag = 0; |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
370 } |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
371 } |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
372 if (msg->status_code >= 100 && msg->status_code <= 199) |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
373 handle_1xx(call, msg, tag, sin); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
374 else if (msg->status_code >= 200 && msg->status_code <= 299) |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
375 handle_200(call, msg, tag, sin); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
376 else |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
377 handle_error(call, msg, tag, sin); |
0bacca1f2f7b
sip-out: handle all INVITE responses, except errors
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
378 } |