aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/call.c
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2016-07-20 12:50:22 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2016-07-24 12:31:08 +0200
commit5807a49f49cd8bf2537f89403576127502a05866 (patch)
tree5cf67be5811a4e7c89c27cc97a71fe979f0ec650 /src/common/call.c
parent4745b291158fd5b10255f5cb18fed838c2125af0 (diff)
Release active call, when disconnect is received from network
If early disconnect is received, the connecion is kept established, so the announcement can be heared by mobile subscriber.
Diffstat (limited to 'src/common/call.c')
-rw-r--r--src/common/call.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/common/call.c b/src/common/call.c
index 6e7ab2f..0b0ab17 100644
--- a/src/common/call.c
+++ b/src/common/call.c
@@ -35,6 +35,7 @@
extern int use_mncc_sock;
extern int send_patterns;
+extern int release_on_disconnect;
/* stream patterns/announcements */
int16_t *ringback_spl = NULL;
@@ -972,7 +973,6 @@ void call_mncc_recv(uint8_t *buf, int length)
if (send_patterns) {
PDEBUG(DCALL, DEBUG_DEBUG, "Early connecting after setup\n");
- set_state_process(callref, CALL_CONNECT);
_indicate_answer(callref, number);
break;
}
@@ -984,6 +984,14 @@ void call_mncc_recv(uint8_t *buf, int length)
case MNCC_DISC_REQ:
PDEBUG(DMNCC, DEBUG_INFO, "Received MNCC disconnect from Network with cause %d\n", mncc->cause.value);
+ if (is_process_state(callref) == CALL_CONNECT && release_on_disconnect) {
+ PDEBUG(DCALL, DEBUG_INFO, "Releaseing, because we don't send disconnect tones to mobile phone\n");
+
+ PDEBUG(DMNCC, DEBUG_INFO, "Releasing MNCC call towards Network\n");
+ mncc->msg_type = MNCC_REL_IND;
+ mncc_write(buf, sizeof(struct gsm_mncc));
+ goto release;
+ }
set_state_process(callref, CALL_DISCONNECTED);
PDEBUG(DCALL, DEBUG_INFO, "Call disconnected\n");
call_out_disconnect(callref, mncc->cause.value);
@@ -991,6 +999,7 @@ void call_mncc_recv(uint8_t *buf, int length)
case MNCC_REL_REQ:
PDEBUG(DMNCC, DEBUG_INFO, "Received MNCC release from Network with cause %d\n", mncc->cause.value);
+release:
destroy_process(callref);
PDEBUG(DCALL, DEBUG_INFO, "Call released\n");
call_out_release(callref, mncc->cause.value);