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

Author: Raphael Coeffic <[email protected]>
Committer: Raphael Coeffic <[email protected]>
Date:   Wed Oct  3 12:38:34 2012 +0200

b/f: fix RTP local IP binding

thx to  Szokovacs Robert for reporting.

---

 core/AmSession.cpp |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/core/AmSession.cpp b/core/AmSession.cpp
index 8e97356..181773b 100644
--- a/core/AmSession.cpp
+++ b/core/AmSession.cpp
@@ -927,15 +927,17 @@ bool AmSession::getSdpOffer(AmSdp& offer)
   if(RTPStream()->getSdpMediaIndex() < 0)
     offer.media.clear();
 
+  unsigned int media_idx = 0;
   if(!offer.media.size()) {
     offer.media.push_back(SdpMedia());
     offer.media.back().type=MT_AUDIO;
-    RTPStream()->getSdpOffer(0,offer.media.back());
   }
   else {
-    RTPStream()->getSdpOffer(RTPStream()->getSdpMediaIndex(),
-                            offer.media.back());
+    media_idx = RTPStream()->getSdpMediaIndex();
   }
+
+  RTPStream()->setLocalIP(advertisedIP());
+  RTPStream()->getSdpOffer(media_idx,offer.media.back());
   
   return true;
 }
@@ -985,6 +987,7 @@ bool AmSession::getSdpAnswer(const AmSdp& offer, AmSdp& 
answer)
         && audio_1st_stream 
         && (m_it->port != 0) ) {
 
+      RTPStream()->setLocalIP(advertisedIP());
       RTPStream()->getSdpAnswer(media_index,*m_it,answer_media);
       if(answer_media.payloads.empty() ||
         ((answer_media.payloads.size() == 1) &&
@@ -1019,8 +1022,6 @@ bool AmSession::getSdpAnswer(const AmSdp& offer, AmSdp& 
answer)
     media_index++;
   }
 
-
-
   return true;
 }
 

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

Reply via email to