FreeCalypso > hg > themwi-system-sw
annotate sip-in/mgw_ops.c @ 123:a36b731bfef9
sip-manual-out: implement sending BYE and CANCEL
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 29 Sep 2022 17:21:11 -0800 |
parents | c1c94b7fc2e2 |
children | 5685412bd6aa |
rev | line source |
---|---|
60
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * In this module we implement all transactions from themwi-sip-in |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * toward themwi-mgw. |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 */ |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #include <sys/types.h> |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #include <sys/socket.h> |
109
9b87894704eb
sip-in: first step toward final call clearing
Mychaela Falconia <falcon@freecalypso.org>
parents:
98
diff
changeset
|
8 #include <sys/time.h> |
60
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 #include <netinet/in.h> |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 #include <stdio.h> |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 #include <stdint.h> |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 #include <stdlib.h> |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 #include <string.h> |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 #include <strings.h> |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 #include <syslog.h> |
98
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
16 #include "../include/gsm48_const.h" |
60
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 #include "../include/tmgw_ctrl.h" |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 #include "../include/tmgw_const.h" |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 #include "call.h" |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 extern struct call *call_list; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 struct call * |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 find_call_with_mgw_xact(xact_id) |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 uint32_t xact_id; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 { |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 struct call *call; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 for (call = call_list; call; call = call->next) |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 if (call->mgw_xact && call->mgw_xact_id == xact_id) |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 return call; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 return 0; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 } |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 uint32_t |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 get_new_tmgw_xact_id() |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 { |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 static uint32_t next_xact_id; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 for (;;) { |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 next_xact_id++; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 if (!find_call_with_mgw_xact(next_xact_id)) |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 return next_xact_id; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 } |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 } |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 void |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 tmgw_send_crcx(call) |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 struct call *call; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 { |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 struct tmgw_ctrl_req req; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 bzero(&req, sizeof req); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 req.opcode = TMGW_CTRL_OP_CRCX; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 req.transact_ref = get_new_tmgw_xact_id(); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 req.ep_id = TMGW_EP_TYPE_GATEWAY; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 req.setup_mask = TMGW_CTRL_MASK_PSTN_CONN; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 bcopy(&call->pstn_rtp_remote, &req.pstn_addr, |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 sizeof(struct sockaddr_in)); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 req.pstn_payload_type = |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 call->use_pcma ? PSTN_CODEC_PCMA : PSTN_CODEC_PCMU; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 send_req_to_tmgw(&req); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 call->mgw_xact = TMGW_CTRL_OP_CRCX; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 call->mgw_xact_id = req.transact_ref; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 } |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 void |
86
f332ccc240f1
sip-in: preparations toward TMGW connect-through
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
68 tmgw_send_mdcx_connect(call) |
60
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 struct call *call; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 { |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 struct tmgw_ctrl_req req; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 bzero(&req, sizeof req); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 req.opcode = TMGW_CTRL_OP_MDCX; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 req.transact_ref = get_new_tmgw_xact_id(); |
61
e12036337412
sip-in/mgw_ops.c: fix double semicolon
Mychaela Falconia <falcon@freecalypso.org>
parents:
60
diff
changeset
|
76 req.ep_id = call->mgw_ep_id; |
86
f332ccc240f1
sip-in: preparations toward TMGW connect-through
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
77 req.setup_mask = TMGW_CTRL_MASK_GSM_CONN | TMGW_CTRL_MASK_FWD_MODE; |
60
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 bcopy(&call->gsm_rtp_osmo, &req.gsm_addr, |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 sizeof(struct sockaddr_storage)); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 req.gsm_payload_type = call->gsm_payload_type; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 req.gsm_payload_msg_type = call->gsm_payload_msg_type; |
86
f332ccc240f1
sip-in: preparations toward TMGW connect-through
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
82 req.fwd_mode = TMGW_FWD_MODE_SENDRECV; |
60
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 send_req_to_tmgw(&req); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 call->mgw_state = MGW_STATE_CONNECTING; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 call->mgw_xact = TMGW_CTRL_OP_MDCX; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 call->mgw_xact_id = req.transact_ref; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 } |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 void |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 tmgw_send_dlcx(call) |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 struct call *call; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 { |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 struct tmgw_ctrl_req req; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 bzero(&req, sizeof req); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 req.opcode = TMGW_CTRL_OP_DLCX; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 req.transact_ref = get_new_tmgw_xact_id(); |
61
e12036337412
sip-in/mgw_ops.c: fix double semicolon
Mychaela Falconia <falcon@freecalypso.org>
parents:
60
diff
changeset
|
98 req.ep_id = call->mgw_ep_id; |
60
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 send_req_to_tmgw(&req); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 call->mgw_state = MGW_STATE_DELETING; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 call->mgw_xact = TMGW_CTRL_OP_DLCX; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 call->mgw_xact_id = req.transact_ref; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 } |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 static void |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 handle_crcx_fail(call, msg) |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 struct call *call; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 struct tmgw_ctrl_resp *msg; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 { |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 call->overall_state = OVERALL_STATE_TEARDOWN; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 strcpy(call->invite_fail, "503 Gateway resource allocation failure"); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 signal_invite_error(call); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 } |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 static void |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
116 crcx_response(call, msg) |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
117 struct call *call; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118 struct tmgw_ctrl_resp *msg; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 { |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
120 if (msg->res == TMGW_RESP_OK) { |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
121 call->mgw_state = MGW_STATE_ALLOCATED; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
122 call->mgw_ep_id = msg->ep_id; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
123 bcopy(&msg->gsm_addr, &call->gsm_rtp_tmgw, |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
124 sizeof(struct sockaddr_storage)); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
125 bcopy(&msg->pstn_addr, &call->pstn_rtp_local, |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
126 sizeof(struct sockaddr_in)); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
127 switch (call->overall_state) { |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
128 case OVERALL_STATE_CRCX: |
62
75b7a7b61824
sip-in: got as far as sending MNCC_SETUP_REQ to themwi-mncc
Mychaela Falconia <falcon@freecalypso.org>
parents:
61
diff
changeset
|
129 proceed_with_call_setup(call); |
60
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
130 return; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
131 case OVERALL_STATE_TEARDOWN: |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
132 tmgw_send_dlcx(call); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
133 return; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
134 default: |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
135 bad_state: |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
136 syslog(LOG_CRIT, |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
137 "FATAL: invalid overall state 0x%x on CRCX response", |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
138 call->overall_state); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
139 exit(1); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
140 } |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
141 } else { |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
142 switch (call->overall_state) { |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
143 case OVERALL_STATE_CRCX: |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
144 handle_crcx_fail(call, msg); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
145 return; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
146 case OVERALL_STATE_TEARDOWN: |
110
c1c94b7fc2e2
sip-in call clearing: DEAD_SIP transition implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
147 transition_dead_sip(call); |
60
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
148 return; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
149 default: |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
150 goto bad_state; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
151 } |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
152 } |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
153 } |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
154 |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
155 static void |
98
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
156 handle_mdcx_fail(call, msg) |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
157 struct call *call; |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
158 struct tmgw_ctrl_resp *msg; |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
159 { |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
160 call->overall_state = OVERALL_STATE_TEARDOWN; |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
161 switch (msg->res) { |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
162 case TMGW_RESP_ERR_RSRC: |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
163 disconnect_mncc(call, GSM48_CAUSE_LOC_PRN_S_LU, |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
164 GSM48_CC_CAUSE_RESOURCE_UNAVAIL); |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
165 strcpy(call->invite_fail, |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
166 "503 Gateway resource allocation failure"); |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
167 break; |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
168 case TMGW_RESP_ERR_NOTSUP: |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
169 disconnect_mncc(call, GSM48_CAUSE_LOC_PRN_S_LU, |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
170 GSM48_CC_CAUSE_BEARER_CA_UNAVAIL); |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
171 strcpy(call->invite_fail, "502 Gateway internal error"); |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
172 break; |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
173 default: |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
174 disconnect_mncc(call, GSM48_CAUSE_LOC_PRN_S_LU, |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
175 GSM48_CC_CAUSE_PROTO_ERR); |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
176 strcpy(call->invite_fail, "502 Gateway internal error"); |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
177 } |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
178 signal_invite_error(call); |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
179 } |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
180 |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
181 static void |
60
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
182 mdcx_response(call, msg) |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
183 struct call *call; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
184 struct tmgw_ctrl_resp *msg; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
185 { |
98
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
186 if (msg->res == TMGW_RESP_OK) { |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
187 call->mgw_state = MGW_STATE_COMPLETE; |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
188 switch (call->overall_state) { |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
189 case OVERALL_STATE_ANSWERED: |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
190 signal_invite_200(call); |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
191 return; |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
192 case OVERALL_STATE_TEARDOWN: |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
193 tmgw_send_dlcx(call); |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
194 return; |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
195 default: |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
196 bad_state: |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
197 syslog(LOG_CRIT, |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
198 "FATAL: invalid overall state 0x%x on MDCX response", |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
199 call->overall_state); |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
200 exit(1); |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
201 } |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
202 } else { |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
203 tmgw_send_dlcx(call); |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
204 switch (call->overall_state) { |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
205 case OVERALL_STATE_ANSWERED: |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
206 handle_mdcx_fail(call, msg); |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
207 return; |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
208 case OVERALL_STATE_TEARDOWN: |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
209 return; |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
210 default: |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
211 goto bad_state; |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
212 } |
423610bb2c9e
sip-in: send MDCX to TMGW to connect the call through
Mychaela Falconia <falcon@freecalypso.org>
parents:
86
diff
changeset
|
213 } |
60
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
214 } |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
215 |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
216 static void |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
217 dlcx_response(call, msg) |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
218 struct call *call; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
219 struct tmgw_ctrl_resp *msg; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
220 { |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
221 if (msg->res != TMGW_RESP_OK) { |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
222 syslog(LOG_CRIT, "FATAL: TMGW DLCX failed with code 0x%x", |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
223 msg->res); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
224 exit(1); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
225 } |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
226 call->mgw_state = MGW_STATE_NO_EXIST; |
110
c1c94b7fc2e2
sip-in call clearing: DEAD_SIP transition implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
227 transition_dead_sip(call); |
60
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
228 } |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
229 |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
230 void |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
231 process_tmgw_response(msg) |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
232 struct tmgw_ctrl_resp *msg; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
233 { |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
234 struct call *call; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
235 unsigned opc; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
236 |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
237 call = find_call_with_mgw_xact(msg->transact_ref); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
238 if (!call) { |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
239 syslog(LOG_CRIT, |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
240 "FATAL: response from TMGW xact 0x%x does not match any call", |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
241 msg->transact_ref); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
242 exit(1); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
243 } |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
244 opc = call->mgw_xact; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
245 call->mgw_xact = 0; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
246 switch (opc) { |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
247 case TMGW_CTRL_OP_CRCX: |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
248 crcx_response(call, msg); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
249 return; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
250 case TMGW_CTRL_OP_MDCX: |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
251 mdcx_response(call, msg); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
252 return; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
253 case TMGW_CTRL_OP_DLCX: |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
254 dlcx_response(call, msg); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
255 return; |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
256 default: |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
257 syslog(LOG_CRIT, |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
258 "FATAL: invalid opcode 0x%x in call->msg_xact", opc); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
259 exit(1); |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
260 } |
02761f1ae5e5
sip-in INVITE processing: got as far as CRCX completion
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
261 } |