From 2d07b7b82180d7aa9db77b80f11e45998aea198b Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Tue, 27 Mar 2007 19:58:45 +0000 Subject: [PATCH] fixes SessionComponent hook handling onSendRequest; this fixes requests sent with session timer to contain SST headers git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@282 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- core/AmSession.cpp | 16 ++++++++++------ core/AmSession.h | 2 +- core/AmSipDialog.cpp | 6 +++--- core/plug-in/session_timer/SessionTimer.cpp | 5 +++-- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/core/AmSession.cpp b/core/AmSession.cpp index 200794e7..82eb93cb 100644 --- a/core/AmSession.cpp +++ b/core/AmSession.cpp @@ -676,12 +676,16 @@ void AmSession::sendUpdate() dlg.update(""); } -void AmSession::sendReinvite() -{ - rtp_str.setLocalIP(AmConfig::LocalIP); - string sdp_body; - sdp.genResponse(AmConfig::LocalIP,rtp_str.getLocalPort(),sdp_body); - dlg.reinvite("", "application/sdp", sdp_body); +void AmSession::sendReinvite(bool updateSDP) +{ + if (updateSDP) { + rtp_str.setLocalIP(AmConfig::LocalIP); + string sdp_body; + sdp.genResponse(AmConfig::LocalIP,rtp_str.getLocalPort(),sdp_body); + dlg.reinvite("", "application/sdp", sdp_body); + } else { + dlg.reinvite("", "", ""); + } } void AmSession::sendInvite() diff --git a/core/AmSession.h b/core/AmSession.h index 0e1e764a..4a9236f1 100644 --- a/core/AmSession.h +++ b/core/AmSession.h @@ -264,7 +264,7 @@ public: /** send an UPDATE in the session */ void sendUpdate(); /** send a Re-INVITE (if connected) */ - void sendReinvite(); + void sendReinvite(bool updateSDP = true); /** send an INVITE */ void sendInvite(); diff --git a/core/AmSipDialog.cpp b/core/AmSipDialog.cpp index 80451da3..aa9142fe 100644 --- a/core/AmSipDialog.cpp +++ b/core/AmSipDialog.cpp @@ -583,9 +583,9 @@ int AmSipDialog::sendRequest(const string& method, if((method!="BYE")&&(method!="CANCEL")) msg += getContactHdr(); - if(!hdrs.empty()){ - msg += hdrs; - if(hdrs[hdrs.length()-1] != '\n') + if(!m_hdrs.empty()){ + msg += m_hdrs; + if(m_hdrs[m_hdrs.length()-1] != '\n') msg += "\n"; } diff --git a/core/plug-in/session_timer/SessionTimer.cpp b/core/plug-in/session_timer/SessionTimer.cpp index 53fd7349..b037f491 100644 --- a/core/plug-in/session_timer/SessionTimer.cpp +++ b/core/plug-in/session_timer/SessionTimer.cpp @@ -311,8 +311,9 @@ void SessionTimer::onTimeoutEvent(AmTimeoutEvent* timeout_ev) int timer_id = timeout_ev->data.get(0).asInt(); if (timer_id == ID_SESSION_REFRESH_TIMER) { - if (session_refresher == refresh_local) - s->sendReinvite(); + if (session_refresher == refresh_local) + // send reinvite with SDP + s->sendReinvite(true); else WARN("need session refresh but remote session is refresher\n"); } else if (timer_id == ID_SESSION_INTERVAL_TIMER) {