comparison mtctest/disconnect.c @ 21:cc0e1c6e33c3

themwi-test-mtc utility written, compiles
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 28 Jun 2022 18:25:28 -0800
parents
children
comparison
equal deleted inserted replaced
20:b13acb024fc6 21:cc0e1c6e33c3
1 /*
2 * In this module we implement the sending of MNCC_DISC_REQ,
3 * signaling a caller-requested disconnect aka hang-up.
4 * It is the graceful way of signaling disconnect,
5 * as opposed to simply killing the test call process with ^C
6 * and letting themwi-mncc handle the broken socket.
7 */
8
9 #include <sys/types.h>
10 #include <sys/socket.h>
11 #include <stdio.h>
12 #include <stdint.h>
13 #include <stdlib.h>
14 #include <string.h>
15 #include <strings.h>
16 #include "../include/mncc.h"
17 #include "../include/gsm48_const.h"
18
19 int disconnect_mode;
20
21 send_disconnect_req()
22 {
23 struct gsm_mncc msg;
24
25 printf("Sending disconnect request\n");
26 bzero(&msg, sizeof(struct gsm_mncc));
27 msg.msg_type = MNCC_DISC_REQ;
28 msg.callref = 1;
29 mncc_set_cause(&msg, GSM48_CAUSE_LOC_USER,
30 GSM48_CC_CAUSE_NORM_CALL_CLEAR);
31 send_mncc_to_gsm(&msg, sizeof(struct gsm_mncc));
32 disconnect_mode = 1;
33 }