comparison sip-in/mncc_handle.c @ 83:3e3fbf44f9d7

sip-in: disconnect and call clearing implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 20 Sep 2022 22:06:37 -0800
parents 5beb51de1bae
children f82157ac7303
comparison
equal deleted inserted replaced
82:ff4b76a107a1 83:3e3fbf44f9d7
16 #include "../include/gsm48_const.h" 16 #include "../include/gsm48_const.h"
17 #include "call.h" 17 #include "call.h"
18 18
19 extern struct call *find_call_by_mncc_callref(); 19 extern struct call *find_call_by_mncc_callref();
20 20
21 static struct gsm_mncc_cause default_cause = {
22 .coding = GSM48_CAUSE_CODING_GSM,
23 .location = GSM48_CAUSE_LOC_PRN_S_LU,
24 .value = GSM48_CC_CAUSE_NORMAL_UNSPEC,
25 };
26
21 static void 27 static void
22 handle_alerting(call, msg) 28 handle_alerting(call, msg)
23 struct call *call; 29 struct call *call;
24 struct gsm_mncc *msg; 30 struct gsm_mncc *msg;
25 { 31 {
52 static void 58 static void
53 handle_disconnect_ind(call, msg) 59 handle_disconnect_ind(call, msg)
54 struct call *call; 60 struct call *call;
55 struct gsm_mncc *msg; 61 struct gsm_mncc *msg;
56 { 62 {
57 /* handling to be implemented */ 63 struct gsm_mncc_cause *cause;
64
65 /* release back to MNCC */
66 msg->msg_type = MNCC_REL_REQ;
67 send_mncc_to_gsm(msg, sizeof(struct gsm_mncc));
68 call->mncc_state = MNCC_STATE_RELEASE;
69 /* signal disconnect to SIP */
70 call->overall_state = OVERALL_STATE_TEARDOWN;
71 if (msg->fields & MNCC_F_CAUSE)
72 cause = &msg->cause;
73 else
74 cause = &default_cause;
75 disconnect_sip(call, cause);
76 disconnect_tmgw(call);
58 } 77 }
59 78
60 static void 79 static void
61 handle_final_release(call, msg) 80 handle_final_release(call, msg)
62 struct call *call; 81 struct call *call;
63 struct gsm_mncc *msg; 82 struct gsm_mncc *msg;
64 { 83 {
65 /* handling to be implemented */ 84 struct gsm_mncc_cause *cause;
85
86 /* MNCC call leg is gone */
87 call->mncc_state = MNCC_STATE_NO_EXIST;
88 /* signal disconnect to SIP */
89 call->overall_state = OVERALL_STATE_TEARDOWN;
90 if (msg->fields & MNCC_F_CAUSE)
91 cause = &msg->cause;
92 else
93 cause = &default_cause;
94 disconnect_sip(call, cause);
95 disconnect_tmgw(call);
66 } 96 }
67 97
68 static void 98 static void
69 handle_signaling_msg(msg, msglen) 99 handle_signaling_msg(msg, msglen)
70 struct gsm_mncc *msg; 100 struct gsm_mncc *msg;