add proxy-follow-redirect flag (experimental)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13402 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2009-05-20 20:51:35 +00:00
parent bf98847191
commit 2d97208b49
3 changed files with 10 additions and 1 deletions

View File

@ -191,6 +191,7 @@ typedef enum {
PFLAG_AUTOFIX_TIMING,
PFLAG_MESSAGE_QUERY_ON_REGISTER,
PFLAG_RTP_AUTOFLUSH_DURING_BRIDGE,
PFLAG_PROXY_FOLLOW_REDIRECT,
/* No new flags below this line */
PFLAG_MAX
} PFLAGS;
@ -559,6 +560,7 @@ struct private_object {
char *record_route;
char *extrtpip;
char *stun_ip;
char *route_uri;
switch_port_t stun_port;
uint32_t stun_flags;
unsigned long rm_rate;

View File

@ -2897,6 +2897,12 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
sip_contact_t * p_contact = sip->sip_contact;
int i = 0;
char var_name[80];
if (tech_pvt->route_uri && p_contact && p_contact->m_url) {
tech_pvt->route_uri = switch_core_session_strdup(tech_pvt->session, (const char *) p_contact->m_url);
nua_set_hparams(tech_pvt->nh, NUTAG_PROXY(tech_pvt->route_uri));
}
while (p_contact) {
if (p_contact->m_url) {

View File

@ -1597,6 +1597,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
if (route_uri) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Setting proxy route to %s\n", route_uri, switch_channel_get_name(channel));
tech_pvt->route_uri = switch_core_session_strdup(tech_pvt->session, route_uri);
}
nua_invite(tech_pvt->nh,
@ -1609,7 +1610,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
TAG_IF(!switch_strlen_zero(alert_info), SIPTAG_HEADER_STR(alert_info)),
TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
TAG_IF(!switch_strlen_zero(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)),
TAG_IF(route_uri, NUTAG_PROXY(route_uri)),
TAG_IF(tech_pvt->route_uri, NUTAG_PROXY(tech_pvt->route_uri)),
TAG_IF(route, SIPTAG_ROUTE_STR(route)),
TAG_IF(!switch_strlen_zero(sendto), NUTAG_PROXY(sendto)),
SOATAG_ADDRESS(tech_pvt->adv_sdp_audio_ip),