[sems] Fixed severe issue in early_media and some other modules
Peter Lemenkov
peter at fedoraproject.org
Fri Aug 20 15:17:52 UTC 2010
commit 189d522e17ef98fa871562711b260ea044116376
Author: Peter Lemenkov <lemenkov at gmail.com>
Date: Fri Aug 20 19:17:35 2010 +0400
Fixed severe issue in early_media and some other modules
Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
...001-Force-to-use-system-wide-GSM-includes.patch | 4 +-
...llow-rewrite-of-custom-makefiles-by-CMake.patch | 4 +-
...Set-CFG_PREFIX-to-empty-string-by-default.patch | 4 +-
sems-0004-Fix-for-old-python-2.4.patch | 4 +-
...5-More-compatibility-with-older-CMake-2.4.patch | 4 +-
sems-0006-Typo-paramater-parameter.patch | 4 +-
...typo-this-conf-file-actually-is-a-early_a.patch | 4 +-
sems-0008-Fix-MOD_NAME-passing-to-gcc.patch | 4 +-
...009-More-CMake-templates-for-config-files.patch | 4 +-
...-variables-escaping-strategy-on-new-CMake.patch | 4 +-
...ql-in-conference-and-early_announce-modul.patch | 4 +-
...stream-AmSession-rtp_str-only-if-really-n.patch | 549 ++++++++++++++++++++
sems.spec | 8 +-
13 files changed, 578 insertions(+), 23 deletions(-)
---
diff --git a/sems-0001-Force-to-use-system-wide-GSM-includes.patch b/sems-0001-Force-to-use-system-wide-GSM-includes.patch
index 1be55f5..48d064d 100644
--- a/sems-0001-Force-to-use-system-wide-GSM-includes.patch
+++ b/sems-0001-Force-to-use-system-wide-GSM-includes.patch
@@ -1,7 +1,7 @@
From eff73786b505f8be8bf54815c379323f01cf7fd2 Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov at gmail.com>
Date: Wed, 31 Mar 2010 11:52:52 +0400
-Subject: [PATCH 01/11] Force to use system-wide GSM includes
+Subject: [PATCH 01/12] Force to use system-wide GSM includes
Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
---
@@ -22,5 +22,5 @@ index 805ef78..bfc6a59 100644
#include <stdlib.h>
--
-1.7.0.1
+1.7.2.1
diff --git a/sems-0002-Allow-rewrite-of-custom-makefiles-by-CMake.patch b/sems-0002-Allow-rewrite-of-custom-makefiles-by-CMake.patch
index a2b7fd3..652d32b 100644
--- a/sems-0002-Allow-rewrite-of-custom-makefiles-by-CMake.patch
+++ b/sems-0002-Allow-rewrite-of-custom-makefiles-by-CMake.patch
@@ -1,7 +1,7 @@
From d4fd6eb9b0964fdf982c35a919b254d1f50a6c2d Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov at gmail.com>
Date: Wed, 31 Mar 2010 11:53:48 +0400
-Subject: [PATCH 02/11] Allow rewrite of custom makefiles by CMake
+Subject: [PATCH 02/12] Allow rewrite of custom makefiles by CMake
Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
---
@@ -29,5 +29,5 @@ index 518b14c..c7c6e40 100644
OPTION(SEMS_USE_LIBSAMPLERATE "Build with libsamplerate" OFF)
OPTION(SEMS_USE_ZRTP "Build with ZRTP" OFF)
--
-1.7.0.1
+1.7.2.1
diff --git a/sems-0003-Set-CFG_PREFIX-to-empty-string-by-default.patch b/sems-0003-Set-CFG_PREFIX-to-empty-string-by-default.patch
index 67bdd05..98b7b52 100644
--- a/sems-0003-Set-CFG_PREFIX-to-empty-string-by-default.patch
+++ b/sems-0003-Set-CFG_PREFIX-to-empty-string-by-default.patch
@@ -1,7 +1,7 @@
From fae8f9be9808a690bf8e75fa9b330b32f6953e28 Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov at gmail.com>
Date: Wed, 31 Mar 2010 18:56:39 +0400
-Subject: [PATCH 03/11] Set CFG_PREFIX to empty string by default
+Subject: [PATCH 03/12] Set CFG_PREFIX to empty string by default
Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
---
@@ -22,5 +22,5 @@ index c7c6e40..e0d749a 100644
MESSAGE(STATUS "SEMS cfg prefix was set to: ${SEMS_CFG_PREFIX}")
--
-1.7.0.1
+1.7.2.1
diff --git a/sems-0004-Fix-for-old-python-2.4.patch b/sems-0004-Fix-for-old-python-2.4.patch
index 89a9231..7aabae9 100644
--- a/sems-0004-Fix-for-old-python-2.4.patch
+++ b/sems-0004-Fix-for-old-python-2.4.patch
@@ -1,7 +1,7 @@
From 981076a117ca8dd86b7f500c9ecf1def548ff008 Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov at gmail.com>
Date: Sat, 1 May 2010 22:19:48 +0400
-Subject: [PATCH 04/11] Fix for old python 2.4
+Subject: [PATCH 04/12] Fix for old python 2.4
Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
---
@@ -22,5 +22,5 @@ index f4ed59f..1a0dccb 100644
void IvrFactory::import_ivr_builtins()
--
-1.7.0.1
+1.7.2.1
diff --git a/sems-0005-More-compatibility-with-older-CMake-2.4.patch b/sems-0005-More-compatibility-with-older-CMake-2.4.patch
index e93f4f5..151699c 100644
--- a/sems-0005-More-compatibility-with-older-CMake-2.4.patch
+++ b/sems-0005-More-compatibility-with-older-CMake-2.4.patch
@@ -1,7 +1,7 @@
From 70caab6374a2c288d589be0e7200a06c6c5bfa4f Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov at gmail.com>
Date: Tue, 18 May 2010 17:31:11 +0000
-Subject: [PATCH 05/11] More compatibility with older CMake (2.4).
+Subject: [PATCH 05/12] More compatibility with older CMake (2.4).
Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
---
@@ -173,5 +173,5 @@ index 959f268..1f4dcfb 100644
SET(sems_module_libs libilbc)
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
--
-1.7.0.1
+1.7.2.1
diff --git a/sems-0006-Typo-paramater-parameter.patch b/sems-0006-Typo-paramater-parameter.patch
index 1410e77..6d20d2b 100644
--- a/sems-0006-Typo-paramater-parameter.patch
+++ b/sems-0006-Typo-paramater-parameter.patch
@@ -1,7 +1,7 @@
From d5cdf8f173398c3a46754efebdcb7b5d2194d559 Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov at gmail.com>
Date: Wed, 2 Jun 2010 09:15:40 +0000
-Subject: [PATCH 06/11] Typo: paramater => parameter
+Subject: [PATCH 06/12] Typo: paramater => parameter
Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
@@ -73,5 +73,5 @@ index 35ad77a..d834dc7 100644
}
--
-1.7.0.1
+1.7.2.1
diff --git a/sems-0007-Copy-paste-typo-this-conf-file-actually-is-a-early_a.patch b/sems-0007-Copy-paste-typo-this-conf-file-actually-is-a-early_a.patch
index a07bb11..a670426 100644
--- a/sems-0007-Copy-paste-typo-this-conf-file-actually-is-a-early_a.patch
+++ b/sems-0007-Copy-paste-typo-this-conf-file-actually-is-a-early_a.patch
@@ -1,7 +1,7 @@
From dce67b7d86d73820adec085199a7fcc6de1fe096 Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov at gmail.com>
Date: Wed, 2 Jun 2010 09:15:46 +0000
-Subject: [PATCH 07/11] Copy+paste typo: this conf-file actually is a early_announce.conf
+Subject: [PATCH 07/12] Copy+paste typo: this conf-file actually is a early_announce.conf
Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
@@ -31,5 +31,5 @@ index 0802758..2db385b 100644
}
--
-1.7.0.1
+1.7.2.1
diff --git a/sems-0008-Fix-MOD_NAME-passing-to-gcc.patch b/sems-0008-Fix-MOD_NAME-passing-to-gcc.patch
index d194d65..b34fcb1 100644
--- a/sems-0008-Fix-MOD_NAME-passing-to-gcc.patch
+++ b/sems-0008-Fix-MOD_NAME-passing-to-gcc.patch
@@ -1,7 +1,7 @@
From d84e195c467dbd7a611b67f8110039916c799ada Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov at gmail.com>
Date: Wed, 2 Jun 2010 11:12:34 +0000
-Subject: [PATCH 08/11] Fix MOD_NAME passing to gcc
+Subject: [PATCH 08/12] Fix MOD_NAME passing to gcc
Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
@@ -24,5 +24,5 @@ index 80ec94e..6299ee0 100644
# all modules should be linked against ${CMAKE_DL_LIBS} at least
# and with additional ${sems_module_libs} if they exists
--
-1.7.0.1
+1.7.2.1
diff --git a/sems-0009-More-CMake-templates-for-config-files.patch b/sems-0009-More-CMake-templates-for-config-files.patch
index 6a3560f..454b407 100644
--- a/sems-0009-More-CMake-templates-for-config-files.patch
+++ b/sems-0009-More-CMake-templates-for-config-files.patch
@@ -1,7 +1,7 @@
From 097859c512f325ea877d6b427a0ce9ac5d1c10fb Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov at gmail.com>
Date: Wed, 2 Jun 2010 12:02:20 +0000
-Subject: [PATCH 09/11] More CMake templates for config-files
+Subject: [PATCH 09/12] More CMake templates for config-files
Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
@@ -45,5 +45,5 @@ index 0000000..96ba1e1
@@ -0,0 +1 @@
+script_path=${SEMS_EXEC_PREFIX}/${SEMS_LIBDIR}/sems/py_sems/
--
-1.7.0.1
+1.7.2.1
diff --git a/sems-0010-Fix-newest-variables-escaping-strategy-on-new-CMake.patch b/sems-0010-Fix-newest-variables-escaping-strategy-on-new-CMake.patch
index 2fa7d15..f84b005 100644
--- a/sems-0010-Fix-newest-variables-escaping-strategy-on-new-CMake.patch
+++ b/sems-0010-Fix-newest-variables-escaping-strategy-on-new-CMake.patch
@@ -1,7 +1,7 @@
From 0ebc0eb0051a62d26e9788af15b4a8cb7c2e9562 Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov at gmail.com>
Date: Wed, 2 Jun 2010 13:13:04 +0000
-Subject: [PATCH 10/11] Fix newest variables escaping strategy on new CMake
+Subject: [PATCH 10/12] Fix newest variables escaping strategy on new CMake
Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
@@ -24,5 +24,5 @@ index 0cfb538..8eb128b 100644
SET(SEMS_MAJOR_VERSION 1)
--
-1.7.0.1
+1.7.2.1
diff --git a/sems-0011-Disable-mysql-in-conference-and-early_announce-modul.patch b/sems-0011-Disable-mysql-in-conference-and-early_announce-modul.patch
index 587e8ba..c0c0cd9 100644
--- a/sems-0011-Disable-mysql-in-conference-and-early_announce-modul.patch
+++ b/sems-0011-Disable-mysql-in-conference-and-early_announce-modul.patch
@@ -1,7 +1,7 @@
From 90b5fcd79d4c6366b1b8f8d12c8670968d6c70d3 Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov at gmail.com>
Date: Fri, 25 Jun 2010 12:16:45 +0400
-Subject: [PATCH 11/11] Disable mysql++ in conference and early_announce modules
+Subject: [PATCH 11/12] Disable mysql++ in conference and early_announce modules
Unfortunately, this breaks existing configurations, which is a
no-go situation for EPEL repository. We'll enable it later.
@@ -59,5 +59,5 @@ index 184d282..1e23638 100644
SET(sems_module_name early_announce)
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
--
-1.7.0.1
+1.7.2.1
diff --git a/sems-0012-create-RTP-stream-AmSession-rtp_str-only-if-really-n.patch b/sems-0012-create-RTP-stream-AmSession-rtp_str-only-if-really-n.patch
new file mode 100644
index 0000000..4723a8a
--- /dev/null
+++ b/sems-0012-create-RTP-stream-AmSession-rtp_str-only-if-really-n.patch
@@ -0,0 +1,549 @@
+From f520621508d13311cde0d7d91df458603a1b2d63 Mon Sep 17 00:00:00 2001
+From: Stefan Sayer <stefan.sayer at googlemail.com>
+Date: Thu, 15 Apr 2010 13:01:00 +0000
+Subject: [PATCH 12/12] create RTP stream (AmSession::rtp_str) only if really needed
+
+replace AmSession::rtp_str with AmSession::RTPStream() in your app.
+
+for example for pure signaling B2B calls, no RTP stream instance is
+created, which saves a lot of memory (especially because of
+the RTP receive buffer)
+
+ref r30371 r30372
+
+git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1784 8eb893ce-cfd4-0310-b710-fb5ebe64c474
+---
+ apps/auth_b2b/AuthB2B.cpp | 12 +++---
+ apps/call_timer/CallTimer.cpp | 4 +-
+ apps/callback/CallBack.cpp | 4 +-
+ apps/conference/Conference.cpp | 6 +-
+ apps/dsm/mods/mod_conference/ModConference.cpp | 6 +-
+ apps/examples/b2b_connect/b2b_connect.cpp | 4 +-
+ .../pinauthconference/PinAuthConference.cpp | 2 +-
+ apps/examples/serviceline/ServiceLine.cpp | 2 +-
+ .../simple_conference/SimpleConference.cpp | 2 +-
+ apps/gateway/GWSession.cpp | 2 +-
+ apps/sw_prepaid_sip/SWPrepaidSIP.cpp | 4 +-
+ apps/webconference/WebConferenceDialog.cpp | 4 +-
+ core/AmMediaProcessor.cpp | 18 ++++----
+ core/AmSession.cpp | 42 ++++++++++---------
+ core/AmSession.h | 19 +++++++--
+ core/plug-in/echo/Echo.cpp | 6 +-
+ 16 files changed, 75 insertions(+), 62 deletions(-)
+
+diff --git a/apps/auth_b2b/AuthB2B.cpp b/apps/auth_b2b/AuthB2B.cpp
+index e415f9f..3cdd6ab 100644
+--- a/apps/auth_b2b/AuthB2B.cpp
++++ b/apps/auth_b2b/AuthB2B.cpp
+@@ -109,8 +109,8 @@ void AuthB2BDialog::onInvite(const AmSipRequest& req)
+ // -> only in SessionFactory::onInvite they do. todo: move the logic to
+ // session factory
+
+- setReceiving(false);
+- AmMediaProcessor::instance()->removeSession(this);
++ // this will prevent us from being added to media processor
++ setInOut(NULL,NULL);
+
+ if (AuthB2BFactory::user.empty()) {
+ string app_param = getHeader(req.hdrs, PARAM_HDR);
+@@ -131,10 +131,10 @@ void AuthB2BDialog::onInvite(const AmSipRequest& req)
+ from = "sip:"+user+"@"+domain;
+ to = "sip:"+req.user+"@"+domain;
+
+-// DBG("-----------------------------------------------------------------\n");
+-// DBG("domain = %s, user = %s, pwd = %s, from = %s, to = %s;",
+-// domain.c_str(), user.c_str(), password.c_str(), from.c_str(), to.c_str());
+-// DBG("-----------------------------------------------------------------\n");
++ // DBG("-----------------------------------------------------------------\n");
++ // DBG("domain = %s, user = %s, pwd = %s, from = %s, to = %s;",
++ // domain.c_str(), user.c_str(), password.c_str(), from.c_str(), to.c_str());
++ // DBG("-----------------------------------------------------------------\n");
+
+ m_state = BB_Dialing;
+
+diff --git a/apps/call_timer/CallTimer.cpp b/apps/call_timer/CallTimer.cpp
+index 79a5bfe..24d6cd9 100644
+--- a/apps/call_timer/CallTimer.cpp
++++ b/apps/call_timer/CallTimer.cpp
+@@ -137,8 +137,8 @@ void CallTimerDialog::onInvite(const AmSipRequest& req)
+ return;
+ }
+
+- setReceiving(false);
+- AmMediaProcessor::instance()->removeSession(this);
++ // this will prevent us from being added to media processor
++ setInOut(NULL,NULL);
+
+ m_state = BB_Dialing;
+
+diff --git a/apps/callback/CallBack.cpp b/apps/callback/CallBack.cpp
+index c03f01d..988a61b 100644
+--- a/apps/callback/CallBack.cpp
++++ b/apps/callback/CallBack.cpp
+@@ -228,7 +228,7 @@ CallBackDialog::CallBackDialog(AmPromptCollection& prompts,
+ state(CBNone)
+ {
+ // set configured playout type
+- rtp_str.setPlayoutType(CallBackFactory::m_PlayoutType);
++ RTPStream()->setPlayoutType(CallBackFactory::m_PlayoutType);
+ }
+
+ CallBackDialog::~CallBackDialog()
+@@ -321,7 +321,7 @@ CallBackCalleeDialog::CallBackCalleeDialog(const string& other_tag,
+ : AmB2ABCalleeSession(other_tag, connector), cred(cred)
+ {
+ // set configured playout type
+- rtp_str.setPlayoutType(CallBackFactory::m_PlayoutType);
++ RTPStream()->setPlayoutType(CallBackFactory::m_PlayoutType);
+ setDtmfDetectionEnabled(false);
+ }
+
+diff --git a/apps/conference/Conference.cpp b/apps/conference/Conference.cpp
+index 06ff807..4aad409 100644
+--- a/apps/conference/Conference.cpp
++++ b/apps/conference/Conference.cpp
+@@ -349,7 +349,7 @@ ConferenceDialog::ConferenceDialog(const string& conf_id,
+ allow_dialout(false)
+ {
+ dialedout = this->dialout_channel.get() != 0;
+- rtp_str.setPlayoutType(ConferenceFactory::m_PlayoutType);
++ RTPStream()->setPlayoutType(ConferenceFactory::m_PlayoutType);
+ #ifdef WITH_SAS_TTS
+ tts_voice = register_cmu_us_kal();
+ #endif
+@@ -763,7 +763,7 @@ void ConferenceDialog::createDialoutParticipant(const string& uri_user)
+ dialout_dlg.remote_uri = uri;
+
+ string body;
+- int local_port = dialout_session->rtp_str.getLocalPort();
++ int local_port = dialout_session->RTPStream()->getLocalPort();
+ dialout_session->sdp.genRequest(AmConfig::LocalIP,local_port,body);
+
+ if (extra_headers.length() == 0) {
+@@ -855,7 +855,7 @@ void ConferenceDialog::onSipRequest(const AmSipRequest& req)
+ DBG("ConferenceDialog::onSipRequest: remote_tag = %s\n",dlg.remote_tag.c_str());
+
+ string body;
+- int local_port = rtp_str.getLocalPort();
++ int local_port = RTPStream()->getLocalPort();
+ sdp.genRequest(AmConfig::LocalIP,local_port,body);
+ dlg.sendRequest("INVITE","application/sdp",body,"");
+
+diff --git a/apps/dsm/mods/mod_conference/ModConference.cpp b/apps/dsm/mods/mod_conference/ModConference.cpp
+index 24f7306..791cdbc 100644
+--- a/apps/dsm/mods/mod_conference/ModConference.cpp
++++ b/apps/dsm/mods/mod_conference/ModConference.cpp
+@@ -195,9 +195,9 @@ EXEC_ACTION_START(ConfRejoinAction) {
+ EXEC_ACTION_START(ConfSetPlayoutTypeAction) {
+ string playout_type = resolveVars(arg, sess, sc_sess, event_params);
+ if (playout_type == "adaptive")
+- sess->rtp_str.setPlayoutType(ADAPTIVE_PLAYOUT);
++ sess->RTPStream()->setPlayoutType(ADAPTIVE_PLAYOUT);
+ else if (playout_type == "jb")
+- sess->rtp_str.setPlayoutType(JB_PLAYOUT);
++ sess->RTPStream()->setPlayoutType(JB_PLAYOUT);
+ else
+- sess->rtp_str.setPlayoutType(SIMPLE_PLAYOUT);
++ sess->RTPStream()->setPlayoutType(SIMPLE_PLAYOUT);
+ } EXEC_ACTION_END;
+diff --git a/apps/examples/b2b_connect/b2b_connect.cpp b/apps/examples/b2b_connect/b2b_connect.cpp
+index 7c35c52..6c7ccfa 100644
+--- a/apps/examples/b2b_connect/b2b_connect.cpp
++++ b/apps/examples/b2b_connect/b2b_connect.cpp
+@@ -93,7 +93,7 @@ b2b_connectDialog::b2b_connectDialog() // AmDynInvoke* user_timer)
+ AmB2ABCallerSession()
+
+ {
+- rtp_str.setPlayoutType(ADAPTIVE_PLAYOUT);
++ RTPStream()->setPlayoutType(ADAPTIVE_PLAYOUT);
+ }
+
+ b2b_connectDialog::~b2b_connectDialog()
+@@ -274,7 +274,7 @@ b2b_connectCalleeSession::b2b_connectCalleeSession(const string& other_tag,
+ : credentials("", user, pwd), // domain (realm) is unused in credentials
+ AmB2ABCalleeSession(other_tag, connector)
+ {
+- rtp_str.setPlayoutType(ADAPTIVE_PLAYOUT);
++ RTPStream()->setPlayoutType(ADAPTIVE_PLAYOUT);
+ setDtmfDetectionEnabled(false);
+ }
+
+diff --git a/apps/examples/pinauthconference/PinAuthConference.cpp b/apps/examples/pinauthconference/PinAuthConference.cpp
+index 521df25..d75e10d 100644
+--- a/apps/examples/pinauthconference/PinAuthConference.cpp
++++ b/apps/examples/pinauthconference/PinAuthConference.cpp
+@@ -101,7 +101,7 @@ PinAuthConferenceDialog::PinAuthConferenceDialog(AmPromptCollection& prompts)
+ : play_list(this), separator(this, 0), prompts(prompts), state(None)
+ {
+ // set configured playout type
+- rtp_str.setPlayoutType(PinAuthConferenceFactory::m_PlayoutType);
++ RTPStream()->setPlayoutType(PinAuthConferenceFactory::m_PlayoutType);
+ }
+
+ PinAuthConferenceDialog::~PinAuthConferenceDialog()
+diff --git a/apps/examples/serviceline/ServiceLine.cpp b/apps/examples/serviceline/ServiceLine.cpp
+index a8c9b9e..427543d 100644
+--- a/apps/examples/serviceline/ServiceLine.cpp
++++ b/apps/examples/serviceline/ServiceLine.cpp
+@@ -204,7 +204,7 @@ ServiceLineCalleeDialog::ServiceLineCalleeDialog(const string& other_tag,
+ ServiceLineFactory::GWAuthuser,
+ ServiceLineFactory::GWAuthpwd)
+ {
+- rtp_str.setPlayoutType(ADAPTIVE_PLAYOUT);
++ RTPStream()->setPlayoutType(ADAPTIVE_PLAYOUT);
+ setDtmfDetectionEnabled(false);
+ }
+
+diff --git a/apps/examples/simple_conference/SimpleConference.cpp b/apps/examples/simple_conference/SimpleConference.cpp
+index ccc0930..9a5c9f7 100644
+--- a/apps/examples/simple_conference/SimpleConference.cpp
++++ b/apps/examples/simple_conference/SimpleConference.cpp
+@@ -60,7 +60,7 @@ SimpleConferenceDialog::SimpleConferenceDialog()
+ : play_list(this)
+ {
+ // use adaptive playout - its the best method around
+- rtp_str.setPlayoutType(ADAPTIVE_PLAYOUT);
++ RTPStream()->setPlayoutType(ADAPTIVE_PLAYOUT);
+ }
+
+ SimpleConferenceDialog::~SimpleConferenceDialog()
+diff --git a/apps/gateway/GWSession.cpp b/apps/gateway/GWSession.cpp
+index f7c3b00..e946839 100644
+--- a/apps/gateway/GWSession.cpp
++++ b/apps/gateway/GWSession.cpp
+@@ -26,7 +26,7 @@ void GWSession::setOtherLeg(AmAudio *otherleg) {
+ }
+ void GWSession::onInvite(const AmSipRequest& req) {
+ DBG("GWSession::onInvite\n");
+-// rtp_str.setMonitorRTPTimeout(false);
++// RTPStream()->setMonitorRTPTimeout(false);
+ invite_req=req;
+ return;
+ }
+diff --git a/apps/sw_prepaid_sip/SWPrepaidSIP.cpp b/apps/sw_prepaid_sip/SWPrepaidSIP.cpp
+index d2d7fb9..339d1d2 100644
+--- a/apps/sw_prepaid_sip/SWPrepaidSIP.cpp
++++ b/apps/sw_prepaid_sip/SWPrepaidSIP.cpp
+@@ -118,8 +118,8 @@ void SWPrepaidSIPDialog::onInvite(const AmSipRequest& req)
+
+ // TODO: errors thrown as exception don't seem to trigger a reply?
+
+- setReceiving(false);
+- AmMediaProcessor::instance()->removeSession(this);
++ // this will prevent us from being added to media processor
++ setInOut(NULL,NULL);
+
+ m_uuid = getHeader(req.hdrs,"P-Caller-Uuid");
+ if(!m_uuid.length()) {
+diff --git a/apps/webconference/WebConferenceDialog.cpp b/apps/webconference/WebConferenceDialog.cpp
+index d41d191..d95ac6f 100644
+--- a/apps/webconference/WebConferenceDialog.cpp
++++ b/apps/webconference/WebConferenceDialog.cpp
+@@ -40,7 +40,7 @@ WebConferenceDialog::WebConferenceDialog(AmPromptCollection& prompts,
+ is_dialout = (cred != NULL);
+ accept_early_session = is_dialout;
+ // set configured playout type
+- rtp_str.setPlayoutType(WebConferenceFactory::m_PlayoutType);
++ RTPStream()->setPlayoutType(WebConferenceFactory::m_PlayoutType);
+ }
+
+ WebConferenceDialog::WebConferenceDialog(AmPromptCollection& prompts,
+@@ -54,7 +54,7 @@ WebConferenceDialog::WebConferenceDialog(AmPromptCollection& prompts,
+ DBG("set conf_id to %s\n", conf_id.c_str());
+ is_dialout = false;
+ // set configured playout type
+- rtp_str.setPlayoutType(WebConferenceFactory::m_PlayoutType);
++ RTPStream()->setPlayoutType(WebConferenceFactory::m_PlayoutType);
+ }
+
+ WebConferenceDialog::~WebConferenceDialog()
+diff --git a/core/AmMediaProcessor.cpp b/core/AmMediaProcessor.cpp
+index c59b930..312d5c8 100644
+--- a/core/AmMediaProcessor.cpp
++++ b/core/AmMediaProcessor.cpp
+@@ -284,10 +284,10 @@ void AmMediaProcessorThread::processAudio(unsigned int ts)
+
+ AmSession* s = (*it);
+ // todo: get frame size/checkInterval from local audio if local in+out (?)
+- unsigned int f_size = s->rtp_str.getFrameSize();
++ unsigned int f_size = s->RTPStream()->getFrameSize();
+
+ // complete frame time reached?
+- if (s->rtp_str.checkInterval(ts, f_size)) {
++ if (s->RTPStream()->checkInterval(ts, f_size)) {
+ s->lockAudio();
+
+ int got_audio = -1;
+@@ -295,8 +295,8 @@ void AmMediaProcessorThread::processAudio(unsigned int ts)
+ // get/receive audio
+ if (!s->getAudioLocal(AM_AUDIO_IN)) {
+ // input is not local - receive from rtp stream
+- if (s->rtp_str.receiving || s->rtp_str.getPassiveMode()) {
+- int ret = s->rtp_str.receive(ts);
++ if (s->RTPStream()->receiving || s->RTPStream()->getPassiveMode()) {
++ int ret = s->RTPStream()->receive(ts);
+ if(ret < 0){
+ switch(ret){
+
+@@ -317,7 +317,7 @@ void AmMediaProcessorThread::processAudio(unsigned int ts)
+ break;
+ }
+ } else {
+- got_audio = s->rtp_str.get(ts,buffer,f_size);
++ got_audio = s->RTPStream()->get(ts,buffer,f_size);
+
+ if (s->isDtmfDetectionEnabled() && got_audio > 0)
+ s->putDtmfAudio(buffer, got_audio, ts);
+@@ -355,9 +355,9 @@ void AmMediaProcessorThread::processAudio(unsigned int ts)
+ s->lockAudio();
+ AmAudio* output = s->getOutput();
+
+- if(output && s->rtp_str.sendIntReached()){
++ if(output && s->RTPStream()->sendIntReached()){
+
+- int size = output->get(ts,buffer,s->rtp_str.getFrameSize());
++ int size = output->get(ts,buffer,s->RTPStream()->getFrameSize());
+ if(size <= 0){
+ DBG("output->get() returned: %i\n",size);
+ postRequest(new SchedRequest(AmMediaProcessor::ClearSession,s));
+@@ -365,8 +365,8 @@ void AmMediaProcessorThread::processAudio(unsigned int ts)
+ else {
+ if (!s->getAudioLocal(AM_AUDIO_OUT)) {
+ // audio should go to RTP
+- if(!s->rtp_str.mute){
+- if(s->rtp_str.put(ts,buffer,size)<0)
++ if(!s->RTPStream()->mute){
++ if(s->RTPStream()->put(ts,buffer,size)<0)
+ postRequest(new SchedRequest(AmMediaProcessor::ClearSession,s));
+ }
+ } else {
+diff --git a/core/AmSession.cpp b/core/AmSession.cpp
+index e25caaf..38d23e3 100644
+--- a/core/AmSession.cpp
++++ b/core/AmSession.cpp
+@@ -60,7 +60,7 @@ AmSession::AmSession()
+ : AmEventQueue(this), // AmDialogState(),
+ dlg(this),
+ detached(true),
+- sess_stopped(false),rtp_str(this),negotiate_onreply(false),
++ sess_stopped(false),negotiate_onreply(false),
+ input(0), output(0), local_input(0), local_output(0),
+ m_dtmfDetector(this), m_dtmfEventQueue(&m_dtmfDetector),
+ m_dtmfDetectionEnabled(true),
+@@ -208,7 +208,7 @@ const vector<SdpPayload*>& AmSession::getPayloads()
+
+ int AmSession::getRPort()
+ {
+- return rtp_str.getRPort();
++ return RTPStream()->getRPort();
+ }
+
+ AmPayloadProviderInterface* AmSession::getPayloadProvider() {
+@@ -262,7 +262,7 @@ void AmSession::negotiate(const string& sdp_body,
+ telephone_event_payload->payload_type);
+
+ lockAudio();
+- rtp_str.setTelephoneEventPT(telephone_event_payload);
++ RTPStream()->setTelephoneEventPT(telephone_event_payload);
+ unlockAudio();
+ }
+ else {
+@@ -280,9 +280,9 @@ void AmSession::negotiate(const string& sdp_body,
+
+ lockAudio();
+ try {
+- rtp_str.setLocalIP(AmConfig::LocalIP);
+- rtp_str.setPassiveMode(passive_mode);
+- rtp_str.setRAddr(r_host, r_port);
++ RTPStream()->setLocalIP(AmConfig::LocalIP);
++ RTPStream()->setPassiveMode(passive_mode);
++ RTPStream()->setRAddr(r_host, r_port);
+ } catch (const string& err_str) {
+ unlockAudio();
+ throw AmSession::Exception(400, err_str);
+@@ -293,7 +293,9 @@ void AmSession::negotiate(const string& sdp_body,
+ unlockAudio();
+
+ if(sdp_reply)
+- sdp.genResponse(advertisedIP(), rtp_str.getLocalPort(), *sdp_reply, AmConfig::SingleCodecInOK);
++ sdp.genResponse(advertisedIP(),
++ RTPStream()->getLocalPort(),
++ *sdp_reply, AmConfig::SingleCodecInOK);
+ }
+
+ void AmSession::run()
+@@ -318,7 +320,7 @@ void AmSession::run()
+ return;
+ }
+
+- zrtp_audio = zrtp_attach_stream(zrtp_session, rtp_str.get_ssrc());
++ zrtp_audio = zrtp_attach_stream(zrtp_session, RTPStream()->get_ssrc());
+ zrtp_audio->stream_usr_data = this;
+
+ if (NULL == zrtp_audio) {
+@@ -648,7 +650,7 @@ void AmSession::onSipReply(const AmSipReply& reply)
+ case AmSipDialog::Connected:
+
+ try {
+- rtp_str.setMonitorRTPTimeout(true);
++ RTPStream()->setMonitorRTPTimeout(true);
+
+ acceptAudio(reply.body,reply.hdrs);
+
+@@ -681,7 +683,7 @@ void AmSession::onSipReply(const AmSipReply& reply)
+
+ onRinging(reply);
+
+- rtp_str.setMonitorRTPTimeout(false);
++ RTPStream()->setMonitorRTPTimeout(false);
+
+ if(input || output || local_input || local_output)
+ AmMediaProcessor::instance()->addSession(this,
+@@ -697,10 +699,10 @@ void AmSession::onSipReply(const AmSipReply& reply)
+
+ onEarlySessionStart(reply);
+
+- rtp_str.setMonitorRTPTimeout(false);
++ RTPStream()->setMonitorRTPTimeout(false);
+
+ // ping the other side to open fw/NAT/symmetric RTP
+- rtp_str.ping();
++ RTPStream()->ping();
+
+ if(input || output || local_input || local_output)
+ AmMediaProcessor::instance()->addSession(this,
+@@ -760,11 +762,11 @@ int AmSession::acceptAudio(const string& body,
+
+ // enable RTP stream
+ lockAudio();
+- rtp_str.init(m_payloads);
++ RTPStream()->init(m_payloads);
+ unlockAudio();
+
+ DBG("Sending Rtp data to %s/%i\n",
+- rtp_str.getRHost().c_str(),rtp_str.getRPort());
++ RTPStream()->getRHost().c_str(),RTPStream()->getRPort());
+
+ return 0;
+ }
+@@ -819,9 +821,9 @@ void AmSession::sendUpdate()
+ void AmSession::sendReinvite(bool updateSDP, const string& headers)
+ {
+ if (updateSDP) {
+- rtp_str.setLocalIP(AmConfig::LocalIP);
++ RTPStream()->setLocalIP(AmConfig::LocalIP);
+ string sdp_body;
+- sdp.genResponse(advertisedIP(), rtp_str.getLocalPort(), sdp_body);
++ sdp.genResponse(advertisedIP(), RTPStream()->getLocalPort(), sdp_body);
+ dlg.reinvite(headers, "application/sdp", sdp_body);
+ } else {
+ dlg.reinvite(headers, "", "");
+@@ -834,19 +836,19 @@ int AmSession::sendInvite(const string& headers)
+
+ // Set local IP first, so that IP is set when
+ // getLocalPort/setLocalPort may bind.
+- rtp_str.setLocalIP(AmConfig::LocalIP);
++ RTPStream()->setLocalIP(AmConfig::LocalIP);
+
+ // Generate SDP.
+ string sdp_body;
+- sdp.genRequest(advertisedIP(), rtp_str.getLocalPort(), sdp_body);
++ sdp.genRequest(advertisedIP(), RTPStream()->getLocalPort(), sdp_body);
+ return dlg.invite(headers, "application/sdp", sdp_body);
+ }
+
+ void AmSession::setOnHold(bool hold)
+ {
+ lockAudio();
+- bool old_hold = rtp_str.getOnHold();
+- rtp_str.setOnHold(hold);
++ bool old_hold = RTPStream()->getOnHold();
++ RTPStream()->setOnHold(hold);
+ if (hold != old_hold)
+ sendReinvite();
+ unlockAudio();
+diff --git a/core/AmSession.h b/core/AmSession.h
+index 6fb4356..74c03bf 100644
+--- a/core/AmSession.h
++++ b/core/AmSession.h
+@@ -111,7 +111,9 @@ private:
+ friend class AmMediaProcessorThread;
+ friend class AmSessionContainer;
+ friend class AmSessionFactory;
+-
++
++ auto_ptr<AmRtpAudio> _rtp_str;
++
+ protected:
+ AmSdp sdp;
+
+@@ -126,7 +128,7 @@ protected:
+
+ public:
+
+- AmRtpAudio rtp_str;
++ AmRtpAudio* RTPStream();
+
+ #ifdef WITH_ZRTP
+ zrtp_conn_ctx_t* zrtp_session; // ZRTP session
+@@ -253,10 +255,10 @@ public:
+ void clearAudio();
+
+ /** setter for rtp_str->mute */
+- void setMute(bool mute) { rtp_str.mute = mute; }
++ void setMute(bool mute) { RTPStream()->mute = mute; }
+
+ /** setter for rtp_str->receiving */
+- void setReceiving(bool receive) { rtp_str.receiving = receive; }
++ void setReceiving(bool receive) { RTPStream()->receiving = receive; }
+
+ /** Gets the Session's call ID */
+ const string& getCallID() const;
+@@ -477,6 +479,15 @@ public:
+ string advertisedIP();
+ };
+
++inline AmRtpAudio* AmSession::RTPStream() {
++ if (NULL == _rtp_str.get()) {
++ DBG("creating RTP stream instance for session [%p]\n",
++ this);
++ _rtp_str.reset(new AmRtpAudio(this));
++ }
++ return _rtp_str.get();
++}
++
+ #endif
+
+ // Local Variables:
+diff --git a/core/plug-in/echo/Echo.cpp b/core/plug-in/echo/Echo.cpp
+index 21a6a29..a90e051 100644
+--- a/core/plug-in/echo/Echo.cpp
++++ b/core/plug-in/echo/Echo.cpp
+@@ -104,13 +104,13 @@ EchoDialog::~EchoDialog()
+
+ void EchoDialog::onSessionStart(const AmSipRequest& req)
+ {
+- rtp_str.setPlayoutType(playout_type);
++ RTPStream()->setPlayoutType(playout_type);
+ setInOut(&echo,&echo);
+ }
+
+ void EchoDialog::onSessionStart(const AmSipReply& req)
+ {
+- rtp_str.setPlayoutType(playout_type);
++ RTPStream()->setPlayoutType(playout_type);
+ setInOut(&echo,&echo);
+ }
+
+@@ -134,7 +134,7 @@ void EchoDialog::onDtmf(int event, int duration)
+ playout_type = SIMPLE_PLAYOUT;
+ DBG("received *. set playout technique to %s.\n", pt);
+
+- rtp_str.setPlayoutType(playout_type);
++ RTPStream()->setPlayoutType(playout_type);
+ }
+ #endif
+ }
+--
+1.7.2.1
+
diff --git a/sems.spec b/sems.spec
index 5b4341e..993c411 100644
--- a/sems.spec
+++ b/sems.spec
@@ -1,7 +1,7 @@
Summary: SIP Express Media Server, an extensible SIP media server
Name: sems
Version: 1.2.1
-Release: 5%{?dist}
+Release: 6%{?dist}
URL: http://www.iptel.org/sems
## wget http://ftp.iptel.org/pub/sems/1.2/1.2.1/src/sems-1.2.1.tar.gz
## tar zx --exclude iLBC_rfc3951 -f sems-1.2.1.tar.gz
@@ -32,6 +32,8 @@ Patch10: sems-0010-Fix-newest-variables-escaping-strategy-on-new-CMake.patch
# Disable MySQL++ in conference and early_announce until good docs and failover to
# existing file-based configuration will be provided
Patch11: sems-0011-Disable-mysql-in-conference-and-early_announce-modul.patch
+# Backported from upstream
+Patch12: sems-0012-create-RTP-stream-AmSession-rtp_str-only-if-really-n.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: python >= 2.3
@@ -212,6 +214,7 @@ rm -rf core/plug-in/gsm/gsm-1.0-pl10/
%patch10 -p1 -b .fix_escaping_in_cmake
%endif
%patch11 -p1 -b .disable_mysqlpp_in_conf_and_ea
+%patch12 -p1 -b .fix_segfault
iconv -f iso8859-1 -t UTF-8 doc/Readme.diameter_client.txt > doc/Readme.diameter_client.utf8 && mv doc/Readme.diameter_client.{utf8,txt}
@@ -625,6 +628,9 @@ fi
%{_libdir}/%{name}/plug-in/xmlrpc2di.so
%changelog
+* Fri Aug 20 2010 Peter Lemenkov <lemenkov at gmail.com> 1.2.1-6
+- Fixed severe issue in early_announce module (see %%patch12)
+
* Sat Jul 31 2010 Toshio Kuratomi <toshio at fedoraproject.org> 1.2.1-5
- rebuild for python 2.7
More information about the scm-commits
mailing list