aboutsummaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/call.c22
-rw-r--r--src/common/call.h2
2 files changed, 24 insertions, 0 deletions
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);