提交 8a569060 authored 作者: Michael Jerris's avatar Michael Jerris

use the request uri instead of to for primary routing

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3891 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 3bb03d93
...@@ -3974,7 +3974,7 @@ static void sip_i_invite(nua_t *nua, ...@@ -3974,7 +3974,7 @@ static void sip_i_invite(nua_t *nua,
sip_from_t const *from = sip->sip_from; sip_from_t const *from = sip->sip_from;
sip_to_t const *to = sip->sip_to; sip_to_t const *to = sip->sip_to;
char *displayname; char *displayname;
char *username, *to_username = NULL; char *username, *req_username = NULL;
char *url_user = (char *) from->a_url->url_user; char *url_user = (char *) from->a_url->url_user;
char *to_user, *to_host, *to_port; char *to_user, *to_host, *to_port;
char *req_user, *req_host, *req_port; char *req_user, *req_host, *req_port;
...@@ -4050,14 +4050,6 @@ static void sip_i_invite(nua_t *nua, ...@@ -4050,14 +4050,6 @@ static void sip_i_invite(nua_t *nua,
return; return;
} }
if (profile->pflags & PFLAG_FULL_ID) {
if (!(to_username = switch_mprintf("%s@%s:%s", (char *) to_user, (char *) to_host, to_port))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
switch_safe_free(username);
return;
}
}
attach_private(session, profile, tech_pvt, username); attach_private(session, profile, tech_pvt, username);
...@@ -4105,6 +4097,14 @@ static void sip_i_invite(nua_t *nua, ...@@ -4105,6 +4097,14 @@ static void sip_i_invite(nua_t *nua,
req_port = "5060"; req_port = "5060";
} }
if (profile->pflags & PFLAG_FULL_ID) {
if (!(req_username = switch_mprintf("%s@%s:%s", (char *) req_user, (char *) req_host, req_port))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
switch_safe_free(username);
return;
}
}
switch_channel_set_variable(channel, "sip_req_user", req_user); switch_channel_set_variable(channel, "sip_req_user", req_user);
switch_channel_set_variable(channel, "sip_req_host", req_host); switch_channel_set_variable(channel, "sip_req_host", req_host);
switch_channel_set_variable(channel, "sip_req_port", req_port); switch_channel_set_variable(channel, "sip_req_port", req_port);
...@@ -4148,7 +4148,7 @@ static void sip_i_invite(nua_t *nua, ...@@ -4148,7 +4148,7 @@ static void sip_i_invite(nua_t *nua,
(char *)modname, (char *)modname,
(profile->context && !strcasecmp(profile->context, "_domain_")) ? (profile->context && !strcasecmp(profile->context, "_domain_")) ?
(char *) from->a_url->url_host : profile->context, (char *) from->a_url->url_host : profile->context,
to_username ? to_username : (char *) to_user req_username ? req_username : (char *) req_user
)) != 0) { )) != 0) {
...@@ -4207,7 +4207,7 @@ static void sip_i_invite(nua_t *nua, ...@@ -4207,7 +4207,7 @@ static void sip_i_invite(nua_t *nua,
switch_channel_set_caller_profile(channel, tech_pvt->caller_profile); switch_channel_set_caller_profile(channel, tech_pvt->caller_profile);
switch_safe_free(username); switch_safe_free(username);
switch_safe_free(to_username); switch_safe_free(req_username);
} }
if (!(tech_pvt->sofia_private = malloc(sizeof(*tech_pvt->sofia_private)))) { if (!(tech_pvt->sofia_private = malloc(sizeof(*tech_pvt->sofia_private)))) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论