comparison mtctest/disconnect.c @ 5:e7b192a5dee5

mtctest: initial import from old ThemWi
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 09 Jun 2024 00:58:38 +0000
parents
children a902ccbf6bbc
comparison
equal deleted inserted replaced
4:ce450869db09 5:e7b192a5dee5
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 }