comparison sip-in/mgw_resp.c @ 152:7176dc850d7a

sip-in hold/retr error handling: simply send BYE Because we know that the SIP state is CONNECTED at the time of any such error event, we can call initiate_bye() instead of disconnect_sip(), and thereby get rid of struct gsm_mncc_cause which will never be used in this scenario anyway.
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 11 Oct 2022 16:11:21 -0800
parents 0ecbc3dc8f93
children
comparison
equal deleted inserted replaced
151:0ecbc3dc8f93 152:7176dc850d7a
12 #include <stdlib.h> 12 #include <stdlib.h>
13 #include <string.h> 13 #include <string.h>
14 #include <strings.h> 14 #include <strings.h>
15 #include <syslog.h> 15 #include <syslog.h>
16 #include "../include/gsm48_const.h" 16 #include "../include/gsm48_const.h"
17 #include "../include/mncc.h"
18 #include "../include/tmgw_ctrl.h" 17 #include "../include/tmgw_ctrl.h"
19 #include "../include/tmgw_const.h" 18 #include "../include/tmgw_const.h"
20 #include "call.h" 19 #include "call.h"
21 20
22 extern struct call *find_call_with_mgw_xact(); 21 extern struct call *find_call_with_mgw_xact();
130 goto bad_state; 129 goto bad_state;
131 } 130 }
132 } 131 }
133 } 132 }
134 133
135 static struct gsm_mncc_cause mgw_hold_retrieve_error = {
136 .coding = GSM48_CAUSE_CODING_GSM,
137 .location = GSM48_CAUSE_LOC_PRN_S_LU,
138 .value = GSM48_CC_CAUSE_NETWORK_OOO,
139 };
140
141 static void 134 static void
142 mdcx_hold_response(call, msg) 135 mdcx_hold_response(call, msg)
143 struct call *call; 136 struct call *call;
144 struct tmgw_ctrl_resp *msg; 137 struct tmgw_ctrl_resp *msg;
145 { 138 {
153 } else { 146 } else {
154 call->overall_state = OVERALL_STATE_TEARDOWN; 147 call->overall_state = OVERALL_STATE_TEARDOWN;
155 tmgw_send_dlcx(call); 148 tmgw_send_dlcx(call);
156 disconnect_mncc(call, GSM48_CAUSE_LOC_PRN_S_LU, 149 disconnect_mncc(call, GSM48_CAUSE_LOC_PRN_S_LU,
157 GSM48_CC_CAUSE_NETWORK_OOO); 150 GSM48_CC_CAUSE_NETWORK_OOO);
158 disconnect_sip(call, &mgw_hold_retrieve_error); 151 initiate_bye(call);
159 } 152 }
160 } 153 }
161 154
162 static void 155 static void
163 mdcx_retrieve_response(call, msg) 156 mdcx_retrieve_response(call, msg)
174 } else { 167 } else {
175 call->overall_state = OVERALL_STATE_TEARDOWN; 168 call->overall_state = OVERALL_STATE_TEARDOWN;
176 tmgw_send_dlcx(call); 169 tmgw_send_dlcx(call);
177 disconnect_mncc(call, GSM48_CAUSE_LOC_PRN_S_LU, 170 disconnect_mncc(call, GSM48_CAUSE_LOC_PRN_S_LU,
178 GSM48_CC_CAUSE_NETWORK_OOO); 171 GSM48_CC_CAUSE_NETWORK_OOO);
179 disconnect_sip(call, &mgw_hold_retrieve_error); 172 initiate_bye(call);
180 } 173 }
181 } 174 }
182 175
183 static void 176 static void
184 mdcx_response(call, msg) 177 mdcx_response(call, msg)