Module: sems Branch: master Commit: 097e6f668b8319dd81208e3b7513ed95043c5c3c URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=097e6f668b8319dd81208e3b7513ed95043c5c3c
Author: Raphael Coeffic <[email protected]> Committer: Raphael Coeffic <[email protected]> Date: Fri Feb 24 10:52:44 2012 +0100 b/f: align SessionTimer::onSendRequest() to the current API. --- core/plug-in/session_timer/SessionTimer.cpp | 28 +++++++++++--------------- core/plug-in/session_timer/SessionTimer.h | 7 +----- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/core/plug-in/session_timer/SessionTimer.cpp b/core/plug-in/session_timer/SessionTimer.cpp index 91d9bf8..692126b 100644 --- a/core/plug-in/session_timer/SessionTimer.cpp +++ b/core/plug-in/session_timer/SessionTimer.cpp @@ -135,33 +135,29 @@ bool SessionTimer::onSipReply(const AmSipReply& reply, AmSipDialog::Status old_d return false; } -bool SessionTimer::onSendRequest(const string& method, - const AmMimeBody* body, - string& hdrs, - int flags, - unsigned int cseq) +bool SessionTimer::onSendRequest(AmSipRequest& req, int flags) { - if (method == "BYE") { + if (req.method == "BYE") { removeTimers(s); return false; } if (session_timer_conf.getEnableSessionTimer() && - ((method == SIP_METH_INVITE) || (method == SIP_METH_UPDATE))) { + ((req.method == SIP_METH_INVITE) || (req.method == SIP_METH_UPDATE))) { // save INVITE and UPDATE so we can resend on 422 reply - DBG("adding %d to list of sent requests.\n", cseq); - sent_requests[cseq] = SIPRequestInfo(method, - body, - hdrs); + DBG("adding %d to list of sent requests.\n", req.cseq); + sent_requests[req.cseq] = SIPRequestInfo(req.method, + &req.body, + req.hdrs); } - addOptionTag(hdrs, SIP_HDR_SUPPORTED, TIMER_OPTION_TAG); - if ((method != SIP_METH_INVITE) && (method != SIP_METH_UPDATE)) + addOptionTag(req.hdrs, SIP_HDR_SUPPORTED, TIMER_OPTION_TAG); + if ((req.method != SIP_METH_INVITE) && (req.method != SIP_METH_UPDATE)) return false; // session-expires / min-se only in INV/UPD - removeHeader(hdrs, SIP_HDR_SESSION_EXPIRES); - removeHeader(hdrs, SIP_HDR_MIN_SE); - hdrs += SIP_HDR_COLSP(SIP_HDR_SESSION_EXPIRES) + int2str(session_interval) + CRLF + removeHeader(req.hdrs, SIP_HDR_SESSION_EXPIRES); + removeHeader(req.hdrs, SIP_HDR_MIN_SE); + req.hdrs += SIP_HDR_COLSP(SIP_HDR_SESSION_EXPIRES) + int2str(session_interval) + CRLF + SIP_HDR_COLSP(SIP_HDR_MIN_SE) + int2str(min_se) + CRLF; return false; diff --git a/core/plug-in/session_timer/SessionTimer.h b/core/plug-in/session_timer/SessionTimer.h index fbcef6c..24c40ce 100644 --- a/core/plug-in/session_timer/SessionTimer.h +++ b/core/plug-in/session_timer/SessionTimer.h @@ -157,12 +157,7 @@ class SessionTimer: public AmSessionEventHandler virtual bool onSipRequest(const AmSipRequest&); virtual bool onSipReply(const AmSipReply&, AmSipDialog::Status old_dlg_status); - virtual bool onSendRequest(const string& method, - const AmMimeBody* body, - string& hdrs, - int flags, - unsigned int cseq); - + virtual bool onSendRequest(AmSipRequest& req, int flags); virtual bool onSendReply(AmSipReply& reply, int flags); }; _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
