mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-06-15 19:45:56 +00:00
mod_sofia: fix bugzilla 6341 - dialplan not replacing user in contact string
This commit is contained in:
parent
f3d8dc8ad3
commit
94e6bcfd2b
@ -3552,6 +3552,13 @@ SWITCH_STANDARD_API(sofia_contact_function)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
switch_mutex_unlock(mod_sofia_globals.hash_mutex);
|
||||
}
|
||||
|
||||
reply = (char *) mystream.data;
|
||||
|
||||
if (user_replacement) {
|
||||
int urlcount = 0;
|
||||
int copyerr = 0;
|
||||
@ -3564,6 +3571,9 @@ SWITCH_STANDARD_API(sofia_contact_function)
|
||||
switch_size_t replacesize = strlen(user_replacement);
|
||||
switch_size_t allocsize = 0;
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "sofia_contact(): trying to replace %s in %s\n",
|
||||
user_replacement, str);
|
||||
|
||||
/* first pass to count how many URLs we have */
|
||||
while ((urlstart = strcasestr(str, "sip:")) || (urlstart = strcasestr(str, "sips:"))) {
|
||||
urlcount++;
|
||||
@ -3633,21 +3643,13 @@ copydone:
|
||||
} else {
|
||||
strcpy(newptr, str);
|
||||
reply = newreply;
|
||||
goto end;
|
||||
}
|
||||
} else {
|
||||
reply = "error/replacement error";
|
||||
/* on error, we do nothing and just default to the original stream returned (mystream.data) */
|
||||
}
|
||||
}
|
||||
|
||||
stream->write_function(stream, "%s", reply);
|
||||
reply = NULL;
|
||||
|
||||
switch_safe_free(mystream.data);
|
||||
}
|
||||
|
||||
switch_mutex_unlock(mod_sofia_globals.hash_mutex);
|
||||
}
|
||||
|
||||
reply = (char *) mystream.data;
|
||||
|
||||
end:
|
||||
|
Loading…
x
Reference in New Issue
Block a user