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

Author: Raphael Coeffic <[email protected]>
Committer: Raphael Coeffic <[email protected]>
Date:   Thu Jul 14 14:54:40 2011 +0200

adds AmSdp::clear()

---

 core/AmSdp.cpp |   24 +++++++++++++++++++-----
 core/AmSdp.h   |    7 +++++--
 2 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/core/AmSdp.cpp b/core/AmSdp.cpp
index 03f57de..900fc05 100644
--- a/core/AmSdp.cpp
+++ b/core/AmSdp.cpp
@@ -112,8 +112,8 @@ string SdpAttribute::print() const {
 // class AmSdp: Methods
 //
 AmSdp::AmSdp()
-  : remote_active(false),
-    accepted_media(0)
+  : version(0),
+    remote_active(false)
 {
   l_origin.user = "sems";
   l_origin.sessId = get_random();
@@ -127,15 +127,14 @@ AmSdp::AmSdp(const AmSdp& p_sdp_msg)
     sessionName(p_sdp_msg.sessionName),
     conn(p_sdp_msg.conn),
     media(p_sdp_msg.media),
-    remote_active(false),
-    accepted_media(0)
+    remote_active(false)
 {
 }
 
 int AmSdp::parse(const char* _sdp_msg)
 {
   char* s = (char*)_sdp_msg;
-  media.clear();
+  clear();
   
   bool ret = parse_sdp_line_ex(this,s);
   
@@ -238,6 +237,20 @@ const SdpPayload *AmSdp::findPayload(const string& name) 
const
   return NULL;
 }
 
+void AmSdp::clear()
+{
+  version = 0;
+  origin  = SdpOrigin();
+  sessionName.clear();
+  uri.clear();
+  conn = SdpConnection();
+  attributes.clear();
+  media.clear();
+  remote_active = false;
+  l_origin = SdpOrigin();
+}
+
+
 //parser
 static bool parse_sdp_line_ex(AmSdp* sdp_msg, char*& s)
 {
@@ -1087,3 +1100,4 @@ static bool attr_check(std::string attr)
     return false;
     }
 }
+
diff --git a/core/AmSdp.h b/core/AmSdp.h
index 441eefb..6d6f01d 100644
--- a/core/AmSdp.h
+++ b/core/AmSdp.h
@@ -175,8 +175,6 @@ public:
   // us to do passive RTP ?
   bool remote_active;
 
-  unsigned int accepted_media;   // index of the media which we accept (todo: 
multi stream)
-
   SdpOrigin        l_origin;      // local origin (o= )
     
   AmSdp();
@@ -201,6 +199,11 @@ public:
    * Test if remote UA supports 'telefone_event'.
    */
   //bool hasTelephoneEvent();
+
+  /**
+   * Clear all parsed values.
+   */
+  void clear();
 };
 
 #endif

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

Reply via email to