Module: sems
Branch: master
Commit: b987d4c48c506b36761ef9daa6a1611335f5becd
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=b987d4c48c506b36761ef9daa6a1611335f5becd

Author: Stefan Sayer <[email protected]>
Committer: Stefan Sayer <[email protected]>
Date:   Fri Nov 26 16:03:56 2010 +0100

optimization: save SDP only if refresh_method!=UPD

---

 core/AmB2BSession.cpp |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/core/AmB2BSession.cpp b/core/AmB2BSession.cpp
index f87e16d..7e4459d 100644
--- a/core/AmB2BSession.cpp
+++ b/core/AmB2BSession.cpp
@@ -407,7 +407,8 @@ void AmB2BSession::relaySip(const AmSipRequest& req)
     dlg.sendRequest(req.method, req.content_type, req.body, *hdrs, 
SIP_FLAGS_VERBATIM);
     // todo: relay error event back if sending fails
 
-    if ((req.method == SIP_METH_INVITE ||
+    if ((refresh_method != REFRESH_UPDATE) &&
+       (req.method == SIP_METH_INVITE ||
         req.method == SIP_METH_UPDATE) &&
        !req.body.empty()) {
       saveSessionDescription(req.content_type, req.body);
@@ -431,7 +432,9 @@ void AmB2BSession::relaySip(const AmSipRequest& req)
     dlg.send_200_ack(AmSipTransaction(t->second.method, 
t->first,t->second.tt), 
                     req.content_type, req.body, req.hdrs, SIP_FLAGS_VERBATIM);
 
-    if (!req.body.empty() && t->second.method == SIP_METH_INVITE) {
+    if ((refresh_method != REFRESH_UPDATE) &&
+       !req.body.empty() &&
+       (t->second.method == SIP_METH_INVITE)) {
     // delayed SDP negotiation - save SDP
       saveSessionDescription(req.content_type, req.body);
     }
@@ -455,7 +458,8 @@ void AmB2BSession::relaySip(const AmSipRequest& orig, const 
AmSipReply& reply)
            reply.content_type,
            reply.body, *hdrs,SIP_FLAGS_VERBATIM);
 
-  if ((orig.method == SIP_METH_INVITE ||
+  if ((refresh_method != REFRESH_UPDATE) &&
+      (orig.method == SIP_METH_INVITE ||
        orig.method == SIP_METH_UPDATE) &&
       !reply.body.empty()) {
     saveSessionDescription(reply.content_type, reply.body);
@@ -744,7 +748,8 @@ void AmB2BCalleeSession::onB2BEvent(B2BEvent* ev)
       return;
     }
 
-    saveSessionDescription(co_ev->content_type, co_ev->body);
+    if (refresh_method != REFRESH_UPDATE)
+      saveSessionDescription(co_ev->content_type, co_ev->body);
 
     return;
   }    

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to