]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix patch from (MODENDP-231)
authorMichael Jerris <mike@jerris.com>
Mon, 27 Jul 2009 16:18:16 +0000 (16:18 +0000)
committerMichael Jerris <mike@jerris.com>
Mon, 27 Jul 2009 16:18:16 +0000 (16:18 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14376 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia.c

index 082bf3c525e377450dab49f9804fffa508ee18da..0c539f27f8c629bb9df2c19b4abe383cda51426f 100644 (file)
@@ -671,14 +671,13 @@ void event_handler(switch_event_t *event)
                        switch_copy_string(fixed_contact_str, contact_str, len);
        
                        if ((sptr = strstr(fixed_contact_str, needle))) {
-                               if (!(eptr = strchr(fixed_contact_str, ';'))) {
-                                       eptr = strrchr(fixed_contact_str, '>');
-                               }
+                               char *origsptr = strstr(contact_str, needle);
+                               eptr = strchr(++origsptr, ';');
                        } else {
                                sptr = strchr(fixed_contact_str, '\0') - 1;
                        }
 
-                       switch_snprintf(sptr, len - (sptr - fixed_contact_str), ";fs_path=sip:%s%s%s", to_host, eptr ? ";" : "", eptr ? eptr : ">");
+                       switch_snprintf(sptr, len - (sptr - fixed_contact_str), ";fs_path=sip:%s%s", to_host, eptr ? eptr : ">");
 
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Rewrote contact string from '%s' to '%s'\n", contact_str, fixed_contact_str);
                        contact_str = fixed_contact_str;