aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2017-08-06 11:30:39 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2017-08-09 17:27:08 +0200
commit8ce3ff455d83c692f240969a8c9f2d61ba4533e3 (patch)
treea4258386e1ae8f9267b86416896d4bbf1bb37423
parentf5e4058c6f2bfeccdb4054c1e9fb7263cea95935 (diff)
Add incoming answer to call control, also allow to send recall tone
-rw-r--r--src/amps/amps.c4
-rw-r--r--src/anetz/anetz.c4
-rw-r--r--src/bnetz/bnetz.c4
-rw-r--r--src/cnetz/cnetz.c4
-rw-r--r--src/common/call.c22
-rw-r--r--src/common/call.h2
-rw-r--r--src/nmt/nmt.c4
-rw-r--r--src/test/dummy.c1
8 files changed, 45 insertions, 0 deletions
diff --git a/src/amps/amps.c b/src/amps/amps.c
index ae5f3ea..2150ecb 100644
--- a/src/amps/amps.c
+++ b/src/amps/amps.c
@@ -940,6 +940,10 @@ inval:
return 0;
}
+void call_out_answer(int __attribute__((unused)) callref)
+{
+}
+
/* Call control sends disconnect (with tones).
* An active call stays active, so tones and annoucements can be received
* by mobile station.
diff --git a/src/anetz/anetz.c b/src/anetz/anetz.c
index d4d8de6..8acd098 100644
--- a/src/anetz/anetz.c
+++ b/src/anetz/anetz.c
@@ -437,6 +437,10 @@ inval:
return 0;
}
+void call_out_answer(int __attribute__((unused)) callref)
+{
+}
+
/* Call control sends disconnect (with tones).
* An active call stays active, so tones and annoucements can be received
* by mobile station.
diff --git a/src/bnetz/bnetz.c b/src/bnetz/bnetz.c
index 8971837..b014301 100644
--- a/src/bnetz/bnetz.c
+++ b/src/bnetz/bnetz.c
@@ -741,6 +741,10 @@ inval:
return 0;
}
+void call_out_answer(int __attribute__((unused)) callref)
+{
+}
+
/* Call control sends disconnect (with tones).
* An active call stays active, so tones and annoucements can be received
* by mobile station.
diff --git a/src/cnetz/cnetz.c b/src/cnetz/cnetz.c
index 52cb58a..4948c24 100644
--- a/src/cnetz/cnetz.c
+++ b/src/cnetz/cnetz.c
@@ -589,6 +589,10 @@ inval:
return 0;
}
+void call_out_answer(int __attribute__((unused)) callref)
+{
+}
+
/* Call control sends disconnect (with tones).
* An active call stays active, so tones and annoucements can be received
* by mobile station.
diff --git a/src/common/call.c b/src/common/call.c
index 4452c5e..b7294ab 100644
--- a/src/common/call.c
+++ b/src/common/call.c
@@ -61,6 +61,7 @@ int16_t *noanswer_spl = NULL;
int16_t *outoforder_spl = NULL;
int16_t *invalidnumber_spl = NULL;
int16_t *congestion_spl = NULL;
+int16_t *recall_spl = NULL;
int test_size = 0;
int ringback_size = 0;
int hangup_size = 0;
@@ -69,6 +70,7 @@ int noanswer_size = 0;
int outoforder_size = 0;
int invalidnumber_size = 0;
int congestion_size = 0;
+int recall_size = 0;
int test_max = 0;
int ringback_max = 0;
int hangup_max = 0;
@@ -77,6 +79,7 @@ int noanswer_max = 0;
int outoforder_max = 0;
int invalidnumber_max = 0;
int congestion_max = 0;
+int recall_max = 0;
enum call_state {
CALL_IDLE = 0,
@@ -106,6 +109,7 @@ enum audio_pattern {
PATTERN_OUTOFORDER,
PATTERN_INVALIDNUMBER,
PATTERN_CONGESTION,
+ PATTERN_RECALL,
};
void get_pattern(const int16_t **spl, int *size, int *max, enum audio_pattern pattern)
@@ -121,6 +125,7 @@ void get_pattern(const int16_t **spl, int *size, int *max, enum audio_pattern pa
*max = test_max;
break;
case PATTERN_RINGBACK:
+no_recall:
*spl = ringback_spl;
*size = ringback_size;
*max = ringback_max;
@@ -167,6 +172,13 @@ no_invalidnumber:
*size = congestion_size;
*max = congestion_max;
break;
+ case PATTERN_RECALL:
+ if (!recall_spl)
+ goto no_recall;
+ *spl = recall_spl;
+ *size = recall_size;
+ *max = recall_max;
+ break;
default:
;
}
@@ -935,6 +947,14 @@ void call_in_release(int callref, int cause)
call.disc_cause = cause;
}
+/* turn recall tone on or off */
+void call_tone_recall(int callref, int on)
+{
+ /* can do that only with MNCC socket */
+ if (call.use_mncc_sock)
+ set_pattern_process(callref, (on) ? PATTERN_RECALL : PATTERN_NONE);
+}
+
/* forward audio to MNCC or call instance */
void call_tx_audio(int callref, sample_t *samples, int count)
{
@@ -1133,6 +1153,8 @@ void call_mncc_recv(uint8_t *buf, int length)
case MNCC_SETUP_RSP:
PDEBUG(DMNCC, DEBUG_INFO, "Received MNCC answer from Network\n");
set_state_process(callref, CALL_CONNECT);
+ PDEBUG(DCALL, DEBUG_INFO, "Call disconnected\n");
+ call_out_answer(callref);
break;
case MNCC_DISC_REQ:
PDEBUG(DMNCC, DEBUG_INFO, "Received MNCC disconnect from Network with cause %d\n", mncc->cause.value);
diff --git a/src/common/call.h b/src/common/call.h
index 03bc1d2..e3c7964 100644
--- a/src/common/call.h
+++ b/src/common/call.h
@@ -22,9 +22,11 @@ int call_in_setup(int callref, const char *callerid, const char *dialing);
void call_in_alerting(int callref);
void call_in_answer(int callref, const char *connect_id);
void call_in_release(int callref, int cause);
+void call_tone_recall(int callref, int on);
/* send messages */
int call_out_setup(int callref, const char *caller_id, enum number_type caller_type, const char *dialing);
+void call_out_answer(int callref);
void call_out_disconnect(int callref, int cause);
void call_out_release(int callref, int cause);
diff --git a/src/nmt/nmt.c b/src/nmt/nmt.c
index 1ec6d08..905e523 100644
--- a/src/nmt/nmt.c
+++ b/src/nmt/nmt.c
@@ -1802,6 +1802,10 @@ int sms_out_setup(char *dialing, const char *caller_id, enum number_type caller_
return _out_setup(0, caller_id, caller_type, dialing, sms);
}
+void call_out_answer(int __attribute__((unused)) callref)
+{
+}
+
/* Call control sends disconnect (with tones).
* An active call stays active, so tones and annoucements can be received
* by mobile station.
diff --git a/src/test/dummy.c b/src/test/dummy.c
index f8b01dd..3cd55b5 100644
--- a/src/test/dummy.c
+++ b/src/test/dummy.c
@@ -2,6 +2,7 @@ void call_rx_audio() { }
void call_out_setup() { }
void call_out_release() { }
void call_out_disconnect() { }
+void call_out_answer() { }
void print_help() { }
void sender_send() { }
void sender_receive() { }