-
Notifications
You must be signed in to change notification settings - Fork 2
/
outgoing_early_media.patch
52 lines (49 loc) · 2.44 KB
/
outgoing_early_media.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c
index 1d3ea5d1f..f13a829c5 100644
--- a/coreapi/linphonecore.c
+++ b/coreapi/linphonecore.c
@@ -7941,6 +7941,14 @@ bool_t linphone_core_get_ring_during_incoming_early_media(const LinphoneCore *lc
return (bool_t)linphone_config_get_int(lc->config, "sound", "ring_during_incoming_early_media", 0);
}
+void linphone_core_set_skip_outgoing_early_media(LinphoneCore *lc, bool_t enable) {
+ linphone_config_set_int(lc->config, "sound", "skip_outgoing_early_media", (int)enable);
+}
+
+bool_t linphone_core_get_skip_outgoing_early_media(const LinphoneCore *lc) {
+ return (bool_t)linphone_config_get_int(lc->config, "sound", "skip_outgoing_early_media", 0);
+}
+
static OrtpPayloadType* _linphone_core_find_payload_type(LinphoneCore* lc, const char* type, int rate, int channels) {
OrtpPayloadType* result = find_payload_type_from_list(type, rate, channels, lc->codecs_conf.audio_codecs);
if (result) {
diff --git a/include/linphone/core.h b/include/linphone/core.h
index 76892c5cb..2eeb59533 100644
--- a/include/linphone/core.h
+++ b/include/linphone/core.h
@@ -3328,6 +3328,10 @@ LINPHONE_PUBLIC void linphone_core_set_ring_during_incoming_early_media(Linphone
*/
LINPHONE_PUBLIC bool_t linphone_core_get_ring_during_incoming_early_media(const LinphoneCore *core);
+// TN hack to skip outgoing early media state
+LINPHONE_PUBLIC void linphone_core_set_skip_outgoing_early_media(LinphoneCore *core, bool_t enable);
+LINPHONE_PUBLIC bool_t linphone_core_get_skip_outgoing_early_media(const LinphoneCore *core);
+
LINPHONE_PUBLIC LinphoneStatus linphone_core_preview_ring(LinphoneCore *core, const char *ring, LinphoneCoreCbFunc func,
void *userdata);
diff --git a/src/conference/session/media-session.cpp b/src/conference/session/media-session.cpp
index fce30a5bc..5b41d628d 100644
--- a/src/conference/session/media-session.cpp
+++ b/src/conference/session/media-session.cpp
@@ -567,6 +567,13 @@ void MediaSessionPrivate::remoteRinging() {
L_Q();
/* Set privacy */
getCurrentParams()->setPrivacy((LinphonePrivacyMask)op->getPrivacy());
+
+ // TN hack
+ if (linphone_core_get_skip_outgoing_early_media(q->getCore()->getCCore())) {
+ setState(CallSession::State::OutgoingRinging, "Remote ringing");
+ return;
+ }
+
std::shared_ptr<SalMediaDescription> md = op->getFinalMediaDescription();
if (md) {
std::shared_ptr<SalMediaDescription> rmd = op->getRemoteMediaDescription();