[sr-dev] git:master: modules/mediaproxy: Fix SDP mangling for unsupported streams.

Juha Heinanen jh at tutpro.com
Sun Jun 20 16:29:16 CEST 2010


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

Author: Juha Heinanen <jh at tutpro.com>
Committer: Juha Heinanen <jh at tutpro.com>
Date:   Sun Jun 20 16:21:12 2010 +0300

modules/mediaproxy: Fix SDP mangling for unsupported streams.
- Credits to Saul Ibarra.

---

 modules/mediaproxy/mediaproxy.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/modules/mediaproxy/mediaproxy.c b/modules/mediaproxy/mediaproxy.c
index 67a0c72..855fb7d 100644
--- a/modules/mediaproxy/mediaproxy.c
+++ b/modules/mediaproxy/mediaproxy.c
@@ -1733,7 +1733,7 @@ use_media_proxy(struct sip_msg *msg, char *dialog_id, ice_candidate_data *ice_da
         }
     }
 
-    for (i=0, j=1; i<session.stream_count && j<len; i++) {
+    for (i=0, j=1; i<session.stream_count; i++) {
         stream = session.streams[i];
         if (stream.transport != TSupported) {
             if (!stream.local_ip && removed_session_ip) {
@@ -1748,6 +1748,10 @@ use_media_proxy(struct sip_msg *msg, char *dialog_id, ice_candidate_data *ice_da
             continue;
         }
 
+        if (j >= len) {
+            break;
+        }
+        
         if (!isnullport(stream.port)) {
             if (!replace_element(msg, &stream.port, &tokens[j])) {
                 LM_ERR("failed to replace port in media stream number %d\n", i+1);




More information about the sr-dev mailing list